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.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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