<?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: use winrar to unzip files! in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/use-winrar-to-unzip-files/m-p/86070#M289105</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm still with Reeza and Tom&lt;/P&gt;&lt;P&gt;"Get the command to work from an actual command line..."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example here:&lt;/P&gt;&lt;P&gt;%let zipcode = SF20111YR_SAS.&lt;SPAN style="font-size: 18pt;"&gt;&lt;STRONG&gt;zip&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;%let doscmd="c:\Program files\WinRar\Rar.exe" "D:\Aging\data\2011\code\SF20111YR_SAS.&lt;SPAN style="font-size: 18pt;"&gt;&lt;STRONG&gt;rar&lt;/STRONG&gt;&lt;/SPAN&gt;" e D:\Aging\data\2011\code&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 26 May 2013 00:16:34 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2013-05-26T00:16:34Z</dc:date>
    <item>
      <title>use winrar to unzip files!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-winrar-to-unzip-files/m-p/86064#M289099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used the following command to unzip the file. However, it did not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you help me out?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;X "'c:\Program files\WinRar\Rar.exe' D:\Aging\data\2011\code\SF20111YR_SAS.rar e D:\Aging\data\2011\code";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much, &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 May 2013 21:15:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-winrar-to-unzip-files/m-p/86064#M289099</guid>
      <dc:creator>vxhong17</dc:creator>
      <dc:date>2013-05-24T21:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: use winrar to unzip files!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-winrar-to-unzip-files/m-p/86065#M289100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does it work in dos/command line?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 May 2013 21:42:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-winrar-to-unzip-files/m-p/86065#M289100</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-05-24T21:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: use winrar to unzip files!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-winrar-to-unzip-files/m-p/86066#M289101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Reeza.&amp;nbsp; i want it work in command line. Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 May 2013 23:36:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-winrar-to-unzip-files/m-p/86066#M289101</guid>
      <dc:creator>vxhong17</dc:creator>
      <dc:date>2013-05-24T23:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: use winrar to unzip files!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-winrar-to-unzip-files/m-p/86067#M289102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For debugging you try to break up things into little chunks. So in your case first make the command work in dos/command line. Once that works use it from within SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In doing so you would realise that 'c:\Program files\WinRar\Rar.exe' already isn't working on a dos command line as Windows requires that you're using double quotes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 May 2013 03:29:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-winrar-to-unzip-files/m-p/86067#M289102</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2013-05-25T03:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: use winrar to unzip files!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-winrar-to-unzip-files/m-p/86068#M289103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Get the command to work from an actual command line and then paste it into SAS.&lt;/P&gt;&lt;P&gt;If you are going to use the X command and the DOS command contains double quote characters then you should use the QUOTE() function to double them up for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%let doscmd="c:\Program files\WinRar\Rar.exe" "D:\Aging\data\2011\code\SF20111YR_SAS.rar" e D:\Aging\data\2011\code&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;X %sysfunc(quote(&amp;amp;doscmd)) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P&gt;Or just use &lt;SPAN style="font-family: 'courier new', courier;"&gt;%SYSEXEC(&amp;amp;doscmd)&lt;/SPAN&gt; since that it doesn't require the quotes since it has () around the command.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 May 2013 03:39:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-winrar-to-unzip-files/m-p/86068#M289103</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-05-25T03:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: use winrar to unzip files!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-winrar-to-unzip-files/m-p/86069#M289104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for your help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I downloaded zip files and used your command to unzip files. However, It did not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%let httpcode = &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www2.census.gov/acs2011_1yr/summaryfile/UserTools/;"&gt;http://www2.census.gov/acs2011_1yr/summaryfile/UserTools/;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;%let zipcode = SF20111YR_SAS.zip ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename Downcode url "&amp;amp;httpcode&amp;amp;zipcode";&lt;/P&gt;&lt;P&gt;filename zipcode&amp;nbsp; "D:\Aging\data\2011\code\&amp;amp;zipcode";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; nbyte=-1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; infile downcode nbyte=nbyte recfm=s;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; input;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; file zipcode recfm=n;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; put _infile_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let doscmd="c:\Program files\WinRar\Rar.exe" "D:\Aging\data\2011\code\SF20111YR_SAS.rar" e D:\Aging\data\2011\code&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;X %sysfunc(quote(&amp;amp;doscmd)) ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 May 2013 21:46:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-winrar-to-unzip-files/m-p/86069#M289104</guid>
      <dc:creator>vxhong17</dc:creator>
      <dc:date>2013-05-25T21:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: use winrar to unzip files!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-winrar-to-unzip-files/m-p/86070#M289105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm still with Reeza and Tom&lt;/P&gt;&lt;P&gt;"Get the command to work from an actual command line..."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example here:&lt;/P&gt;&lt;P&gt;%let zipcode = SF20111YR_SAS.&lt;SPAN style="font-size: 18pt;"&gt;&lt;STRONG&gt;zip&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;%let doscmd="c:\Program files\WinRar\Rar.exe" "D:\Aging\data\2011\code\SF20111YR_SAS.&lt;SPAN style="font-size: 18pt;"&gt;&lt;STRONG&gt;rar&lt;/STRONG&gt;&lt;/SPAN&gt;" e D:\Aging\data\2011\code&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 May 2013 00:16:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-winrar-to-unzip-files/m-p/86070#M289105</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2013-05-26T00:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: use winrar to unzip files!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-winrar-to-unzip-files/m-p/86071#M289106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another trick to use is to use PIPE instead of X or SYSTEM command.&amp;nbsp; Then you should be able to see in your SAS log all of the messages that the command you are trying to run is sending out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile %sysfunc(quote(&amp;amp;doscmd)) pipe ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input;&lt;/P&gt;&lt;P&gt;&amp;nbsp; put _infile_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should try the steps independently to make sure that the download step is not corrupting the zip file.&amp;nbsp; Did you try using that RAR command on other files? Are you sure it is working at all?&amp;nbsp; Once you can use RAR to unzip the file from the command prompt WITHOUT using SAS then you are ready to try to get SAS to run the command for you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 May 2013 00:51:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-winrar-to-unzip-files/m-p/86071#M289106</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-05-26T00:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: use winrar to unzip files!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-winrar-to-unzip-files/m-p/86072#M289107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Patrick, and Reeza, &lt;/P&gt;&lt;P&gt;Thank you so much for your help. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi Tom, &lt;/P&gt;&lt;P&gt;I can learn a lot from your response. Your explanation is very comprehensive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can use Winzip with all your suggestions to unzip files. I finally decide to use sample code from the following link to unzip files without any unzip applications. &lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://support.sas.com/resources/papers/proceedings12/057-2012.pdf" title="http://support.sas.com/resources/papers/proceedings12/057-2012.pdf"&gt;http://support.sas.com/resources/papers/proceedings12/057-2012.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much, &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2013 18:14:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-winrar-to-unzip-files/m-p/86072#M289107</guid>
      <dc:creator>vxhong17</dc:creator>
      <dc:date>2013-05-28T18:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: use winrar to unzip files!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-winrar-to-unzip-files/m-p/86073#M289108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad you go it working, but it still looks like you are calling some external ZIP program.&amp;nbsp; You just switched from calling winzip or rar to calling some visual basic program instead. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 May 2013 03:26:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-winrar-to-unzip-files/m-p/86073#M289108</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-05-29T03:26:48Z</dc:date>
    </item>
  </channel>
</rss>

