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.);
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.