f



Re: SAS help needed

Data Have ;
Infile Cards ;
Input sno dt Date9. ;
Cards ;
1011 01jan2000
1012 02jan2000
1012 03jan2000
1012 04jan2000
1012 05jan2000
1012 06jan2000
1012 07jan2000
1013 03jan2000
1013 04jan2000
1013 05jan2000
1013 06jan2000
1013 07jan2000
;
Run ;


Data Need ( Drop = Cnt ) ;
Length NewVar $ 2 ;
Set Have ;
By Sno ;
Retian Newvar ;

If First.SNO Then Do ;
  Cnt + 1 ;
  NewVar = CatS( 'A' , Cnt ) ;
End ;

Run ;

Proc Print
Data = Need ;
Format DT Date9. ;
Run ;



Toby Dunn

If anything simply cannot go wrong, it will anyway.  Murphys Law #2.

The buddy system is essential to your survival; it gives the enemy somebody
else to shoot at.
Murphys Law #


Tell a man there are 300 billion stars in the universe and he'll believe
you. Tell him a bench has wet paint on it and he'll have to touch to be
sure.  Murphys Law #9






From: DP <adsingh78@GMAIL.COM>
Reply-To: DP <adsingh78@GMAIL.COM>
To: SAS-L@LISTSERV.UGA.EDU
Subject: SAS help needed
Date: Fri, 8 Jun 2007 11:16:14 -0400

Hi, I need help in creating a dataset.

I have

sno      dt

1011    01jan2000
1012    02jan2000
1012    03jan2000
1012    04jan2000
1012    05jan2000
1012    06jan2000
1012    07jan2000
1013    03jan2000
1013    04jan2000
1013    05jan2000
1013    06jan2000
1013    07jan2000

want:


sno      dt              new_var

1011    01jan2000        a1
1012    02jan2000        a1
1012    03jan2000        a2
1012    04jan2000        a3
1012    05jan2000        a4
1012    06jan2000        a1
1012    07jan2000        a2
1013    03jan2000        a1
1013    04jan2000        a2
1013    05jan2000        a3
1013    06jan2000        a4
1013    07jan2000        a1

All the records are sorted by dt within sno and want to add a new variable
in which 1st recore will have a1, 2nd will have a2, 3rd will have a3, 4th
will have a4, 5th will have a1 again, 6th will have a2, and so on... The
pattern repeats.

Thanks in Advance.

DP

_________________________________________________________________
Picture this � share your photos and you could win big!
http://www.GETREALPhotoContest.com?ocid=TXT_TAGHM&loc=us
0
tobydunn (6020)
6/8/2007 3:22:04 PM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

0 Replies
526 Views

Similar Articles

[PageSpeed] 42

Reply:

Similar Artilces:

Re: Old SAS Guy needs help with some of these new fangled SAS
Hi John, I believe PROC IMPORT writes dedicated data step code to the log that you can reuse. Regards - Jim. -- Jim Groeneveld, Netherlands Statistician, SAS consultant home.hccnet.nl/jim.groeneveld On Tue, 2 Dec 2008 00:26:53 -0600, John F. Regus <jfregus@IX.NETCOM.COM> wrote: >Greetings all who have helped me in the past. > >Here is something that has been bothering me unending and is causing me sleepless afternoons. > >I know that I can import just about any file imaginable into SAS using the import function using SAS Windows 9.1.3. >However, when trying to get comma seperated values moved all at once into the new SAS file, >I can (or only know how to get) the data for one variable moved at a time. I would like to do a mass >move of all the data from the input file into the new SAS file. Is there a way to do this? Because once > I have imported the file into a new SAS file, established variable names, established formats, informats, >variable lengths, etc. I would like to be able to save the settings for the next like file that I want to import into what I have >already slaved over doing, defining, etc., without repeating the process. > >Is there a way to do this? > >Waiting with bad breath on the sidelines. > >The Old SYS/390 guy >"SAS was originally invented for computer performance and capacity planning for the SYS/3x0 IBM machines... >they sure have taken it into new features that are amazing&...

