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

I'm trying to convert a datetime20. to a yymmd7. but I'm running into a peculiar error. The data steps run fine, the values get converted... but the error remains.

 

Any thoughts?

 

Thank you!

 

Code

data have;
input time datetime20.;
format time datetime20.;
informat time datetime20.;
cards;
12SEP2013:10:19:43
;
run;

data want;
set have;
format time datetime20. want_date yymmd7.;
want_date = input(datepart(time),yymmd7.);
run;

 

Error -- Informat could not be found 

485
NOTE 485-185: Informat YYMMD was not found or could not be loaded.

28 run;

NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).
27:19

 

Results -- Outputs and runs successfully despite error

time want_date
12Sep2013 10:19:43 2013-09

 

 

1 ACCEPTED SOLUTION
2 REPLIES 2
JS
Obsidian | Level 7 JS
Obsidian | Level 7

I see. I was trying to re-input the date unnecssarily. This works beautifully. Thank you!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1596 views
  • 1 like
  • 2 in conversation