Thank you for your reply. I tried to use your code, and I got this error message. Why? filename zipfile zip "e:\Users\mhollifi\Documents\Dillon Study GP\18_3_9\submission_cleaned.zip";
data _null_ ;
length fileno 8 filename $256 ;
did=dopen('zipfile');
%do fileno=1 %to dnum(did);
ERROR: The %DO statement is not valid in open code.
filename=dread(did,fileno);
output;
%readdata(filename)
MPRINT(READDATA): filename zipfile clear;
MPRINT(READDATA): proc import datafile="filename" out=want DBMS=EXCEL REPLACE;
MPRINT(READDATA): AEXC;
MPRINT(READDATA): RANGE="Sheet1$";
MPRINT(READDATA): GETNAMES=YES;
MPRINT(READDATA): MIXED=no;
MPRINT(READDATA): SCANTEXT=YES;
MPRINT(READDATA): USEDATE=YES;
MPRINT(READDATA): SCANTIME=YES;
MPRINT(READDATA): RUN;
ERROR: Unable to open file C:\Users\00004263\filename.XLS. It does not exist or it is already
opened exclusively by another user, or you need permission to view its data.
ERROR: The %END statement is not valid in open code.
%end;
did=dclose(did);
drop did;
run;
%macro readdata(xlsfile);
filename zipfile clear;
proc import datafile="&xlsfile" out=want
DBMS=EXCEL REPLACE;
RANGE="Sheet1$";
GETNAMES=YES;
MIXED=no;
SCANTEXT=YES;
USEDATE=YES;
SCANTIME=YES;
RUN;
%mend;
... View more