<?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: Import CSV file in zip format into sas server in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Import-CSV-file-in-zip-format-into-sas-server/m-p/242382#M44993</link>
    <description>You'll note in my answer, I do specify that reading from a ZIP file using this method requires SAS 9.4. If you have SAS 9.3 this code won't work. You'll need to extract the zip file and then read the .csv file. You can use X or %sysexec commands to automate the extraction of the file. There are examples of that posted on the forum or on lexjansen.com</description>
    <pubDate>Fri, 08 Jan 2016 15:21:52 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-01-08T15:21:52Z</dc:date>
    <item>
      <title>Import CSV file in zip format into sas server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-CSV-file-in-zip-format-into-sas-server/m-p/242305#M44989</link>
      <description>&lt;P&gt;To SAS community users:&lt;/P&gt;
&lt;P&gt;I try to import a csv file in zip format to sas server, but unsuccessfuly.&lt;/P&gt;
&lt;P&gt;The source code is:&lt;BR /&gt;----------------------------------&lt;BR /&gt;FILENAME inzip SASZIPAM "\..path..\aaa bbb.zip" member="aaa bbb.csv" ;&lt;/P&gt;
&lt;P&gt;PROC IMPORT datafile=inzip&amp;nbsp; out=work.test dbms=csv replace;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; getnames=yes;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RUN;&lt;/P&gt;
&lt;P&gt;/* comment: there is a blank space in the filename as user defined, the zip file has only one member */&lt;BR /&gt;---------------------------------&lt;BR /&gt;The log&amp;nbsp; is :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST in&lt;/P&gt;
&lt;P&gt;update mode. Temporary parameter values will be saved to&lt;BR /&gt;&amp;nbsp;WORK.PARMS.PARMS.SLIST.&lt;BR /&gt;&amp;nbsp;ERROR: Member aaa bbb.CSV does not exist.&lt;BR /&gt;&amp;nbsp;ERROR: Import unsuccessful.&amp;nbsp; See SAS Log for details.&lt;BR /&gt;&amp;nbsp;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;&amp;nbsp;NOTE: PROCEDURE IMPORT used (Total process time):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.04 seconds&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.03 seconds&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Would you please take a look and suggest me a solution.&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;William&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2016 01:09:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-CSV-file-in-zip-format-into-sas-server/m-p/242305#M44989</guid>
      <dc:creator>wtien196838</dc:creator>
      <dc:date>2016-01-08T01:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: Import CSV file in zip format into sas server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-CSV-file-in-zip-format-into-sas-server/m-p/242317#M44990</link>
      <description>What version of SAS do you have?&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Jan 2016 03:43:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-CSV-file-in-zip-format-into-sas-server/m-p/242317#M44990</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-08T03:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: Import CSV file in zip format into sas server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-CSV-file-in-zip-format-into-sas-server/m-p/242320#M44991</link>
      <description>&lt;P&gt;Also, I'm not sure that's the correct code. The proc import example I found seems to imply you have to copy the dataset out first.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/sasdummy/2015/05/11/using-filename-zip-to-unzip-and-read-data-files-in-sas/" target="_blank"&gt;http://blogs.sas.com/content/sasdummy/2015/05/11/using-filename-zip-to-unzip-and-read-data-files-in-sas/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The documentation implies direct access but all show a data step import instead of proc import.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try using a datastep import instead of proc import.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/lestmtsref/68024/HTML/default/viewer.htm#n1dn0f61yfyzton1l2ngsa1clllr.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/lestmtsref/68024/HTML/default/viewer.htm#n1dn0f61yfyzton1l2ngsa1clllr.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, this method requires SAS 9.4, so if you have a lower version you need to use a different method to import the data.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2016 03:50:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-CSV-file-in-zip-format-into-sas-server/m-p/242320#M44991</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-08T03:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: Import CSV file in zip format into sas server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-CSV-file-in-zip-format-into-sas-server/m-p/242367#M44992</link>
      <description>&lt;P&gt;Hi Reeza&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; My sas version is 9.3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I try to use input codes but it still failed. Here is the codes and log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FILENAME inzip saszipam "\..path..\aaa bbb.zip" ;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;DATA WORK.TEST ;&lt;BR /&gt; &amp;nbsp; INFILE inzip(aaa bbb.csv) dlm=',' FIRSTOBS=2 missover dsd;&lt;BR /&gt; &amp;nbsp; INPUT&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;var1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;var2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;.......&lt;BR /&gt; &amp;nbsp; &amp;nbsp; ;&lt;BR /&gt; run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; NOTE: The infile library INZIP is:&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; Stream=\..path..\aaa bbb.zip&lt;BR /&gt;&lt;BR /&gt; NOTE: The infile INZIP(aaa bbb.csv) is:&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; File Name=aaa bbb.csv,&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; Compressed Size=80585617,&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; Uncompressed Size=1649850367,&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; Compression Level=-1,Clear Text=No&lt;BR /&gt;&lt;BR /&gt; ERROR: Invalid data length.&lt;BR /&gt; FATAL: Unrecoverable I/O error detected in the execution of the DATA step program.&amp;nbsp; Aborted during the EXECUTION phase.&lt;BR /&gt; NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt; WARNING: The data set WORK.TEST may be incomplete.&amp;nbsp; When this step was stopped there were 0 observations and 80 variables.&lt;BR /&gt; WARNING: Data set WORK.TEST was not replaced because this step was stopped.&lt;BR /&gt; NOTE: DATA statement used (Total process time):&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; real time&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.01 seconds&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; cpu time&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.01 seconds&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;/*** I have problem to find the record length of this zip even I know all variable names (user supplied) ***/&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2016 14:24:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-CSV-file-in-zip-format-into-sas-server/m-p/242367#M44992</guid>
      <dc:creator>wtien196838</dc:creator>
      <dc:date>2016-01-08T14:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Import CSV file in zip format into sas server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-CSV-file-in-zip-format-into-sas-server/m-p/242382#M44993</link>
      <description>You'll note in my answer, I do specify that reading from a ZIP file using this method requires SAS 9.4. If you have SAS 9.3 this code won't work. You'll need to extract the zip file and then read the .csv file. You can use X or %sysexec commands to automate the extraction of the file. There are examples of that posted on the forum or on lexjansen.com</description>
      <pubDate>Fri, 08 Jan 2016 15:21:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-CSV-file-in-zip-format-into-sas-server/m-p/242382#M44993</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-08T15:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Import CSV file in zip format into sas server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-CSV-file-in-zip-format-into-sas-server/m-p/242384#M44994</link>
      <description>&lt;P&gt;PROC IMPORT is a little brain dead and does not work well with some infile options that a normal data step does not have any trouble with. &amp;nbsp;Can you just write your own data step to read the file instead of trying to use PROC IMPORT?&lt;/P&gt;