Re: Old SAS Guy needs help with some of these new fangled SAS #2
It's been a while since I used the Import Wizard but as I recall, there is a window which asks for a file name where SAS can store the input statments for your future use. Nat Wooding Environmental Specialist III Dominion, Environmental Biology 4111 Castlewood Rd Richmond, VA 23234 Phone:804-271-5313, Fax: 804-271-2977 Jim Groeneveld <jim.1stat@YAHOO. COM> To Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU Discussion" cc <SAS-L@LISTSERV.U GA.EDU> Subject Re: Old SAS Guy needs help with some of these new fangled SAS 12/02/2008 04:49 9.1.3 gizmos for Windows AM Please respond to Jim Groeneveld <jim.1stat@YAHOO. COM> Hi John, I believe PROC IMPORT writes dedicated data step code to the log that you can reuse. Regards - Jim. -- Jim Groeneveld, Netherlands Statistician, SAS consultant home.hccnet.nl/jim.groeneveld On Tue, 2 Dec 2008 00:26:53 -0600, John F. Regus <jfregus@IX.NETCOM.COM> wrote: >Greetings all who have helped me in the past. > >Here is something that has been bothering me unending and is causing me sl...

Re: Need Help in learning SAS...........
Ruskanna, Before anyone attempts to answer your request, please tell the list more about yourself (e.g., education, major and the type of job you are seeking). The answers will be quite different if you are seeking a job programming SAS, accomplishing data mining-related tasks, doing statistical analyses, or whatever. Art ---------- On Sun, 17 Apr 2005 15:51:39 -0700, ruksana <ruksana_anjum@REDIFFMAIL.COM> wrote: >hi there, >i am a student learning SAS on own can u plz guide me. >i am in search of job and i want to know th topic on >which i should be perfect. can u plz he...

Re: Need help in SAS CODE
Your question can be translated as "To find the number at the tail of a string". Now think about a way to reset very letters in the string to blank, then we will have a new string with some numbers separated by blanks. The number you want is at the very right hand side, which can be easily extracted with a scan function: data have; input geneID $1-25; tailnum=scan(translate(upcase(geneid),' ', '_ABCDEFGHIJKLMNOPQRSTUVWXYZ'),-1,' '); cards; 100_g_at1 100_g_at12 AFFX-YEL024w/RIP1_at8 AFFX-YEL024w/RIP1_at10 AFFX-YEL024w/RIP1_at20 AFFX-YEL024w/RIP1_kkk209 34sdfsf_345nldog_456 ; proc print; run; 100_g_at1 1 100_g_at12 12 AFFX-YEL024w/RIP1_at8 8 AFFX-YEL024w/RIP1_at10 10 AFFX-YEL024w/RIP1_at20 20 AFFX-YEL024w/RIP1_kkk209 209 34sdfsf_345nldog_456 456 On Mon, 9 Jul 2007 20:51:38 -0700, gsantu_here@YAHOO.CO.IN wrote: >Hi, > >I have a problem with the following data. I have 6000 data values,my >data set looks like folloing: > >geneID >100_g_at1 >100_g_at2 >100_g_at3 >100_g_at4 >100_g_at5 >100_g_at6 >100_g_at7 >100_g_at8 >100_g_at9 >100_g_at10 >100_g_at11 >100_g_at12 >AFFX-YEL024w/RIP1_at8 >AFFX-YEL024w/RIP1_at9 >AFFX-YEL024w/RIP1_at10 >AFFX-YEL024w/RIP1_at11 >AFFX-YEL024w/RIP1_at12 >AFFX-YEL024w/RIP1_at13 >AFFX-YEL024w/RIP1_at14 >AFFX-YEL024w/RIP1_at15 >AFFX-YEL024w/R...

need help re: sas and unix
have a couple of .cgi and .sas files. how are they related?? they have the same file names On Sunday, 21 April 2013 07:11:06 UTC+5:30, wrote: > have a couple of .cgi and .sas files. how are they related?? Hi [Anonymous], the .Cgi file is nothing but the Common Gateway Interface with deals with the source code file format used for website formatting. where as .SAS file is editor code for the execution. ...

