Hi I have a column called SystemDate with a date format yymmdd8 and the date is being displayed 06-08-10 I would like to rename the column to Todaysdate and have the date format DDMMYY10 10/08/2006. How would I go about changing the format of the date?
data want;
set have (rename=(systemdate=todaysdate));
format todaysdate ddmmyy10.;
run;
If your dataset is large and you do not need to preserve its original status, consider using proc datasets.
data want; set have (rename=(systemdate=todaysdate)); format todaysdate ddmmyy10.; run;
Hi,
DATA have;
systemDate="10AUG2006"d;
format systemdate yymmdd8.;
RUN;
DATA want;
SET have(rename=(SystemDate=Todaysdate));
format Todaysdate DDMMYY10.;
RUN;
- Cheers -
data want;
set have (rename=(systemdate=todaysdate));
format todaysdate ddmmyy10.;
run;
If your dataset is large and you do not need to preserve its original status, consider using proc datasets.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and 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.