* zip_file_contents_lister.sas *; * purpose: to extract the names of the files stored in a zip file *; * first we use a filename pipe to extract the files without opening the file*; * we simply extract the files and pipe them to the con bit bucket *; * you need to change the location of the zip file here *; options noxwait xsync; filename test pipe '"c:\program files\winzip\wzunzip.exe" -co c:\max\data.zip'; data one; infile test truncover; input x $155.; run; proc print; run; * then we extract the values that contain the files *; data two; set one; value1=substr(x,1,9); if value1='unzipping'; run; * then we get rid of the stuff around the filenames *; data temp3; set two; value2=scan(x,2,'\'); filename=scan(value2,1,'.'); ext1=scan(value2,2,'.'); ext2=tranwrd(ext1," to con",""); fullfile=left(trim(filename))||'.'||ext2; run; data final; set temp3; if fullfile ^='to con .'; keep fullfile filename ext2; run; * then we print the final results *; proc print data=final; run;