When you use the FILENAME ZIP access method to read in a zipped file, you receive the following error message:
ERROR: Open failure for <file.zip> during attempt to create a local file handle.
Here is a list of possible causes:
- The zipped file does not exist.
- The zipped file is empty.
- The zipped file was created with a compression method that is not supported by SAS. (For example, the Deflate64/Enhanced deflation method is a non SAS proprietary method, so SAS is not able to decompress these files. The system commands in the instructions below show which compression method was used.)
- The file is corrupted. (If the file is moved from one host to another, it must be moved in binary mode.)
- The zipped file is password-protected.
- There is invalid syntax when reading in members, wildcards, or SAS data sets.
Complete these steps to debug the error:
- Verify that the zipped file can be unzipped outside of SAS.
- Use one of the following (or similar) system commands to see details about the zipped file:
-
- unzip -v <file.zip> /* on Windows (wunzip) and UNIX */
zipinfo <file.zip> /* on UNIX */
An alternative method to using FILENAME ZIP is to use the ZIP/UNZIP command with the FILENAME PIPE statement.
FILENAME X PIPE "unzip '<file>' ";
data _null_;
infile x;
input;
put_infile_;
run;