Re: SAS help needed #2
Look at the BY statement and the FIRST.xx temporary variable. They will tell you when you need to reset the suffix of new_var. Look at the MOD function. It will allow to cycle the suffix every n entries. Look at the RETAIN statement. It will let you keep a the value of a counter across iterations of your DATA step. Look at the PUT function. It will let you construct a value from different pieces. You may also use the concatenation operator as part of this process. Try to use a more descriptive title in the future. It would also help if you gave some indication that you tried to do the homework. -----Original Message----- From: DP [mailto:snip] Sent: Friday, June 08, 2007 8:16 AM To: SAS-L@LISTSERV.UGA.EDU Subject: SAS help needed Hi, I need help in creating a dataset. I have sno dt 1011 01jan2000 1012 02jan2000 1012 03jan2000 1012 04jan2000 1012 05jan2000 1012 06jan2000 1012 07jan2000 1013 03jan2000 1013 04jan2000 1013 05jan2000 1013 06jan2000 1013 07jan2000 want: sno dt new_var 1011 01jan2000 a1 1012 02jan2000 a1 1012 03jan2000 a2 1012 04jan2000 a3 1012 05jan2000 a4 1012 06jan2000 a1 1012 07jan2000 a2 1013 03jan2000 a1 1013 04jan2000 a2 1013 05jan2000 a3 1013 06jan2000 a4 1013 07jan2000 a1 All the records are sorted by dt within sno and want to add a new variable in which 1st rec...

Re: Help Needed in SAS #12
The One Master sagely replied: >Pavan, > >You have claimed to have collected these questions from the "Net". For >those who doubt that this is possible, I point out that on March 31 Sa Palo >asked a sequence of questions (also ridiculed) under the subject, "Re: Help >needed with some SAS interview questions!". His first question > > >>1) Under what circumstances would you code a SELECT construct instead > of IF statements? > >and his eighth > > >>8)Name statements that function at both compile and execution time. &g...

Re: need sas help! #2
Does this do what you want: Data Vector1; input a b c d; cards; 1 2 3 4 5 6 7 8 run; Data Vector2; set vector1; vector = 0; array one a b c d; array two v1 v2 v3 v4; do over one; vector = vector + one; two = vector ; end; drop vector; run; Proc Print; run; By the way, the Do OVER is an old form of writing a SAS array that no longer appears in documentation but is very simple to write. I would not use it in production code that I would expect to be in use for a number of years but I do use it for ad hoc work. Nat Wooding Environmental Specialist III Dominion, Environmental Biology 4111 Castlewood Rd Richmond, VA 23234 Phone:804-271-5313, Fax: 804-271-2977 Cel Phone: 804-205-0752 Liang Xu <ilannyxu@GMAIL.C OM> To Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU Discussion" cc <SAS-L@LISTSERV.U GA.EDU> Subject need sas help! 06/29/2009 03:57 AM Please respond to Liang Xu <ilannyxu@GMAIL.C OM> I have a vector like (a,b,c,d)', and I need to generate a new vector like (a,a+b,a+b+c,a+b+c+d)'. How c...

Re: I need help with SAS Macro
Hi Brian, Here is one approach: %Let Start_Month=200510; %Let End_Month=200601; %macro mklibs; %let stmo=%sysfunc(inputn(&Start_Month,yymmn6.)); %let enmo=%sysfunc(inputn(&End_Month,yymmn6.)); %do theDate = &stmo %to &enmo; %let yyyymm=%sysfunc(putn(&theDate,yymmn6.)); LIBNAME D&yyyymm "EEAR.AAA.BBB.XXX.MB&yyyymm" DISP=SHR; %let theDate=%sysfunc(intnx(month,&theDate,0,e)); %end; %mend; %mklibs; Hope this is helpful. Mark Terjeson Senior Programmer Analyst Investment Management & Research Russell Investments Russell Investments Global Leaders in Multi-Manager Investing -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Brian Sent: Friday, June 06, 2008 10:08 AM To: SAS-L@LISTSERV.UGA.EDU Subject: I need help with SAS Macro Hello, %Let Start_Month = 200510; %Let End_Month = 200601; I would like to have a macro that I specify the the start month and end month then it loops through to generate the number of datasets as specified below. LIBNAME D200510 "EEAR.AAA.BBB.XXX.MB200510" DISP=SHR; LIBNAME D200511 "EEAR.AAA.BBB.XXX.MB200511" DISP=SHR; LIBNAME D200512 "EEAR.AAA.BBB.XXX.MB200512" DISP=SHR; LIBNAME D200601 "EEAR.AAA.BBB.XXX.MB200601" DISP=SHR; I tried so many different ways but without any luck. Thanks, Brian ...

