Hi Chris, sorry to come to this years late but it sparked my interest. Your blog post "Using FILENAME ZIP to unzip and read data files in SAS" (https://blogs.sas.com/content/sasdummy/2015/05/11/using-filename-zip-to-unzip-and-read-data-files-in-sas/) has an example of reading a SAS data set in a ZIP file that I used successfully, but your reply to Andreas Menrath's 5/25/2015 note had a link to this post where you note that another method was much more robust. That made me nervous so I tried to apply the FCOPY method in this post to a ZIP file.

First, to verify the FCOPY code, I successfully copied a SAS data set from one location to another using the method who showed above, e.g.,

libname xxx 'U:\M1XXX00\ziptests\dir1';
data xxx.one;
x=1;
run;
libname xxx clear;
filename out1 'U:\M1XXX00\ziptests\dir1\one.sas7bdat' RECFM=N;
filename in1 'U:\M1XXX00\ziptests\dir2\one.sas7bdat' RECFM=N;
data _null_;
length msg $ 384;
rc=fcopy('out1', 'in1');
if rc=0 then
put 'Copied out1 to in1.';
else do;
msg=sysmsg();
put rc= msg=;
end;
run;

But, when I tried to use the same code to copy a SAS data set from a ZIP file to a SAS library, I got an error. As noted above, I used your code from the earlier blog post to successfully read from this small ZIP file, which I created manually in WIndows, so I am confident the ZIP file is valid.

1 filename outzip1 zip "U:\M1XXX00\ziptests\unzip2.zip" member="unzip2/data/class2.sas7bdat"
1 ! recfm=n; /* Source: in zip file */
2 filename in1 'U:\M1XXX00\ziptests\dir2\one.sas7bdat' RECFM=N; /* Destination: SAS library */
3 data _null_;
4 length msg $ 384;
5 rc=fcopy('outzip1', 'in1');
6 if rc=0 then
7 put 'Copied outzip1 to in1.';
8 else do;
9 msg=sysmsg();
10 put rc= msg=;
11 end;
12 run;

rc=-7440230
msg=WARNING: 0 records were truncated when the FCOPY function read from fileref OUTZIP1. 4 records
were truncated when the FCOPY function wrote to fileref IN1. To prevent the truncation of records
in future operations, you can increase the amount of space needed to accommodate the records by u
sing the LRECL= system option or the LRECL= option in the FILENAME statement.
NOTE: DATA statement used (Total process time):

I don't understand this error. Should I read the SAS data set in this ZIP file this way, or is the method in the earlier post sufficiently robust? Thanks so much for looking at this.