I have been using the same code and data source to run weekly reports without any issues using, however, this week one of my date columns will not import from Excel. The variable 'collectiondate' is formatted as Date in Excel but when it imports to SAS the entire column of data is missing and the informat and format of the column are TIME8. instead of the preferred DATE9. format that I have been using. It shows up the same way in all four of the data sets created. Any idea why this would be happening all of a sudden and ideas on how to fix it? I had been using 9.3 but recently switched to 9.4 if that makes any difference. Screenshots and code below.
OPTIONS MPRINT;
%MACRO IMP(INSHEET=);
PROC IMPORT OUT=WORK.&INSHEET
DATAFILE="filepathway...\NHSN_LTCF_covid19 &extract_date..xlsx"
DBMS=EXCEL REPLACE;
SHEET="&INSHEET.$";
GETNAMES=YES;
MIXED=NO;
SCANTEXT=YES;
USEDATE=YES;
SCANTIME=YES;
RUN;
%MEND IMP;
%IMP(INSHEET=covid19res);
%IMP(INSHEET=covid19staff);
%IMP(INSHEET=covid19supp);
%IMP(INSHEET=covid19vent);
This solved the problem on the data not entering - thanks! Had to take a few more steps to get it into the correct format but at least I can work with it now.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.