Re: need help in SAS prog.
Do you want the output to look like 1 1 1 2 1 3 1 4 2 1... or like 1 4 1 4 1 4 1 4 2 3... or like 1 4 2 3...? -----Original Message----- From: Santughosh001@GMAIL.COM [mailto:snip] Sent: Friday, July 13, 2007 10:17 PM To: SAS-L@LISTSERV.UGA.EDU Subject: need help in SAS prog. Hi guys, I need your help in the SAS prog. I have a data set like below. 1 1 1 1 2 2 2 3 3 I have to add a new variable count. which counts the number of times i occurs (i=1,2,3). Thanx. ...

Re: Help Needed in SAS #3
Pavan, you cannot find any other list thats so friendly as SAS-l. But again expecting answers for that much questions really doesnt make sense.....So, when you have an idea or answer for those questions, explicitly write yours and someone here will correct you or give more appropriate or best answer.....but again expecting just answers may not be the right way....as David said, may be couple of them would be ok..... On Tue, 30 May 2006 23:39:22 -0700, pavan <pavankumarm_in@YAHOO.COM> wrote: >Actually , i am also an employee only ...i had collected this quetions >from Net . > ...

Re: SAS help needed #3
adsingh78@GMAIL.COM wrote: > >Hi, I need help in creating a dataset. > >I have > >sno dt > >1011 01jan2000 >1012 02jan2000 >1012 03jan2000 >1012 04jan2000 >1012 05jan2000 >1012 06jan2000 >1012 07jan2000 >1013 03jan2000 >1013 04jan2000 >1013 05jan2000 >1013 06jan2000 >1013 07jan2000 > >want: > > >sno dt new_var > >1011 01jan2000 a1 >1012 02jan2000 a1 >1012 03jan2000 a2 >1012 04jan2000 a3 >1012 05jan2000 a4 >1012 06jan2000 a1 >1012 07jan2000 a2 >1013 03jan2000 a1 >1013 04jan2000 a2 >1013 05jan2000 a3 >1013 06jan2000 a4 >1013 07jan2000 a1 > >All the records are sorted by dt within sno and want to add a new variable >in which 1st recore will have a1, 2nd will have a2, 3rd will have a3, 4th >will have a4, 5th will have a1 again, 6th will have a2, and so on... The >pattern repeats. > >Thanks in Advance. > >DP Let me first ask what the purpose is. Why do you want to make the numbering so hard to use, when you stick letters onto the front of each one? Why do you want to loop back to one repeatedly inside each by-group? It may be that there's something easier to use, if you could explain what your larger goal really is... HTH, David -- David L. Cassell mathematical...

Re: Need Help with SAS Merge
I hope that Brian's actual application is brimming with logic: I find very little in the sample data. This is not difficult to do, not necessarily with MERGE. I'd use SET ... POINT=, something like (tested): data three; set two; ptr + 1; if ptr > nn then ptr = 1; set one point = ptr nobs = nn; run; That this should be useful to someone ... Prosit, Puddin' ******************************************************* ***** Puddin' Man **** Pudding_Man-at-mail.com ******** *******************************************************; A few words re "The Common Ground&...

Re: Help Needed in SAS #8
Chang, All good points. This garbage has been floating around the Net for a long time, and I have seen some of them fairly recently mentioned on sas-l. Even though some of the questions make sense while some others are extremely out of ballpark, to me this is not the issue of good interview questions vs bad interview questions. It is rather whether to ask them at all, and my answer to *this* question is a resounding "no". Learning the questions perceived "right" by an interviewer not knowing the first thing about SAS (and whom else this questionnaire can be for?) is a sim...

