<?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: File import in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110159#M22847</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;different error this time:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Line : 5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Char: 5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error: The system cannot find the file specified&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;code: 80070002&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sour&lt;/STRONG&gt;&lt;STRONG&gt;ce: (null)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Jun 2013 03:08:22 GMT</pubDate>
    <dc:creator>vicky07</dc:creator>
    <dc:date>2013-06-18T03:08:22Z</dc:date>
    <item>
      <title>File import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110154#M22842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I have a PKZIP file(attached) which I manually unzip and read a particular file into SAS. I'm wondering if there a work around in SAS to unzip the file via data step and read the contents. In this case, I want to read dec12.cpt.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;STRONG&gt;PS: I'm using PC SAS on windows to run the above process.&lt;/STRONG&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Thanks in advance for your help!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jun 2013 22:56:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110154#M22842</guid>
      <dc:creator>vicky07</dc:creator>
      <dc:date>2013-06-17T22:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: File import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110155#M22843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use a VB script to have it done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code.&lt;/P&gt;&lt;P&gt; Fname = ("C:\Users\Desktop\manual\2CBM00176.zip") /* your zip file folder*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DirName = ("C:\Users\Desktop\manual") /* your targer folder*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oApp As Object&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oApp = CreateObject("Shell.Application")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; oApp.Namespace(DirName).CopyHere oApp.Namespace(Fname).items&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oApp = Nothing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;save it as .vbs file and call it from sas&lt;/P&gt;&lt;P&gt; data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x "C:\Users\O568484\Desktop\manual_Marketing\test.vbs";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename test "C:\Users\Desktop\manual\&lt;SPAN style="font-size: 10pt;"&gt;dec12.cpt&lt;/SPAN&gt;";&lt;/P&gt;&lt;P&gt;%include test;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this will help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jun 2013 23:33:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110155#M22843</guid>
      <dc:creator>devnand</dc:creator>
      <dc:date>2013-06-17T23:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: File import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110156#M22844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is a popular practice for SAS users to use PIPE for this kind of task, &lt;A href="http://www2.sas.com/proceedings/sugi31/155-31.pdf" title="http://www2.sas.com/proceedings/sugi31/155-31.pdf"&gt;http://www2.sas.com/proceedings/sugi31/155-31.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;While this paper does not specifically spell out how to do it using PKZIP, but it should be easy enough to find it out the right command by typing pkunzip or pkunzip /? or look it up online.&lt;/P&gt;&lt;P&gt;Something along the line of the following may work for you:&lt;/P&gt;&lt;P&gt;filename pkzip pipe 'pkunzip.exe c:\test.zip -c' ;&lt;/P&gt;&lt;P&gt;data want ;&lt;/P&gt;&lt;P&gt;infile pkzip ;&lt;/P&gt;&lt;P&gt;input var &amp;amp; $200. ;&lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 00:38:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110156#M22844</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-06-18T00:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: File import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110157#M22845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Devnand - Thanks for your reply. I followed your instructions but I am getting error message which is as follows.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Line : 3&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Char: 14&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error: expected end of statement&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;code: 800A0401&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Source: Microsoft VBscript compliation error&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My VB script&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Fname = ("C:\ARM\ARMfile.zip")&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DirName = ("C:\TEMP")&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oApp As Object&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oApp = CreateObject("Shell.Application")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; oApp.Namespace(DirName).CopyHere oApp.Namespace(Fname).items&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oApp = Nothing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 02:15:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110157#M22845</guid>
      <dc:creator>vicky07</dc:creator>
      <dc:date>2013-06-18T02:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: File import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110158#M22846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please remove as object from line 3 of the code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 02:32:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110158#M22846</guid>
      <dc:creator>devnand</dc:creator>
      <dc:date>2013-06-18T02:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: File import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110159#M22847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;different error this time:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Line : 5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Char: 5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error: The system cannot find the file specified&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;code: 80070002&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sour&lt;/STRONG&gt;&lt;STRONG&gt;ce: (null)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 03:08:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110159#M22847</guid>
      <dc:creator>vicky07</dc:creator>
      <dc:date>2013-06-18T03:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: File import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110160#M22848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai.Kuo,&lt;/P&gt;&lt;P&gt;I tried your approach before posting the question in this forum and i got the below error&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Stderr output:&lt;BR /&gt;'pkunzip.exe' is not recognized as an internal or external command,&lt;BR /&gt;operable program or batch file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried my best to search online but couldn't find the right pipe command for pkunzip. i even tried the below but getting same error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; filename pkzip pipe 'PKUNZIP C:\ARM\ARMfile.zip C:\TEMP -c';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 03:43:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110160#M22848</guid>
      <dc:creator>vicky07</dc:creator>
      <dc:date>2013-06-18T03:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: File import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110161#M22849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Fname = ("C:\Users\\Desktop\New\2CBM00176.zip")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DirName =("C:\Users\\Desktop\New\")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oApp &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oApp = CreateObject("Shell.Application")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; oApp.Namespace(DirName).CopyHere oApp.Namespace(Fname).items&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oApp = Nothing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please make sure that your code exactly looks like the same. I see backslash missing in the 2nd line of your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this will help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 03:57:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110161#M22849</guid>
      <dc:creator>devnand</dc:creator>
      <dc:date>2013-06-18T03:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: File import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110162#M22850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For some reason I'm getting the same error again.Below is my code. Can you do a quick check on my code to make sure i am not missing anything? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fname = ("C:\TEMP\zipcode_Apr13.zip")&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DirName = ("C:\TEMP\")&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim oApp &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oApp = CreateObject("Shell.Application")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; oApp.Namespace(DirName).CopyHere oApp.Namespace(Fname).items&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oApp = Nothing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see &lt;STRONG&gt;double&lt;/STRONG&gt; backslash in your code in Fname and Dirname? Is that something i should also have in my code?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 12:47:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110162#M22850</guid>
      <dc:creator>vicky07</dc:creator>
      <dc:date>2013-06-18T12:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: File import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110163#M22851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The pipe commands are specific to PKZIP and assume that it is installed on your machine (as opposed to WinZIp which requires a command line add on and different syntax).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is some more reference for the VB script (which assumes you are trying to use the built in windows compression). I seem to remember there are compression algortihms that windows can not uncompress so if the files were not compressed use the default options that may cause trouble.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A 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;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 14:00:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110163#M22851</guid>
      <dc:creator>esjackso</dc:creator>
      <dc:date>2013-06-18T14:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: File import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110164#M22852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your first post, you mentioned that you manually unzip the file. Which program you were using to do that? If it is not pkunzip, then PIPE whatever program available on your machine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 14:26:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110164#M22852</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-06-18T14:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: File import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110165#M22853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SAS ADMIRER:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure what you are doing wrong. I copied the above code and execute it and it ran like a champ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry it did not help you. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 15:55:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110165#M22853</guid>
      <dc:creator>devnand</dc:creator>
      <dc:date>2013-06-18T15:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: File import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110166#M22854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai.kuo- I would just right click on the zip file and do extract to manually unzip the file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jun 2013 02:19:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110166#M22854</guid>
      <dc:creator>vicky07</dc:creator>
      <dc:date>2013-06-19T02:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: File import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110167#M22855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the insight!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jun 2013 02:20:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110167#M22855</guid>
      <dc:creator>vicky07</dc:creator>
      <dc:date>2013-06-19T02:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: File import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110168#M22856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Devnand- There must be something wrong in my system. Thanks for all your help though!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jun 2013 02:23:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/File-import/m-p/110168#M22856</guid>
      <dc:creator>vicky07</dc:creator>
      <dc:date>2013-06-19T02:23:12Z</dc:date>
    </item>
  </channel>
</rss>

