<?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 DREAD fails for filename ZIP with note &amp;quot;List Handle Creation Failed&amp;quot; in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/DREAD-fails-for-filename-ZIP-with-note-quot-List-Handle-Creation/m-p/741943#M232008</link>
    <description>&lt;P&gt;We have a bunch of ZIP file import programs that run via a scheduled task on a Windows server. These have been running fine for years. Recently, one or two files--always the same ones--fail to import. The issue seems to be that DREAD does not detect a file in the ZIP. There is always 1 file in the ZIP.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If we run the program manually, it works fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Step that fails:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename inzip zip "&amp;amp;ziploc";

data contents(keep=memname);
length memname $8.;
fid=dopen("inzip");
memname=dread(fid,1);
output;
rc=dclose(fid);
call symputx('filename',memname);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Log:&lt;/P&gt;
&lt;PRE&gt;76         data contents(keep=memname);
77         length memname $8.;
78         fid=dopen("inzip");
79         memname=dread(fid,1);
80         output;
81         rc=dclose(fid);
82         call symputx('filename',memname);
83         run;

NOTE: Compression was disabled for data set WORK.CONTENTS because compression overhead would increase the size of the data set.
NOTE: List Handle Creation Failed.
NOTE: Argument 1 to function DREAD(0,1) at line 79 column 9 is invalid.
memname=  fid=0 rc=70021 _ERROR_=1 _N_=1
NOTE: The data set WORK.CONTENTS has 1 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I haven't been able to find anything useful about this issue. Any help is appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 May 2021 18:00:33 GMT</pubDate>
    <dc:creator>Mike_B</dc:creator>
    <dc:date>2021-05-17T18:00:33Z</dc:date>
    <item>
      <title>DREAD fails for filename ZIP with note "List Handle Creation Failed"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DREAD-fails-for-filename-ZIP-with-note-quot-List-Handle-Creation/m-p/741943#M232008</link>
      <description>&lt;P&gt;We have a bunch of ZIP file import programs that run via a scheduled task on a Windows server. These have been running fine for years. Recently, one or two files--always the same ones--fail to import. The issue seems to be that DREAD does not detect a file in the ZIP. There is always 1 file in the ZIP.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If we run the program manually, it works fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Step that fails:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename inzip zip "&amp;amp;ziploc";

data contents(keep=memname);
length memname $8.;
fid=dopen("inzip");
memname=dread(fid,1);
output;
rc=dclose(fid);
call symputx('filename',memname);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Log:&lt;/P&gt;
&lt;PRE&gt;76         data contents(keep=memname);
77         length memname $8.;
78         fid=dopen("inzip");
79         memname=dread(fid,1);
80         output;
81         rc=dclose(fid);
82         call symputx('filename',memname);
83         run;

NOTE: Compression was disabled for data set WORK.CONTENTS because compression overhead would increase the size of the data set.
NOTE: List Handle Creation Failed.
NOTE: Argument 1 to function DREAD(0,1) at line 79 column 9 is invalid.
memname=  fid=0 rc=70021 _ERROR_=1 _N_=1
NOTE: The data set WORK.CONTENTS has 1 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I haven't been able to find anything useful about this issue. Any help is appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 May 2021 18:00:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DREAD-fails-for-filename-ZIP-with-note-quot-List-Handle-Creation/m-p/741943#M232008</guid>
      <dc:creator>Mike_B</dc:creator>
      <dc:date>2021-05-17T18:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: DREAD fails for filename ZIP with note "List Handle Creation Failed"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DREAD-fails-for-filename-ZIP-with-note-quot-List-Handle-Creation/m-p/741960#M232016</link>
      <description>&lt;P&gt;Hi &lt;A class="trigger-hovercard" style="color: #007dc3;" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/97807" target="_blank" rel="noopener"&gt;Mike_B&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;It seems that your macro variable &amp;amp;ziploc does not resolve correctly. Can you run your code with option&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options symbolgen;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to see its value and make sure the file defined by that macro variable exists?&lt;/P&gt;</description>
      <pubDate>Mon, 17 May 2021 19:05:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DREAD-fails-for-filename-ZIP-with-note-quot-List-Handle-Creation/m-p/741960#M232016</guid>
      <dc:creator>LeonidBatkhan</dc:creator>
      <dc:date>2021-05-17T19:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: DREAD fails for filename ZIP with note "List Handle Creation Failed"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DREAD-fails-for-filename-ZIP-with-note-quot-List-Handle-Creation/m-p/741964#M232017</link>
      <description>My apologies. I omitted that part of the log. Symbolgen was on and the macro variable resolved to the correct file.&lt;BR /&gt;&lt;BR /&gt;72         filename inzip&lt;BR /&gt;SYMBOLGEN:  Macro variable ZIPLOC resolves to \\SERVERNAME\DIRECTORY\FILENAME.ZIP&lt;BR /&gt;72       !                zip "&amp;amp;ziploc";&lt;BR /&gt;73</description>
      <pubDate>Mon, 17 May 2021 19:23:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DREAD-fails-for-filename-ZIP-with-note-quot-List-Handle-Creation/m-p/741964#M232017</guid>
      <dc:creator>Mike_B</dc:creator>
      <dc:date>2021-05-17T19:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: DREAD fails for filename ZIP with note "List Handle Creation Failed"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DREAD-fails-for-filename-ZIP-with-note-quot-List-Handle-Creation/m-p/741965#M232018</link>
      <description>&lt;P&gt;From your log it looks like the DOPEN() is failing since it returned 0 as the file id.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most likely some issue with accessing the network file from that share name.&lt;/P&gt;
