<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: unzip from sas in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/unzip-from-sas/m-p/691603#M210521</link>
    <description>&lt;P&gt;it is a nice soluation. but i can not see the output ? it is not unpacked to the source directory. Do you know where it is stores or can I set an output directory?&lt;/P&gt;</description>
    <pubDate>Wed, 14 Oct 2020 17:33:48 GMT</pubDate>
    <dc:creator>ANLYNG</dc:creator>
    <dc:date>2020-10-14T17:33:48Z</dc:date>
    <item>
      <title>unzip from sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/unzip-from-sas/m-p/691513#M210483</link>
      <description>&lt;P&gt;I am trying to unzip a bundle of zip files from SAS. But without luck. No errors but also no output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Can you help me with the code? Log is showed below.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thanks in advance.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Here is my Code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename tmp pipe 'dir "e:\SASFolders\DW\Data\*.zip" /b';&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%let Win_path =C:\Program Files\7-Zip\7z.exe;&lt;BR /&gt;%let path =e:\SASFolders\DW\Data;&lt;/P&gt;&lt;P&gt;filename tmp pipe 'dir "e:\SASFolders\DW\Data\*.zip" /b';&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;infile tmp;&lt;BR /&gt;length nm $200;&lt;BR /&gt;input nm $;&lt;BR /&gt;call execute(cat('x "&amp;amp;Win_path." e &amp;amp;path.',strip(nm),';'));&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;log file:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;30 filename tmp pipe 'dir "e:\SASFolders\DW\Data\*.zip" /b';&lt;BR /&gt;33&lt;BR /&gt;34 %let Win_path =C:\Program Files\7-Zip\7z.exe;&lt;BR /&gt;35 %let path =e:\SASFolders\DW\Data ;&lt;BR /&gt;36&lt;BR /&gt;37 filename tmp pipe 'dir "e:\SASFolders\DW\Data\*.zip" /b';&lt;BR /&gt;38&lt;BR /&gt;39 data _null_;&lt;BR /&gt;40 infile tmp;&lt;BR /&gt;41 length nm $200;&lt;BR /&gt;42 input nm $;&lt;BR /&gt;43 call execute(cat('x "&amp;amp;Win_path." e &amp;amp;path.',strip(nm),';'));&lt;BR /&gt;44 run;&lt;/P&gt;&lt;P&gt;NOTE: The infile TMP is:&lt;BR /&gt;Unnamed Pipe Access Device,&lt;BR /&gt;PROCESS=dir "e:\SASFolders\DW\Data\*.zip" /b,&lt;BR /&gt;RECFM=V,LRECL=32767&lt;/P&gt;&lt;P&gt;NOTE: 3 records were read from the infile TMP.&lt;BR /&gt;The minimum record length was 62.&lt;BR /&gt;The maximum record length was 62.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.04 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;BR /&gt;2 The SAS System 12:10 Wednesday, October 14, 2020&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: CALL EXECUTE generated line.&lt;BR /&gt;1 + x "C:\Program Files\7-Zip\7z.exe" e&lt;BR /&gt;e:\SASFolders\DW\Data\d1c18e01-6e04-47ef-99a1-1bf5fd01c760.zip&lt;BR /&gt;1 +&lt;BR /&gt;;&lt;BR /&gt;2 + x "C:\Program Files\7-Zip\7z.exe" e&lt;BR /&gt;e:\SASFolders\DW\Data\d1c18e01-6e04-47ef-99a1-1bf5fd01c760.zip&lt;BR /&gt;2 +&lt;BR /&gt;;&lt;BR /&gt;3 + x "C:\Program Files\7-Zip\7z.exe" e&lt;BR /&gt;e:\SASFolders\DW\Data\20201012_d1c18e01-6e04-47ef-99a1-1bf5fd01c760.zip&lt;BR /&gt;3 +&lt;BR /&gt;;&lt;BR /&gt;45&lt;BR /&gt;46 %LET _CLIENTTASKLABEL=;&lt;BR /&gt;47 %LET _CLIENTPROCESSFLOWNAME=;&lt;BR /&gt;48 %LET _CLIENTPROJECTPATH=;&lt;BR /&gt;49 %LET _CLIENTPROJECTPATHHOST=;&lt;BR /&gt;50 %LET _CLIENTPROJECTNAME=;&lt;BR /&gt;51 %LET _SASPROGRAMFILE=;&lt;BR /&gt;52 %LET _SASPROGRAMFILEHOST=;&lt;BR /&gt;53&lt;BR /&gt;54 ;*';*";*/;quit;run;&lt;BR /&gt;55 ODS _ALL_ CLOSE;&lt;BR /&gt;56&lt;BR /&gt;57&lt;BR /&gt;58 QUIT; RUN;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 12:36:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/unzip-from-sas/m-p/691513#M210483</guid>
      <dc:creator>ANLYNG</dc:creator>
      <dc:date>2020-10-14T12:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: unzip from sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/unzip-from-sas/m-p/691517#M210484</link>
      <description>&lt;P&gt;In this statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;call execute(cat('x "&amp;amp;Win_path." e &amp;amp;path.',strip(nm),';'));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The use of the single quotes prevents resolving of the macro variable.&lt;/P&gt;
