Hi
I am importing an XLSX file using the proc import code:
PROC IMPORT OUT= &outDS.
DATAFILE= "&inFile."
DBMS=xlsx REPLACE;
range="&sheetNM.$A1:AZ";
GETNAMES=YES;
RUN;
However, some of the date columns have no data in them, but when SAS is importing it, it is populating the field with the value from the previous line:
| REF1 | Start Date | End Date |
| ABC123 | 15-May-15 | 17-Aug-18 |
| ABC234 | 11-Jun-18 | 17-Aug-18 |
| ABC345 | 14-Dec-15 | 17-Aug-18 |
| ABC456 | 17-Feb-17 | 17-Aug-18 |
| ABC567 | 06-Mar-15 | 17-Aug-18 |
| ABC898 | 10-Mar-15 | 17-Aug-18 |
Only the first row should have the end date as 17/08/2018, all the others are blank in the original date.
How is this fixed.
D
hi,
I think it is something in excel.
the file is received from a third party, when I amended some of the data and saved as a new workbook, it was imported into SAS ok.
I will have to go back to the third party and see what they are doing!
thnaks
Bottom line: it is foolish to expect consistent, usable results from Excel files.
Save the data to a csv file, which you can inspect with a text editor, and read it with a data step written along the documentation you get with the file.
(no documentation -> return to sender)
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 save with the early bird rate—just $795!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.