Re: Need help in SAS CODE #2
Hi, try this code data id; input geneID $ 1-22 ; datalines; 100_g_at1 100_g_at2 100_g_at3 100_g_at4 100_g_at5 100_g_at6 100_g_at7 100_g_at8 100_g_at9 100_g_at10 100_g_at11 100_g_at12 AFFX-YEL024w/RIP1_at8 AFFX-YEL024w/RIP1_at9 AFFX-YEL024w/RIP1_at10 AFFX-YEL024w/RIP1_at11 AFFX-YEL024w/RIP1_at12 AFFX-YEL024w/RIP1_at13 AFFX-YEL024w/RIP1_at14 AFFX-YEL024w/RIP1_at15 AFFX-YEL024w/RIP1_at16 AFFX-YEL024w/RIP1_at17 AFFX-YEL024w/RIP1_at18 AFFX-YEL024w/RIP1_at19 AFFX-YEL024w/RIP1_at20 ; run; data id; set id; if substr(geneID,length(geneID)-1,1)ne 't' then id=substr(geneID,length(geneID)-1,2); else id=substr(geneID,length(geneID),1); run; Best regards, Ovidiu gsantu_here@YAHOO.CO.IN wrote: Hi, I have a problem with the following data. I have 6000 data values,my data set looks like folloing: geneID 100_g_at1 100_g_at2 100_g_at3 100_g_at4 100_g_at5 100_g_at6 100_g_at7 100_g_at8 100_g_at9 100_g_at10 100_g_at11 100_g_at12 AFFX-YEL024w/RIP1_at8 AFFX-YEL024w/RIP1_at9 AFFX-YEL024w/RIP1_at10 AFFX-YEL024w/RIP1_at11 AFFX-YEL024w/RIP1_at12 AFFX-YEL024w/RIP1_at13 AFFX-YEL024w/RIP1_at14 AFFX-YEL024w/RIP1_at15 AFFX-YEL024w/RIP1_at16 AFFX-YEL024w/RIP1_at17 AFFX-YEL024w/RIP1_at18 AFFX-YEL024w/RIP1_at19 AFFX-YEL024w/RIP1_at20 Now you can see that last one or two digits of each gene ID has a number 1,2,3........,16,.......20 etc. I need to make a dataset whose first column is the geneID and the 2nd column i...

Re: need help for sas program #2
On Sat, 21 Jul 2007 17:29:46 -0000, Santughosh001@GMAIL.COM wrote: >I have a data like below, it has about 2,000 observations. I am >listing a part of it. > >geneID pms mms >100_g_at1 257.5 141.8 >100_g_at2 770 263.5 >100_g_at3 1078 1369 >100_g_at4 120 194.3 >100_g_at5 316 278 >100_g_at6 176 165 >100_g_at7 1368 2207.5 >100_g_at8 946.3 2121.5 >1000_at1 498 1111 >1000_at2 209.5 173.8 >1000_at3 141 147 >1000_at4 418 150 >1000_at5 112.5 94 >1000_at6 1159 1490.5 >1000_at7 101 99 >1000_at8 113.8 80 >1000_at9 158 118 >1000_at10 160.8 124 >AFFX-YEL024w/RIP1_at1 176 97.5 >AFFX-YEL024w/RIP1_at2 81 79 >AFFX-YEL024w/RIP1_at3 88 90 >AFFX-YEL024w/RIP1_at4 102 90 >AFFX-YEL024w/RIP1_at5 97 111 >AFFX-YEL024w/RIP1_at6 114.3 97.8 >AFFX-YEL024w/RIP1_at7 177 286 >AFFX-YEL024w/RIP1_at8 225 213 >AFFX-YEL024w/RIP1_at9 128.3 111.8 >AFFX-YEL024w/RIP1_at10 83.3 91 >AFFX-YEL024w/RIP1_at11 157.3 103 >AFFX-YEL024w/RIP1_at12 128.3 116.3 >AFFX-YEL024w/RIP1_at13 95 74 > > >Now as you can see I have three diff...

