Hello,
Somehow my dates were input into my dataset wrong and I need to change them.
I have the dates as a string right now and they are in yyq6. format but in characters. So the current dates show 2017Q1, 2017Q2, etc. but are char$6 as a string.
What I want is to see 01JAN2017 for the string 2017Q1, 01APR2017 for the string 2017Q2 and so on. But not just a string of that - it needs to be a proper date format.
I feel like I have tried everything and at best it will error out and at worst it will set all of values for that variable to missing.
How can I do this??
Thank you for your help!!
Use the YYQ informat:
numvar = input(charvar,yyq6.);
format numvar date9.;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.