It is not clear whether you are asking how to convert current data in this format or historical data. For example the Unix ls -l command will put out dates with month and day and then either the year when the files are more than a year old or the time for recent files. So you have to calculate the year based on what time you generated the list. Also it is not clear from your examples if your values represent MMDD or DDMM. Either way you do not want to compound the problem by generating a string that only has two digits for the year. So assuming that you already have a numeric variable DATE with values in the form MMDD here is one way to convert the values to an actual date value. Or to convert it to a string that has slashes in it. data have ; input date @@; cards; 1116 1209 0101 0102 ;;; data want ; set have ; year=year(today()); month = int(date/100); day = mod(date,100); if mdy(month,day,year) > today() then year=year-1; date2 = mdy(month,day,year); date2char = put(date2,mmddyys10.); format date2 date9.; put (_all_) (=); run; date=1116 year=2014 month=11 day=16 date2=16NOV2014 date2char=11/16/2014 date=1209 year=2014 month=12 day=9 date2=09DEC2014 date2char=12/09/2014 date=101 year=2015 month=1 day=1 date2=01JAN2015 date2char=01/01/2015 date=102 year=2015 month=1 day=2 date2=02JAN2015 date2char=01/02/2015
... View more