BookmarkSubscribeRSS Feed
pokepim
Calcite | Level 5

I have a column in my tables that has observations like this:

 

Date

200601

200602

200603

...

 

I want to convert them into a date format that can be used in proc forecast procedure ( so like 1JAN2006, 1FEB2006 etc.) How can i do that?

3 REPLIES 3
Reeza
Super User

INPUT()

Informat -> YYMMN6

 


@pokepim wrote:

I have a column in my tables that has observations like this:

 

Date

200601

200602

200603

...

 

I want to convert them into a date format that can be used in proc forecast procedure ( so like 1JAN2006, 1FEB2006 etc.) How can i do that?


 

pokepim
Calcite | Level 5

So i tried this

 

data new ;
set wej.vintage_css_3;  /* the dataset that ahs the column */
newdate=input(fin_period,YYMMN6.)   /*fin_period is that one with the dates to changfe */
run;

 

but it does not work 😕 it says its a syntax error

 

Reeza
Super User

Post the log.

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
  • 681 views
  • 0 likes
  • 2 in conversation