<?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 Password Protected batch SAS files in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Unzip-Password-Protected-batch-SAS-files/m-p/795642#M255229</link>
    <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;. Thank you so much for your time!!!!. I have tried the above code and got a message that&lt;BR /&gt;*&lt;BR /&gt;'unzip' is not recognized as an internal or external command,&lt;BR /&gt;operable program or batch file.&lt;BR /&gt;*&lt;BR /&gt;Do I have to install anything before I run this.</description>
    <pubDate>Fri, 11 Feb 2022 12:38:04 GMT</pubDate>
    <dc:creator>shasank</dc:creator>
    <dc:date>2022-02-11T12:38:04Z</dc:date>
    <item>
      <title>Unzip Password Protected batch SAS files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unzip-Password-Protected-batch-SAS-files/m-p/795579#M255207</link>
      <description>&lt;P&gt;Hi Community,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need your help with the above mentioned task. I have surfed the internet to find answers for this and was not much of a help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please advise.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data _null_ ;
 unzipcmd='"C:\Program Files\WinZip\Winzip64.exe" -min -e -o -s' ;
 pw='"qwerty"' ;
 zipfile="O:\Data\20220205.zip" ;
 whereto='C:\' ;
cmd=unzipcmd || pw || ' ' || zipfile || ' ' || whereto  ;
putlog "NOTE-Processing command " cmd ;
 call system( cmd ) ;
run ; &lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;options noxwait;
%LET PASS =&lt;CODE class=""&gt;qwerty&lt;/CODE&gt;; x unzip -o -P &amp;amp;PASS. "O:\Data\&lt;CODE class=""&gt;20220205&lt;/CODE&gt;.zip" -d "O:\Data";&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Feb 2022 02:15:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unzip-Password-Protected-batch-SAS-files/m-p/795579#M255207</guid>
      <dc:creator>shasank</dc:creator>
      <dc:date>2022-02-11T02:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: Unzip Password Protected batch SAS files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unzip-Password-Protected-batch-SAS-files/m-p/795582#M255208</link>
      <description>20220205.zip is a password protected zip file that has around 15 SAS datasets. I am trying to extract the SAS datasets and automate the process.</description>
      <pubDate>Fri, 11 Feb 2022 02:19:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unzip-Password-Protected-batch-SAS-files/m-p/795582#M255208</guid>
      <dc:creator>shasank</dc:creator>
      <dc:date>2022-02-11T02:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: Unzip Password Protected batch SAS files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unzip-Password-Protected-batch-SAS-files/m-p/795591#M255214</link>
      <description>&lt;UL&gt;
&lt;LI&gt;Figure out the command that works from the DOS/CMD window prompt.&lt;/LI&gt;
&lt;LI&gt;Make sure it runs on the machine where SAS is running when logged in as the user that is running the SAS code. For example if you are using SAS/Studio or Enterprise Guide to submit your SAS code then it might be running on a different machine than the one you are using to run your front end tool.&amp;nbsp; That machine might not even be running Windows, or have the WinZip.exe command on it, or even have access to the O drive where your file is.&lt;/LI&gt;
&lt;LI&gt;Try running a static version of the code.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you have code that works Then figure out how to create it with SAS code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I recommend NOT using the X command.&amp;nbsp;&amp;nbsp;Instead just use the PIPE engine to run the command you have generated.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Feb 2022 03:53:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unzip-Password-Protected-batch-SAS-files/m-p/795591#M255214</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-02-11T03:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Unzip Password Protected batch SAS files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unzip-Password-Protected-batch-SAS-files/m-p/795593#M255215</link>
      <description>Thank you for your reply &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;. Is there is way to perform this using a regular Filename statements??</description>
      <pubDate>Fri, 11 Feb 2022 04:43:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unzip-Password-Protected-batch-SAS-files/m-p/795593#M255215</guid>
      <dc:creator>shasank</dc:creator>
      <dc:date>2022-02-11T04:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Unzip Password Protected batch SAS files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unzip-Password-Protected-batch-SAS-files/m-p/795609#M255224</link>
      <description>&lt;P&gt;Running an external command via pipe goes like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename oscmd pipe "unzip -o -P &amp;amp;PASS. O:\Data\20220205.zip -d O:\Data 2&amp;gt;&amp;amp;1";

