Hi reader, i'm in trouble for below question, thanks for your help. before import a excel file into SAS, i hope to add a "if...then do" sentence, to show when a sheet name is not exist then put a warning in log, do you know how to do with that? the sheet name as a macro variable in code, that excel file is xlsx format. proc import datafile="&p_com" out=&chknm._com dbms=xlsx replace; range="&chknm.$A&cell:Z100000"; getnames=YES; run; for example if &chknm is check1, but this is not in excel, then will be an error: Couldn't find sheet in spreadsheet Requested Input File Is Invalid ERROR: Import unsuccessful. See SAS Log for details.
... View more