Re: Need help in SAS CODE #8
tobydunn@HOTMAIL.COM replied: > >Your question can be translated as "To find the number at the tail of >a string". Now think about a way to reset very letters in the string >to blank, then we will have a new string with some numbers separated by >blanks. The number you want is at the very right hand side, which can >be easily extracted with a scan function: > >data have; >input geneID $1-25; >tailnum=scan(translate(upcase(geneid),' ', >'_ABCDEFGHIJKLMNOPQRSTUVWXYZ'),-1,' '); >cards; >100_g_at1 >100_g_at12 >AFFX-YEL024w/RIP1_at8 >AFFX-YEL024w/RIP1_at10 >AFFX-YEL024w/RIP1_at20 >AFFX-YEL024w/RIP1_kkk209 >34sdfsf_345nldog_456 >; > >proc print; >run; > >100_g_at1 1 >100_g_at12 12 >AFFX-YEL024w/RIP1_at8 8 >AFFX-YEL024w/RIP1_at10 10 >AFFX-YEL024w/RIP1_at20 20 >AFFX-YEL024w/RIP1_kkk209 209 >34sdfsf_345nldog_456 456 > > >On Mon, 9 Jul 2007 20:51:38 -0700, gsantu_here@YAHOO.CO.IN wrote: > > >Hi, > > > >I have a problem with the following data. I have 6000 data values,my > >data set looks like folloing: > > > >geneID > >100_g_at1 > >100_g_at2 > >100_g_at3 > >100_g_at4 > >100_g_at5 > >100_g_at6 > >100_g_at7 > >100_g_at8 > >100_g_at9 > >100_g_at10 > >10...

Re: I need help with SAS Macro #3
Same tune, different song ... %Let Start_Month = 200510; %Let End_Month = 200601; DATA t; LENGTH s $ 6; DO d = Input("&start_month.01",yymmdd8.) TO Input ("&end_month.01",yymmdd8.); s = Catt(Put(Year(d),4.),Put(Month(d),z2.)); OUTPUT; d = Intnx('month',d,0,'E'); END; FORMAT d DATE9.; RUN; ...

Re: Need help with SAS Data step
Mehdi, There is no way for SAS to know when the variables begin and end if the data is both free-form and lacks a delimiter. Prior to reading the file into SAS, is it possible to save the file in some type of delimited format, e.g. comma or tab, or fixed form? What is the original source / file type of your data? If you have no way of changing your data prior to reading it into SAS, it seems you would have to read the entire observation into a single variable and then use logic to parse the data. Regards, Scott -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Mehdi Satter Sent: Saturday, June 21, 2008 5:23 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Need help with SAS Data step Hello, I'm a new SAS learner. I become interested in SAS when I took a Biostatistics class. Then I took a SAS/Stat class and learned how to SAS for statistical data analyses. Basically I'm a spinal cord injured graduate student in computer science. After taking that SAS class I started learning SAS and planning to develop my career in SAS programming. Because other computer programming languages involve writing many many lines of codes. For my physical limitation I find SAS needs only few lines of codes and makes my life little easier. Anyway, I'm always having trouble reading data at SAS data step using 'INPUT' statement. I fail to read character variables with embedded spaces. Here is a part of a data set I was using to practice SA...

Re: Need help in SAS CODE #3
good idea! Allow me just a small improvement: if the string is longer than your constant, it will not work. You should add the use of the COMPRESS or LEFT function, because REVERSE would shift trailing blanks to leading ones. You can use something like: data x; set a; /* the original data */ dummy=left(reverse(geneid)); nc=reverse(substr(dummy,1,verify(dummy,"0123456789")-1)); put nc=; run; That's quite the same, only cutting off the num and reverse it again, instead of using the POSition to SUBSTR the original. Gerhard On Mon, 9 Jul 2007 22:23:04 -0700, RolandRB <rolandberry@HOTMAIL.COM> wrote: >On 10 Jul, 05:51, gsantu_h...@yahoo.co.in wrote: >> Hi, >> >> I have a problem with the following data. I have 6000 data values,my >> data set looks like folloing: >> >> geneID >> 100_g_at1 >> 100_g_at2 >> 100_g_at3 >> 100_g_at4 >> 100_g_at5 >> 100_g_at6 >> 100_g_at7 >> 100_g_at8 >> 100_g_at9 >> 100_g_at10 >> 100_g_at11 >> 100_g_at12 >> AFFX-YEL024w/RIP1_at8 >> AFFX-YEL024w/RIP1_at9 >> AFFX-YEL024w/RIP1_at10 >> AFFX-YEL024w/RIP1_at11 >> AFFX-YEL024w/RIP1_at12 >> AFFX-YEL024w/RIP1_at13 >> AFFX-YEL024w/RIP1_at14 >> AFFX-YEL024w/RIP1_at15 >> AFFX-YEL024w/RIP1_at16 >> AFFX-YEL024w/RIP1_at17 >> AFFX-YEL024w/RIP1_at18 >> AFFX-YEL024w/RIP1_at19 >> AFFX-YEL024w/RIP1_at20 &g...

