09-06-2016 03:29 PM
I have an dataset and i have to replace some dates (including formats):
i was trying to use this:
input ID birth_day:mmddyy10.;
format birth_day mmddyy10.;
if ID = 1515 then birth_day = '01/26/2003';
if ID = 1533 then birth_day = '01/30/2004';
I tried this estatements and it is not working
Can anybody give me some hints please??
09-06-2016 03:36 PM
The date your are trying to assign is a string, dates in SAS a numerical.
If you wish to express a data constant, you need to use the date format and using a data literal:
09-06-2016 04:11 PM
The value of a Date literal must be in the form of 'ddMONyy'd or 'ddMONyyyy'd for SAS to recognize it as a date. If you have assigned a format of mmddyy10. to the variable then that is the default appearance the value will have in your data set.