I have a char date which is something like "17 Nov 2016" and i want to make it as "2016-11-17".
Tried A=INPUT(E,is8601da.);
But it didnt work as the input is char variable.
Any help?
Convert it to an actual date and then convert it back into a character string.
A=put(input(E,date11.),yymmdd10.);
Try next code:
sas_date = cats('"', input(compress(date_in), 'D"',date9.);
format sas_date yymmdd10.;
I get error while using
data ec;
6528
6529 dat="17 Nov 2016";
6530 sas_date = cats('"', input(compress(dat), 'D"',date9.);
----
85
76
ERROR 85-322: Expecting a format name.
ERROR 76-322: Syntax error, statement will be ignored.
Make it simpler:
sas_date = input(compress(date_in),date9.);
Convert it to an actual date and then convert it back into a character string.
A=put(input(E,date11.),yymmdd10.);
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.