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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.