<?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: Importing the data from zipped csv file in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-the-data-from-zipped-csv-file/m-p/284310#M19468</link>
    <description>&lt;P&gt;here is the log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;label_id,category&lt;BR /&gt;1,&lt;BR /&gt;2,game-type&lt;BR /&gt;3,game- themes&lt;BR /&gt;4,game-Style&lt;BR /&gt;5,game-time&lt;BR /&gt;6,game-things&lt;BR /&gt;7,game-Finding fault&lt;BR /&gt;8,game-stress reliever&lt;BR /&gt;9,game-pet&lt;BR /&gt;NOTE: 10 records were read from the infile FOO.&lt;BR /&gt; The minimum record length was 2.&lt;BR /&gt; The maximum record length was 22.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but the output dataset contains this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Var1&lt;/P&gt;
&lt;P&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;4&lt;BR /&gt;5&lt;/P&gt;</description>
    <pubDate>Thu, 14 Jul 2016 12:58:37 GMT</pubDate>
    <dc:creator>munitech4u</dc:creator>
    <dc:date>2016-07-14T12:58:37Z</dc:date>
    <item>
      <title>Importing the data from zipped csv file</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-the-data-from-zipped-csv-file/m-p/284292#M19464</link>
      <description>&lt;P&gt;I am trying to import the csv data in zipped file using:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;filename foo ZIP '/applocation/kg/label_categories.csv.zip' member="label_categories.csv" ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc import datafile=foo out=label dbms=csv replace; getnames=yes;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the dataset contains only 1 variable with 1 length.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know, I can read the data using:&amp;nbsp;input statement. But that requires me to specify manually input for all variables, which can be tiresome a job while importing lot of files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I get all the data similar to proc import, without using the input statement?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2016 12:03:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-the-data-from-zipped-csv-file/m-p/284292#M19464</guid>
      <dc:creator>munitech4u</dc:creator>
      <dc:date>2016-07-14T12:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Importing the data from zipped csv file</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-the-data-from-zipped-csv-file/m-p/284296#M19466</link>
      <description>&lt;P&gt;Try this: use DATA step to "copy" the file out of the ZIP first, then import it. &amp;nbsp;I describe this in a &lt;A href="http://blogs.sas.com/content/sasdummy/2015/05/11/using-filename-zip-to-unzip-and-read-data-files-in-sas/" target="_self"&gt;blog post about FILENAME ZIP&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code might look like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename inzip ZIP '/applocation/kg/label_categories.csv.zip' 

filename csv "%sysfunc(getoption(work))/label_categories.csv" ;

data _null_;
   /* using member syntax here */
   infile inzip(label_categories.csv) 
       lrecl=256 recfm=F length=length eof=eof unbuf;
   file csv lrecl=256 recfm=N;
   input;
   put _infile_ $varying256. length;
   return;
 eof:
   stop;
run;

proc import datafile=csv out=label dbms=csv replace; getnames=yes;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Jul 2016 12:15:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-the-data-from-zipped-csv-file/m-p/284296#M19466</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2016-07-14T12:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Importing the data from zipped csv file</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-the-data-from-zipped-csv-file/m-p/284297#M19467</link>
      <description>&lt;P&gt;This makes me curious to find out what the input file looks like from the SAS perspective.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you execute this piece of code and share the results?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename foo ZIP '/applocation/kg/label_categories.csv.zip' member="label_categories.csv" ;

data _null_;
   infile foo obs=10;
   input; 
   put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This dumps a piec of your unzipped file to the log. That may help understand the behaviour of proc import.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;- Jan.&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;</description>
      <pubDate>Thu, 14 Jul 2016 12:14:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-the-data-from-zipped-csv-file/m-p/284297#M19467</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2016-07-14T12:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: Importing the data from zipped csv file</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-the-data-from-zipped-csv-file/m-p/284310#M19468</link>
      <description>&lt;P&gt;here is the log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;label_id,category&lt;BR /&gt;1,&lt;BR /&gt;2,game-type&lt;BR /&gt;3,game- themes&lt;BR /&gt;4,game-Style&lt;BR /&gt;5,game-time&lt;BR /&gt;6,game-things&lt;BR /&gt;7,game-Finding fault&lt;BR /&gt;8,game-stress reliever&lt;BR /&gt;9,game-pet&lt;BR /&gt;NOTE: 10 records were read from the infile FOO.&lt;BR /&gt; The minimum record length was 2.&lt;BR /&gt; The maximum record length was 22.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but the output dataset contains this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Var1&lt;/P&gt;
&lt;P&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;4&lt;BR /&gt;5&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2016 12:58:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Importing-the-data-from-zipped-csv-file/m-p/284310#M19468</guid>
      <dc:creator>munitech4u</dc:creator>
      <dc:date>2016-07-14T12:58:37Z</dc:date>
    </item>
  </channel>
</rss>