data _null_;
infile oscmd;
input;
put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Since you do not have blanks in your path names, quotes are not needed there.&lt;/P&gt;
&lt;P&gt;The "2&amp;gt;&amp;amp;1" reroutes stderr to stdout, so SAS can catch all eventual messages that come back from the external command.&lt;/P&gt;
&lt;P&gt;Inspect the SAS log to see what happened.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Feb 2022 06:15:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unzip-Password-Protected-batch-SAS-files/m-p/795609#M255224</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-11T06:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: Unzip Password Protected batch SAS files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unzip-Password-Protected-batch-SAS-files/m-p/795642#M255229</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;. Thank you so much for your time!!!!. I have tried the above code and got a message that&lt;BR /&gt;*&lt;BR /&gt;'unzip' is not recognized as an internal or external command,&lt;BR /&gt;operable program or batch file.&lt;BR /&gt;*&lt;BR /&gt;Do I have to install anything before I run this.</description>
      <pubDate>Fri, 11 Feb 2022 12:38:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unzip-Password-Protected-batch-SAS-files/m-p/795642#M255229</guid>
      <dc:creator>shasank</dc:creator>
      <dc:date>2022-02-11T12:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: Unzip Password Protected batch SAS files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unzip-Password-Protected-batch-SAS-files/m-p/795696#M255250</link>
      <description>&lt;P&gt;It may well be that you use a server-based SAS (through SAS Studio or Enterprise Guide) where the server does not yet have unzip installed.&lt;/P&gt;
&lt;P&gt;Check with your SAS admins&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;where SAS is installed (local or remote)&lt;/LI&gt;
&lt;LI&gt;which operating system (if remote)&lt;/LI&gt;
&lt;LI&gt;which zip/unzip program to use&lt;/LI&gt;
&lt;LI&gt;which path to use (if remote)&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Fri, 11 Feb 2022 16:16:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unzip-Password-Protected-batch-SAS-files/m-p/795696#M255250</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-11T16:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: Unzip Password Protected batch SAS files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unzip-Password-Protected-batch-SAS-files/m-p/795732#M255256</link>
      <description>Hi Kurt_Bremser,&lt;BR /&gt;Thank you!! I have cross checked and I am using SAS 9.4 installed on a windows machine. It is installed locally. I keep getting an error that UNZIP is not a built-in windows function. I will try to find if there is a similar function for windows.</description>
      <pubDate>Fri, 11 Feb 2022 18:04:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unzip-Password-Protected-batch-SAS-files/m-p/795732#M255256</guid>
      <dc:creator>shasank</dc:creator>
      <dc:date>2022-02-11T18:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: Unzip Password Protected batch SAS files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unzip-Password-Protected-batch-SAS-files/m-p/795741#M255259</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/110575"&gt;@shasank&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hi Kurt_Bremser,&lt;BR /&gt;Thank you!! I have cross checked and I am using SAS 9.4 installed on a windows machine. It is installed locally. I keep getting an error that UNZIP is not a built-in windows function. I will try to find if there is a similar function for windows.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So you appear stuck on the first step.&amp;nbsp; What DOS/Windows command can you run to unzip a file on machine.&lt;/P&gt;
&lt;P&gt;Try using Google to see if there is something available to you.&amp;nbsp; If you have local system support ask them for help also.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.google.com/search?q=unzipping+password+protected+zip+file+on+windows" target="_blank" rel="noopener"&gt;https://www.google.com/search?q=unzipping+password+protected+zip+file+on+windows&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looks like a lot of users are using 7-Zip which does have a command line option you can get.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Feb 2022 18:23:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unzip-Password-Protected-batch-SAS-files/m-p/795741#M255259</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-02-11T18:23:53Z</dc:date>
    </item>
  </channel>
</rss>