Re: Need help with SAS date comparision..
PinkFloydFan: I am not quite sure this is what you are asking. If not, write back. It seems the fifth observation has invalid dates in dt and dt2. data sample1 (keep=dt dt1 dt2 dt3); input temp1 temp2 temp3 temp4; dt=input(put(temp1,z6.), yymmdd6.); dt1=input(put(temp2,z6.), yymmdd6.); dt2=input(put(temp3,z6.), yymmdd6.); dt3=input('01' || put(temp4,z4.), ddmmyy6.); cards; 20701 30218 20913 1099 50603 60218 40226 902 50702 60222 981127 1205 10702 11026 940728 0998 0 60222 0 1193 ; run; proc print; format dt dt1 dt2 Date9. dt3 MonYY5.; run; ***** Output ***** ...

Re: need help in SAS prog. #2
One of many ways: RETAIN a counter-variable on the sorted dataset (by id), init the counter if first.id..., increase it after the if. That gives the output no 1. If you want it like 2., resort the resulting dataset by ID descending counter. Use another DATA step with the same by statement, retain another variable (DUMMY). data ...; set result; by id; if first.id then dummy=counter; counter=dummy; drop dummy; second: proc freq third: proc summary, output dataset, use the _freq_ variable. CLASS=ID forth: proc sql ..... ..... Gerhard On Mon, 16 Jul 2007 13:01:21 -0700, Schwarz, Barry A <barry.a.schwarz@BOEING.COM> wrote: >Do you want the output to look like > 1 1 > 1 2 > 1 3 > 1 4 > 2 1... >or like > 1 4 > 1 4 > 1 4 > 1 4 > 2 3... >or like > 1 4 > 2 3...? > >-----Original Message----- >From: Santughosh001@GMAIL.COM [mailto:snip] >Sent: Friday, July 13, 2007 10:17 PM >To: SAS-L@LISTSERV.UGA.EDU >Subject: need help in SAS prog. > >Hi guys, > >I need your help in the SAS prog. I have a data set like below. > > 1 > 1 > 1 > 1 > 2 > 2 > 2 > 3 > 3 > >I have to add a new variable count. which counts the number of times i >occurs (i=1,2,3). > >Thanx. ...

Re: I need help with SAS Macro #2
Data _Null_ ; Length Text $ 200 ; Do I = 0 To 3 ; Date = Put( IntnX( 'Month' , '01Oct2005'd , I , 'B' ) , YYMMN6. ) ; Text = Cat( 'LibName D' , Date , ' "EEAR.AAA.BBB.XXX.MB' , Date , '" DISP=SHR ;' ) ; Call Execute( Text ) ; End ; Run ; Toby Dunn "Don't bail. The best gold is at the bottom of barrels of crap." Randy Pausch "Be prepared. Luck is where preparation meets opportunity." Randy Pausch > Date: Fri, 6 Jun 2008 10:07:47 -0700 > From: brian8202@GMAIL.COM > Subject: I need help with SAS Macro > To: SAS-L@LISTSERV.UGA.EDU > > Hello, > > %Let Start_Month = 200510; > %Let End_Month = 200601; > > I would like to have a macro that I specify the the start month and > end month then it loops through to generate the number of > datasets as specified below. > > LIBNAME D200510 "EEAR.AAA.BBB.XXX.MB200510" DISP=SHR; > LIBNAME D200511 "EEAR.AAA.BBB.XXX.MB200511" DISP=SHR; > LIBNAME D200512 "EEAR.AAA.BBB.XXX.MB200512" DISP=SHR; > LIBNAME D200601 "EEAR.AAA.BBB.XXX.MB200601" DISP=SHR; > > > I tried so many different ways but without any luck. > > > Thanks, > > Brian _________________________________________________________________ Now you can invite friends from Facebook and other groups to join you on Windows Live� Messenger. Add now. https://www.invite2messenger.net/im/?...

