I've scoured the boards and none of the solutions are working for this code block.
I have a variable with character dates ($8 according to proc contents) in a format of YYYYMMDD but the code below isn't working to convert and the error is the "ERROR 48-59: The informat YYYYMMDD was not found or could not be loaded." I've even tried proc sql and it fails as well.
I'm trying to create a new date variable so I can move on to get week number:
data want; set have;
proper_dt = input(char_date,YYYYMMDD8.);
format proper_dt date9.;
run;
Thanks for any help!
Show your actual code & log please and a small screenshot of your input data, have, please. Code looks correct so the error is somewhere else.
Format is YY (only 2 Y), so YYMMDD not YYYY
Show your actual code & log please and a small screenshot of your input data, have, please. Code looks correct so the error is somewhere else.
Format is YY (only 2 Y), so YYMMDD not YYYY
The correct format name is YYMMDD. You can easily check format names by looking in the SAS documentation: documentation.sas.com
I was assuming the format was the one I had as a character which is why I had 4 Y's. Thank you! This worked.
Signed,
Only a little embarrassed 🙂
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.