Help using Base SAS procedures

How can I read from a Winzip self-extracting (exe) zip file in SAS?

Accepted Solution Solved
Reply
Contributor
Posts: 59
Accepted Solution

How can I read from a Winzip self-extracting (exe) zip file in SAS?

I have a Winzip compressed file which I want to read in automatically in a SAS program flow using SAS decompression engines. I've tried a couple of import, compression commands as well as 7zip.exe, none of which have worked. I am working on a Windows XP platform.

Here's the compressed file name:  EPS_INFORMACION.zip and the file zipped up inside is an Excel *.xlsx file named EPS_Data.xlsx.

Any suggestions?

Thank you!


Accepted Solutions
Solution
‎04-04-2015 07:13 PM
Super User
Posts: 17,868

Re: How can I read from a Winzip self-extracting (exe) zip file in SAS?

I don't think you can, for an XLSX file.

You can for text files though,

http://blogs.sas.com/content/sasdummy/2014/01/29/using-filename-zip/

View solution in original post


All Replies
Super User
Super User
Posts: 6,502

Re: How can I read from a Winzip self-extracting (exe) zip file in SAS?

A self-extracting file would have the extension of EXE instead of ZIP, but you should still be able to extract it using UNZIP, 7ZIP or even the ZIP engine in SAS.  If you are getting errors then perhaps it is corrupted.  Perhaps some one moved it between a Unix and Windows system as if it was a text file instead of a binary file?  Note that it does not make sense to ZIP an XLSX file since the XLSX file itself is just a ZIP archive with a different extension.

Contributor
Posts: 59

Re: How can I read from a Winzip self-extracting (exe) zip file in SAS?

Tom, thanks for your reply. Just to be clear, I'm not interested in extracting the file and setting it up for uncompressed, flat file-like access. Rather, I want to leave it in its compressed state and access it in real program run-time. Given that clarification, what would the SAS syntax look like?

Solution
‎04-04-2015 07:13 PM
Super User
Posts: 17,868

Re: How can I read from a Winzip self-extracting (exe) zip file in SAS?

I don't think you can, for an XLSX file.

You can for text files though,

http://blogs.sas.com/content/sasdummy/2014/01/29/using-filename-zip/

Contributor
Posts: 59

Re: How can I read from a Winzip self-extracting (exe) zip file in SAS?

Uh oh! I was afraid of that....thanks.

Super User
Super User
Posts: 6,502

Re: How can I read from a Winzip self-extracting (exe) zip file in SAS?

You would need to do it in two steps in SAS. First extract it from the ZIP archive and then use PROC IMPORT or LIBNAME engine to convert the XLSX file into data.  But again, there is no advantage in storing the XLSX file int a ZIP archive since the contents of the XLSX file is already compressed.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 400 views
  • 0 likes
  • 3 in conversation