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
PROC FORMAT;
inVALUE $WEEK
'Saturday'=1
'Sunday'=2
'Monday'=3
'Tuesday'=4
'Wednesday'=5
'Thursday'=6
'Friday'=7;
QUIT;
data have1;
set have;
date1=input(put(date,WEEKDATE9. -l),$week.);
/*FORMAT DATE MMDDYY10.;*/
/*FORMAT DATE WEEKDATE9.;*/
RUN;
Thanks,
Jag
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.