DATA Step, Macro, Functions and more

string date to normal date

Reply
Occasional Contributor
Posts: 8

string date to normal date

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?

Super User
Posts: 24,003

Re: string date to normal date

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?


 

Occasional Contributor
Posts: 8

Re: string date to normal date

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

 

Super User
Posts: 24,003

Re: string date to normal date

Post the log.

Ask a Question
Discussion stats
  • 3 replies
  • 113 views
  • 0 likes
  • 2 in conversation