I try like this
data have;
infile datalines ;
input date MMDDYY10.;
format date MMDDYY10.;
datalines;
01/06/2015
01/07/2015
01/29/2015
02/06/2015
02/07/2015
;
run;
i want to apply proc format above dataset.
sas takes sunday is 1 but my requirement like this
PROC FORMAT;
VALUE $WEEK
'Saturday'=1
'Sunday'=2
'Monday'=3
'Tuesday'=4
'Wednesday'=5
'Thursday'=6
'Friday'=7
QUIT;
data have1;
set have;
FORMAT DATE1 MMDDYY10.;
FORMAT DATE1 WEEKDATE9.;
RUN;
May be this will help you
inVALUE $WEEK
'Friday'=7;
date1=input(put(date,WEEKDATE9. -l),$week.);
/*FORMAT DATE MMDDYY10.;*/
/*FORMAT DATE WEEKDATE9.;*/
Thanks,
Jag
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Latest Updates
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.
Browse our catalog!