I am writing a code to read off a zip file using 7zip. I have successfully done the same. However, the code makes the command prompt to open and doesn't generate the dataset entirely unless I manually close the command prompt. Is there any way in which the command prompt can be closed automatically?
libname Orders "D:\Gautham\ISB\Ram\BSE Project\Data\Orders\SAS\Temp"; filename zipfile PIPE '7za e "D:\...\OISBHHY_060513.zip" "OISBHHY_060513" -y -so'; /*Code for reading File from Zip File*/ data Orders.Raw_Data; infile zipfile dlm = '|' dsd lrecl = 1024 truncover obs = 10; input tradesession symbol tmc cmc:$12.
cat:$8. bors:$1. ordtype:$1. lp vo vd
timestamp:$50. retention acttype:$1. orno:$30. actionid:$30.; run;
Yes, I have tried it. These are files that have been generate on Unix so they only open with 7ZIP. They are really large files as well. Hence, I don't want to unzip them, read them and delete the unzipped one.
What are you settings for the XWAIT and XSYNC options?
Also is 7za an actual executable program or some type of shell script?
7za is an executable program. It's the command line version of 7zip. I have tried the code with the following addition as well:
options noxsync noxwait;
The program still does not work.
I don't know what version of 7zip you have. The version 9.20 I have does not include a 7za.exe file.
If I try to use the 7z.exe to extract a file to std output like your command line then 7Z complains.
C:\>"C:\Program Files\7-Zip\7z.exe" e "c:\downloads\7ztest.zip" "class.txt" -y -so 7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18 Error: I won't write data and program's messages to same terminal C:\>
Perhaps that is the difference between 7za and 7z commands?
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.