&lt;P&gt;Or use a data step to read the file to a physical file (or part of the file if it is really large). &amp;nbsp;Then you could use PROC IMPORT. If you are running interactively you can recall the generated data step and modify it to work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME inzip SASZIPAM "\..path..\aaa bbb.zip" member="aaa bbb.csv" ;
FILENAME copy TEMP;
data _null_;
   infile inzip ;
   file copy ;
   input;
   put _infile_;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Not sure why you are using SASZIPAM engine instead of the ZIP engine.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME ziplib zip "\..path..\aaa bbb.zip";
FILENAME copy TEMP;
data _null_;
   infile ziplib("aaa bbb.csv") ;
   file copy ;
   input;
   put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Jan 2016 15:29:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-CSV-file-in-zip-format-into-sas-server/m-p/242384#M44994</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-01-08T15:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: Import CSV file in zip format into sas server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-CSV-file-in-zip-format-into-sas-server/m-p/242403#M44996</link>
      <description>&lt;P&gt;Tom&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first method generated this error:&lt;/P&gt;
&lt;P&gt;ERROR: Member aaa bbb.CSV does not exist.&lt;BR /&gt; NOTE: The file COPY is:&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; Filename=G:\SAS Temporary Files\.....\#LN00036,,&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; RECFM=V,LRECL=256,File Size (bytes)=0,&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; Last Modified=&lt;SPAN class="aBn" data-term="goog_2080493228"&gt;&lt;SPAN class="aQJ"&gt;08Jan2016&lt;/SPAN&gt;&lt;/SPAN&gt;:11:29:28,&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; Create Time=&lt;SPAN class="aBn" data-term="goog_2080493229"&gt;&lt;SPAN class="aQJ"&gt;08Jan2016&lt;/SPAN&gt;&lt;/SPAN&gt;:11:29:28&lt;BR /&gt;&lt;BR /&gt; NOTE: 0 records were written to the file COPY.&lt;BR /&gt; NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt; NOTE: DATA statement used (Total process time):&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; real time&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.01 seconds&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; cpu time&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.01 seconds&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The second method generated error:&lt;/P&gt;
&lt;P&gt;ERROR: Invalid device type.&lt;BR /&gt; ERROR: Error in the FILENAME statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*** It looks like my system support "SASZIPAM" instead of "ZIP"&amp;nbsp; **&amp;nbsp;&amp;nbsp; My system is SAS 9.3&amp;nbsp;&amp;nbsp; ***/&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2016 16:41:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-CSV-file-in-zip-format-into-sas-server/m-p/242403#M44996</guid>
      <dc:creator>wtien196838</dc:creator>
      <dc:date>2016-01-08T16:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Import CSV file in zip format into sas server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-CSV-file-in-zip-format-into-sas-server/m-p/242406#M44998</link>
      <description>&lt;P&gt;&lt;A href="http://support.sas.com/kb/31/244.html" target="_blank"&gt;http://support.sas.com/kb/31/244.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Note - if the file wasn't created with WINZIP you get an IO error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2016 17:01:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-CSV-file-in-zip-format-into-sas-server/m-p/242406#M44998</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-08T17:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Import CSV file in zip format into sas server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-CSV-file-in-zip-format-into-sas-server/m-p/242409#M44999</link>
      <description>&lt;P&gt;Assuming you have access to 7-zip here's sample code to use it from SAS to unzip your file and then you can read the text file as you normally would in SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x '"C:\Program Files (x86)\7-Zip\7z.exe" e "C:\_localdata\delete.zip" -o"C:\_localdata\"';
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Jan 2016 17:31:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-CSV-file-in-zip-format-into-sas-server/m-p/242409#M44999</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-08T17:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: Import CSV file in zip format into sas server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-CSV-file-in-zip-format-into-sas-server/m-p/262228#M51149</link>
      <description>&lt;P&gt;Thanks Reeza.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I asked the tech support to do it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2016 22:40:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-CSV-file-in-zip-format-into-sas-server/m-p/262228#M51149</guid>
      <dc:creator>wtien196838</dc:creator>
      <dc:date>2016-04-07T22:40:56Z</dc:date>
    </item>
  </channel>
</rss>