&lt;P&gt;You should split that into two steps; first, create a dataset with filenames:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename tmp pipe 'dir "e:\SASFolders\DW\Data\*.zip" /b';
data fnames;
infile tmp;
length nm $200;
input nm $;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Next, use the "Dynamic Pipe" to execute your commands:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
set fnames;
length fvar $300;
fvar = catx(" ",quote("&amp;amp;Win_path."),"e &amp;amp;path.",strip(nm));
infile dummy pipe filevar=fvar end=done;
do until(done)
  input;
  put _infile_;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This should return all system responses to the log.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 13:18:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/unzip-from-sas/m-p/691517#M210484</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-14T13:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: unzip from sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/unzip-from-sas/m-p/691603#M210521</link>
      <description>&lt;P&gt;it is a nice soluation. but i can not see the output ? it is not unpacked to the source directory. Do you know where it is stores or can I set an output directory?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 17:33:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/unzip-from-sas/m-p/691603#M210521</guid>
      <dc:creator>ANLYNG</dc:creator>
      <dc:date>2020-10-14T17:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: unzip from sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/unzip-from-sas/m-p/691606#M210522</link>
      <description>&lt;P&gt;the response from running is this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Extracting archive: e:\SASFolders\BUFDW\Data\01_Source_Data\85_AULA\auladata_101_20201012_d1c18e01-6e04-47ef-99a1-1bf5fd01c760.zip&lt;BR /&gt;--&lt;BR /&gt;Path = e:\SASFolders\DW\Data\d1c18e01-6e04-47ef-99a1-1bf5fd01c760.zip&lt;BR /&gt;Type = zip&lt;BR /&gt;Physical Size = 16076005&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;No files to process&lt;BR /&gt;Everything is Ok&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;etc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and there IS two files inside&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 17:41:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/unzip-from-sas/m-p/691606#M210522</guid>
      <dc:creator>ANLYNG</dc:creator>
      <dc:date>2020-10-14T17:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: unzip from sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/unzip-from-sas/m-p/691624#M210524</link>
      <description>&lt;P&gt;one of the problem is there is a linefeed in fvar between patch and filename&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 18:48:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/unzip-from-sas/m-p/691624#M210524</guid>
      <dc:creator>ANLYNG</dc:creator>
      <dc:date>2020-10-14T18:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: unzip from sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/unzip-from-sas/m-p/691625#M210525</link>
      <description>&lt;P&gt;Before you try to run that command from SAS, you should first get it to run from the commandline. It is easier to debug there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What we know:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;the command is found and executed&lt;/LI&gt;
&lt;LI&gt;it finds the archive&lt;/LI&gt;
&lt;LI&gt;it seems to not find anything to unzip&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 14 Oct 2020 18:49:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/unzip-from-sas/m-p/691625#M210525</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-14T18:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: unzip from sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/unzip-from-sas/m-p/691626#M210526</link>
      <description>is it works from command line but it seems that sas divide the command over two lines -&lt;BR /&gt;NOTE: The infile DUMMY is:&lt;BR /&gt;Unnamed Pipe Access Device,&lt;BR /&gt;&lt;BR /&gt;PROCESS="C:\Program Files\7-Zip\7z.exe" e e:\SASFolders\DW\Data\&lt;BR /&gt;20201013_d1c18e01-6e04-47ef-99a1-1bf5fd01c760.zip,&lt;BR /&gt;RECFM=V,LRECL=32767</description>
      <pubDate>Wed, 14 Oct 2020 18:51:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/unzip-from-sas/m-p/691626#M210526</guid>
      <dc:creator>ANLYNG</dc:creator>
      <dc:date>2020-10-14T18:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: unzip from sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/unzip-from-sas/m-p/691628#M210528</link>
      <description>&lt;P&gt;Make a slight change:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;fvar = catx(" ",quote("&amp;amp;Win_path."),"e &amp;amp;path."!!strip(nm));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Oct 2020 18:52:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/unzip-from-sas/m-p/691628#M210528</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-14T18:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: unzip from sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/unzip-from-sas/m-p/691634#M210529</link>
      <description>&lt;P&gt;it WORKS!!! thank you so much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I will find out where the files has been outputted. I suppose the files are in my user default dir. I want to put is somewhere else.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 18:57:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/unzip-from-sas/m-p/691634#M210529</guid>
      <dc:creator>ANLYNG</dc:creator>
      <dc:date>2020-10-14T18:57:37Z</dc:date>
    </item>
  </channel>
</rss>

