I am trying to run the survival analysis, while censoring the data based on variables which are in dates. When I upload the complete dataset, all the date variables are imported as characters and i cannot run analysis on them! Format of the dates in all columns are as 08/19/1990.
Here is my code which is simply uploading the data from excel.
**proc import datafile='U:/censor_ami.xlsx'
out= censor Ami
dbms=xlsx
replace;
options MSGLEVEL=I
run;*
*Please help me sort out this issue!
I need to know how to solve this date format issue in SAS!
Usually this happens because the date is formatted as a character in Excel. If for some reason you can't get it to work correctly, you can always convert the date yourself in SAS. I personally prefer to try and use the
andydtdte.date format first since it automatically covers a large number of common dates.