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!
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/
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.
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?
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/
Uh oh! I was afraid of that....thanks.
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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.