<?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: member level reading in ZIP Access method doesn't work with filevar= option in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/member-level-reading-in-ZIP-Access-method-doesn-t-work-with/m-p/482335#M124910</link>
    <description>&lt;P&gt;I can iterate fine,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data HAVE; 
  ZIPFILE="%sysfunc(pathname(WORK))\z1.zip"; output;
  ZIPFILE="%sysfunc(pathname(WORK))\z2.zip"; output;
run;

data WANT(keep=MEMNAME ZIPFILE);
  set HAVE;
  length MEMNAME $200 ;
  RC=filename('inzip',ZIPFILE,'zip');
  if RC then return;
  FID=dopen('inzip');
  if FID=0 then return;
  MEMCOUNT=dnum(FID);
  do I=1 to MEMCOUNT;
    MEMNAME=dread(FID,I);
    output;
  end;
  RC=dclose(FID);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Since you are using file functions, using the filename() function makes more sense than using FILEVAR=.&lt;/P&gt;</description>
    <pubDate>Mon, 30 Jul 2018 02:47:22 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2018-07-30T02:47:22Z</dc:date>
    <item>
      <title>member level reading in ZIP Access method doesn't work with filevar= option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/member-level-reading-in-ZIP-Access-method-doesn-t-work-with/m-p/481921#M124741</link>
      <description>&lt;P&gt;Good morning,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Was following Chris Hemedinger's example (&lt;A href="https://blogs.sas.com/content/sasdummy/2015/05/11/using-filename-zip-to-unzip-and-read-data-files-in-sas/" target="_self"&gt;blog&lt;/A&gt;) on reading members in a zip file.&amp;nbsp; Works great as long as I have a hard-coded filename on the FILENAME statement.&amp;nbsp; When I have multiple zip files to read and try to use the FILEVAR= option, the dsopen() function fails and returns a value of 0.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Am I seeing this correctly?&amp;nbsp; If so I guess I can generate code that reads each of the zip files I need to extract member names for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--Ben&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jul 2018 16:09:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/member-level-reading-in-ZIP-Access-method-doesn-t-work-with/m-p/481921#M124741</guid>
      <dc:creator>BenConner</dc:creator>
      <dc:date>2018-07-27T16:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: member level reading in ZIP Access method doesn't work with filevar= option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/member-level-reading-in-ZIP-Access-method-doesn-t-work-with/m-p/482335#M124910</link>
      <description>&lt;P&gt;I can iterate fine,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data HAVE; 
  ZIPFILE="%sysfunc(pathname(WORK))\z1.zip"; output;
  ZIPFILE="%sysfunc(pathname(WORK))\z2.zip"; output;
run;

data WANT(keep=MEMNAME ZIPFILE);
  set HAVE;
  length MEMNAME $200 ;
  RC=filename('inzip',ZIPFILE,'zip');
  if RC then return;
  FID=dopen('inzip');
  if FID=0 then return;
  MEMCOUNT=dnum(FID);
  do I=1 to MEMCOUNT;
    MEMNAME=dread(FID,I);
    output;
  end;
  RC=dclose(FID);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Since you are using file functions, using the filename() function makes more sense than using FILEVAR=.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jul 2018 02:47:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/member-level-reading-in-ZIP-Access-method-doesn-t-work-with/m-p/482335#M124910</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-07-30T02:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: member level reading in ZIP Access method doesn't work with filevar= option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/member-level-reading-in-ZIP-Access-method-doesn-t-work-with/m-p/483609#M125425</link>
      <description>&lt;P&gt;Hi Chris,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you so much!&amp;nbsp; I just gave that a shot.&amp;nbsp; It worked beautifully!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Beats the alternative I used (a series of call executes of a macro).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Much appreciated!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--Ben&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 22:54:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/member-level-reading-in-ZIP-Access-method-doesn-t-work-with/m-p/483609#M125425</guid>
      <dc:creator>BenConner</dc:creator>
      <dc:date>2018-08-02T22:54:22Z</dc:date>
    </item>
  </channel>
</rss>