Re: I need help with SAS Macro #4
On Fri, 6 Jun 2008 10:07:47 -0700, Brian <brian8202@GMAIL.COM> wrote: >Hello, > >%Let Start_Month = 200510; >%Let End_Month = 200601; > >I would like to have a macro that I specify the the start month and >end month then it loops through to generate the number of > datasets as specified below. > >LIBNAME D200510 "EEAR.AAA.BBB.XXX.MB200510" DISP=SHR; >LIBNAME D200511 "EEAR.AAA.BBB.XXX.MB200511" DISP=SHR; >LIBNAME D200512 "EEAR.AAA.BBB.XXX.MB200512" DISP=SHR; >LIBNAME D200601 "EEAR.AAA.BBB.XXX.MB200601" DISP=SHR; > > >I tried so many different ways but without any luck. > > >Thanks, > >Brian I believe this meets the specs: %macro wouldlike(Start_Month=, End_Month =); %let lo = %sysfunc(inputn(&Start_Month,yymmn6.)); %let hi = %sysfunc(inputn( &End_Month,yymmn6.)); %let diff = %sysfunc(intck(month,&lo,&hi)); %do i = 0 %to &diff; %let The_Month = %sysfunc(intnx(month,&lo,&i),yymmn6.); LIBNAME D&The_Month "EEAR.AAA.BBB.XXX.MB&The_Month" DISP=SHR; %end; %mend wouldlike; %wouldlike(Start_Month=200510, End_Month =200601) ...

Web resources about - Re: SAS help needed - comp.soft-sys.sas

Clinton SuperPAC Bites Back at Trump’s Barking Hillary Ad
Earlier this week, Donald Trump’s campaign introduced a 15-second ad interspersing a judo-performing Vladimir Putin and a jihadi terrorist with ...

How to turn off Twitter’s new algorithmic feed, which is now on by default
Last month, following what seemed like years of speculation, Twitter finally launched its new algorithmic feed. It was turned off by default, ...

This Is The Weirdest Irish-Designed-And-Built Car You'll See All Day
As all of us planning to do some green-tinted vomiting later today can tell you, it’s St. Patrick’s day. That’s why I’d like to take a moment ...

SeaWorld to stop breeding orcas, making them perform tricks
After years of pressure, SeaWorld made a surprise announcement on Thursday: It no longer breeds killer whales in captivity and will soon stop ...

Casio Smart Outdoor Watch Goes On Sale March 25 For $500
Casio is a brand that you could associate with watches. After all the company is known for their calculator watches from back in the day, not ...

Citing Atrocities, John Kerry Calls ISIS Actions Genocide
New York Times Citing Atrocities, John Kerry Calls ISIS Actions Genocide New York Times Secretary of State John Kerry said the Islamic State, ...

Must See: Rep. Elijah Cummings Tears Gov. Snyder Several New Ones Over Flint Crisis
Governor Rick Snyder appeared before the U.S. House Committee on Oversight and Government Reform Thursday for a hearing on how his administration ...

Google adds election funding data cards to Search
Google has been adding information on presidential debates, candidates, and other political activities to Search over the past few months, and ...

Accused Kalamazoo shooter's lawsuit against Uber likely a hoax
A handwritten lawsuit blaming the ride-hailing service for ruining the suspect's life didn't come from him, according to the county sheriff. ...

Nintendo joins the smartphone revolution with its first app, in Japan
Nintendo is finally coming to the smartphone, but it’s not exactly the kind of app you’d expect from a company known for its games and consoles. ...

Resources last updated: 3/17/2016 11:41:48 PM