First: How about this.
data want;
set test;
length Month $3;
if DateOfService ne . then do;
Month=substr(put(DateOfService,date9.),3,3); /* result is like FEB */
Month=propcase(substr(put(DateOfService,date9.),3,3));/* result is like Feb select as you like */
end;
run;
If you really want to use SELECT WHEN, write the following
data want2;
set want;
select (DateOfService);
when (Month(DateofService) = 01) Month="Jan";
when (Month(DateofService) = 02) Month="Feb";
Otherwise Month=' ';
end;
run;
Second:
Specify this if the value specified in datalines is written in the format ddmmyy10..
It instructs SAS how to read the date
Yes.
do we need to instruct SAS how to read dates when we have a date variable?
Yes.
Otherwise, the SAS process may not complete successfully.
... View more