SAS importing dates from excel

前端 未结 1 741
轮回少年
轮回少年 2021-01-17 00:20

I have an xlsx dataset that I import using proc import. There is a column in excel that holds date values like: 2018-11-30 00:00:00 When I import it into SAS it automaticall

1条回答
  •  一生所求
    2021-01-17 00:44

    Sometimes SAS imports the date as a raw Excel date. I don't know exactly why or when it does this, but I think it has something to do with the format of the date. If this happens, subtract the date by 21916 to convert from an Excel date to a SAS date.

    data want;
        set imported_from_excel;
    
        date = excel_date - 21916;
    run;
    

    0 讨论(0)
提交回复
热议问题