BookmarkSubscribeRSS Feed
Dhana18
Obsidian | Level 7

Please help,

i have this date format in excel  

RX_DATE
1/2/2017
1/4/2017
1/2/2018
1/2/2018
1/2/2018
1/2/2018
1/2/2018

when i imported to SAS it looked like this and was in character format

RX_DATE 
43626
43146
43146
42826
42586

used this code to change to numeric and to change in date format

data satratha.TREAT_18;
set satratha.TREAT18;
format rxdate mmddyy10.;
rxdate=input(rx_date, 15.);
run;

and the changed to 

RX_DATE 
2/16/2078
2/17/2078
2/18/2078
2/19/2078
2/20/2078
2 REPLIES 2
novinosrin
Tourmaline | Level 20

Is this thread a duplicate of your previous --

 

https://communities.sas.com/t5/SAS-Programming/date/m-p/548265

 

You could have just edited there

JG_
Calcite | Level 5 JG_
Calcite | Level 5

Excel uses a date system that starts from 1900.

To convert to SAS date system just subtract 21916 from the Excel date serial.

 

Not sure what method you are using to import into SAS so try converting the date in Excel prior to importing.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 808 views
  • 0 likes
  • 3 in conversation