BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
DataNerd13
Calcite | Level 5

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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

 

 

View solution in original post

4 REPLIES 4
Reeza
Super User

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

 

 

SASKiwi
PROC Star

The correct format name is YYMMDD. You can easily check format names by looking in the SAS documentation: documentation.sas.com

DataNerd13
Calcite | Level 5

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 🙂

Reeza
Super User
I missed it on my first scan and been doing this for almost two decades....

SAS Innovate 2025: Call for Content

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!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 673 views
  • 6 likes
  • 3 in conversation