07-18-2014 09:55 PM
I am trying to read the excel file "datatest". The data in that file look like the data below. The following is the SAS code I used, but I got an error message. I want the Record_Date and the Record_Time look in SAS the same as in Excel. That is look like the data below. I am not sure what I am doing wrong. When I copy paste these data in SAS Editor in the datalines statement, it works. But I have a large data set that I cannot use datlines in SAS Editor. I tried to use the proc import, but I do not know how to use format DATE and format TIME within it.
Any helps will be highly appreciated.
many thanks in advance
input PAT_NAME $ RECORD_DATE :MMDDYY8. RECORD_TIME :time5.;
format RECORD_DATE MMDDYY8.;
format RECORD_TIME time5.;
These data was saved in Excel file named "datatest.xlsx".
07-19-2014 12:25 AM
An XLSX file is not a simple text file. Is your "RECORD_DATE" in the Excel spreadsheet a text field or a date field? If it's a date field then SAS should get it right once you're using the correct code to import such a spread-sheet.
There is a lot of information out there in public of how to read excel files. Try below links as a start.