From: rjf2 on 8 Mar 2010 09:46 welcome and have a look at our sas community wiki http://www.sascommunity.org/wiki/Category:SAS-L > -----Original Message----- > From: owner-sas-l(a)listserv.uga.edu [mailto:owner-sas- > l(a)listserv.uga.edu] On Behalf Of sasbond1981 sasbond1981 > Sent: Saturday, March 06, 2010 7:30 PM > To: SAS-L(a)LISTSERV.UGA.EDU > Subject: new joinee > > Hi All, > > I am new joinee of this group. > > Thanks,
From: sasbond1981 sasbond1981 on 9 Mar 2010 09:13 Hi, need suggestion please.. Suppose I have a dataset containing two variables "Start_Date and End_Date" and here I need to create a variable called "period". Here the start and end dates were in Datetime format and I took only datepart by "datepart" function and formated it as date9. And created "Period" variable by giving some logic as " MDY(month(today()),1,year(today()))-1 " which will give value as "FEB2010" (which is Monyy7. format). So now based on this period variable I need to pull only the FEB month data from years of data. Actually the data contains two years (historical) data till last month. example: START_DATE END_DATE PERIOD 01FEB2010 01FEB2010 JAN2010 01FEB2010 02FEB2010 JAN2010 16JUL2009 16JUL2009 JAN2010 19DEC2009 20DEC2009 JAN2010 21JAN2010 22FEB2010 JAN2010 26FEB2010 26FEB2010 JAN2010 30JAN2010 30JAN2010 JAN2010 31DEC2009 31DEC2009 JAN2010 the above is the sample data... now what I need is based on this period I need to pull only Feb dates starting from 01FEB2010 and ending of 31FEB2010. So in simple I want FEB data only. START_DATE is in date9. format END_DATE is in date9. format Period is in Monyy7. format I tried with between and >= and <= and etc etc... but it is not workin for me... please give me ur idea on this... Cheers,
|
Pages: 1 Prev: Pass a variable as a macro parameter. Next: ACCESS SQL program into SAS code |