I'm having a question regarding to converting partial SAS date.
I'm having some incomplete date like 'OCT 2018', this is a character variable and I want to convert it to '2018-10' also a character variable.
I'm thinking to change it to a numeric variable then convert that numeric to character variable. However since it is a partial date, I'm not sure how to do it.
Are you asking for how to convert the specific pattern MONYYYY into YYYY-MM?
If so you might have some success using the ANYDTDTE informat to convert that string to the first day of the month and then use the YYMMD format to generate the wanted string.
WANT=put(input(HAVE,anydtdte.),yymmd7.);
But how well it works depends on how messy your strings are.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.