BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Ok, I've been on holiday for the past week and seem to have lost all SAS ability. All I'm looking to do is convert a $5 formatted variable to a ddmmyy. date.

For example, I want the value 'JAN11' to be converted to '01JAN11'.

Can anyone help?

Many thanks
3 REPLIES 3
SPR
Quartz | Level 8 SPR
Quartz | Level 8
Hello Wacattack,

This is a code:
[pre]
data a;
d="jan11";
date=INPUT("01"||d,anydtdte7.);
format date date7.;
run;
[/pre]
Sincerely,
SPR
deleted_user
Not applicable
Thanks mate, works perfectly
data_null__
Jade | Level 19
The specific INFORMAT is MONYY

[pre]
116 data _null_;
117 x = 'jan11';
118 d = input(x,monyy.);
119 put d=date9. d=monyy.;
120 run;

d=01JAN2011 d=JAN11
[/pre]

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
  • 3 replies
  • 977 views
  • 0 likes
  • 3 in conversation