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 |
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
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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
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.
Ready to level-up your skills? Choose your own adventure.