Hi all,
My date of arrivals were in excel as '1/1/18' and there must have previously been some character code in the column, because when I imported to SAS it changed to $13. and looks like '43101' except it's now in character. Any ideas how to change it back to the original numeric date? Either mmddyy10 or ddmmyy10?
Data have;
DOA
43101
43101
43102
43103
43104
43105
data want;
DOA
1/1/18
1/1/18
1/2/18
1/3/18
To change the string values to date values first convert to a number and then adjust for the difference in how Excel and SAS count dates. Then you can attach any date type format you want to have the values display in a human readable way.
date = input(doa,32.)+'30DEC1899'd ;
format date date9.;
To change the string values to date values first convert to a number and then adjust for the difference in how Excel and SAS count dates. Then you can attach any date type format you want to have the values display in a human readable way.
date = input(doa,32.)+'30DEC1899'd ;
format date date9.;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.