How to convert date format of 01SEP2015 to number format like 20340.

Reply
Contributor
Posts: 31

How to convert date format of 01SEP2015 to number format like 20340.

How to convert date format of 01SEP2015 to number format like 20340. 

Super User
Super User
Posts: 6,845

Re: How to convert date format of 01SEP2015 to number format like 20340.

If you have a date variable then it is already a number, then number of days since 01JAN1960. Just display it using a different format.

If you have '01SEP2015' in a character variable or input file then you can use the INFORMAT of DATE9 to convert it into a SAS date value.

 

 

datestr='01SEP2015';
dateval=input(datestr,date9.);
format dateval date9. ;
Ask a Question
Discussion stats
  • 1 reply
  • 261 views
  • 0 likes
  • 2 in conversation