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!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 2 replies
  • 1059 views
  • 1 like
  • 2 in conversation