HI ,
i have string reg_date in char format, but when i import to SAS i want it to be date one.
| reg_date |
| 112114 |
| 022317 |
| 071615 |
when i try to do using input its not working.
data sas_agent_policy_comp ;
set sas_agent_policy_comp;
reg_date1=input(regdate,mmddyy10.);
pcyear=year(reg_date);
run;
i want the informat this variable to be date9. and format should be mmddyy10.
can you pleaase how can i read that variable as informat date9. into sas.
thanks,
goutham
And what does that number actually mean: 112114? Is it 21Nov14? 14Nov1921?
This:
reg_date1=input(regdate,mmddyy10.);
Will clearly not work as the length of 112114 is not 10, mmddyy10 is expecting 10 characters, e.g. 11-12-2014.
Perhaps mmddyy6. or the mdy() function.
And what does that number actually mean: 112114? Is it 21Nov14? 14Nov1921?
This:
reg_date1=input(regdate,mmddyy10.);
Will clearly not work as the length of 112114 is not 10, mmddyy10 is expecting 10 characters, e.g. 11-12-2014.
Perhaps mmddyy6. or the mdy() function.
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.