&lt;P&gt;Are you SAS jobs always running on the same server? Same user?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there some type of back up service running at the same time that might lock the file and keep SAS from opening it?&lt;/P&gt;</description>
      <pubDate>Mon, 17 May 2021 19:29:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DREAD-fails-for-filename-ZIP-with-note-quot-List-Handle-Creation/m-p/741965#M232018</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-05-17T19:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: DREAD fails for filename ZIP with note "List Handle Creation Failed"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DREAD-fails-for-filename-ZIP-with-note-quot-List-Handle-Creation/m-p/741966#M232019</link>
      <description>&lt;P&gt;Can you try specifying the member name as well?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename inzip zip "&amp;amp;ziploc" member="filename.extension";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 May 2021 19:32:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DREAD-fails-for-filename-ZIP-with-note-quot-List-Handle-Creation/m-p/741966#M232019</guid>
      <dc:creator>LeonidBatkhan</dc:creator>
      <dc:date>2021-05-17T19:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: DREAD fails for filename ZIP with note "List Handle Creation Failed"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DREAD-fails-for-filename-ZIP-with-note-quot-List-Handle-Creation/m-p/741976#M232021</link>
      <description>&lt;P&gt;Leonid, unfortunately the name of the file inside the ZIP is unpredictable which is why we are using DREAD() to get the name and store it inside a macro variable which we can then use with an infile/inzip statement.&lt;/P&gt;</description>
      <pubDate>Mon, 17 May 2021 20:02:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DREAD-fails-for-filename-ZIP-with-note-quot-List-Handle-Creation/m-p/741976#M232021</guid>
      <dc:creator>Mike_B</dc:creator>
      <dc:date>2021-05-17T20:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: DREAD fails for filename ZIP with note "List Handle Creation Failed"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DREAD-fails-for-filename-ZIP-with-note-quot-List-Handle-Creation/m-p/741978#M232022</link>
      <description>&lt;P&gt;Are you looking for a specific file in the ZIP? Or do you want to read everything that is there?&lt;/P&gt;
&lt;P&gt;If the later just use member='*';&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let fname=%sysfunc(pathname(work))/test.zip;

data _null_;
  file "&amp;amp;fname" zip member='file1';
  put 'hello';
run;

data _null_;
  infile "&amp;amp;fname" zip member='*';
  input ;
  put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You will probably still get errors for the files you could not open before, but now your code is simpler.&lt;/P&gt;</description>
      <pubDate>Mon, 17 May 2021 20:10:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DREAD-fails-for-filename-ZIP-with-note-quot-List-Handle-Creation/m-p/741978#M232022</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-05-17T20:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: DREAD fails for filename ZIP with note "List Handle Creation Failed"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DREAD-fails-for-filename-ZIP-with-note-quot-List-Handle-Creation/m-p/741982#M232024</link>
      <description>&lt;P&gt;Tom&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The scheduled task is always with the same user's credentials and on the same server. The file is on the same server as the scheduled task and SAS 9.4m7 install. There is a backup that occurs the same day the scheduled task runs, but I don't know when that happens.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I looked at the event log and saw 2 possible issues around the time the SAS program ran. However, these two events show up almost every day multiple times a day and don't seem to cause any noticeable problems the rest of the time, so I doubt they are related.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Event 1530: some kind of "user handles leaked" issue involving sas.exe.&lt;/LI&gt;
&lt;LI&gt;Event 2003 - which says "event ID 2003 from source SASPERF cannot be found."&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Mon, 17 May 2021 20:15:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DREAD-fails-for-filename-ZIP-with-note-quot-List-Handle-Creation/m-p/741982#M232024</guid>
      <dc:creator>Mike_B</dc:creator>
      <dc:date>2021-05-17T20:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: DREAD fails for filename ZIP with note "List Handle Creation Failed"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DREAD-fails-for-filename-ZIP-with-note-quot-List-Handle-Creation/m-p/741989#M232025</link>
      <description>Tom, I will give the member='*' approach a try and see what happens. I am always game for simplifying a program.</description>
      <pubDate>Mon, 17 May 2021 20:21:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DREAD-fails-for-filename-ZIP-with-note-quot-List-Handle-Creation/m-p/741989#M232025</guid>
      <dc:creator>Mike_B</dc:creator>
      <dc:date>2021-05-17T20:21:22Z</dc:date>
    </item>
  </channel>
</rss>

