<?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 Zip file from location with wildcard in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Import-Zip-file-from-location-with-wildcard/m-p/623125#M19886</link>
    <description>&lt;P&gt;You need to find the name in some other way.&lt;/P&gt;
&lt;P&gt;Here is one way to find the first filename that matches your pattern and put it into a macro variable:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  length fname $256 ;
  infile "....\*-RestOfFileZipName.zip" filename=fname obs=1 ;
  input;
  call symputx('zipfile',fname);
run;  &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;then use the macro variable in your existing FILENAME statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename x zip "&amp;amp;zipfile" member = "CSVToImport*.csv";
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 07 Feb 2020 17:32:10 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2020-02-07T17:32:10Z</dc:date>
    <item>
      <title>Import Zip file from location with wildcard</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-Zip-file-from-location-with-wildcard/m-p/623112#M19885</link>
      <description>&lt;P&gt;Hello all&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried to create an import statement that reads in a zip file with a wildcard in the zipfile name, much like text and csv files&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename x zip ".....\%%%%%%%%-RestOfFileZipName.zip" member = "CSVToImport*.csv";



data fileout;
   infile x
   firstobs = 1 
   dsd dlm = ',' 
   truncover
   ;
      var1   :8.
      var2   :8.
      ;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;where I've put the "%" is where I expect to have the wildcard to import the zip, like I said I'd like it to work the same way the " * " wildcard works with the member. Has anyone done this before, can you advise if this is even possible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS, using SAS 9.4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 16:47:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-Zip-file-from-location-with-wildcard/m-p/623112#M19885</guid>
      <dc:creator>Nahidul</dc:creator>
      <dc:date>2020-02-07T16:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: Import Zip file from location with wildcard</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-Zip-file-from-location-with-wildcard/m-p/623125#M19886</link>
      <description>&lt;P&gt;You need to find the name in some other way.&lt;/P&gt;
&lt;P&gt;Here is one way to find the first filename that matches your pattern and put it into a macro variable:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  length fname $256 ;
  infile "....\*-RestOfFileZipName.zip" filename=fname obs=1 ;
  input;
  call symputx('zipfile',fname);
run;  &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;then use the macro variable in your existing FILENAME statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename x zip "&amp;amp;zipfile" member = "CSVToImport*.csv";
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Feb 2020 17:32:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-Zip-file-from-location-with-wildcard/m-p/623125#M19886</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-02-07T17:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: Import Zip file from location with wildcard</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-Zip-file-from-location-with-wildcard/m-p/623540#M19944</link>
      <description>Thanks Tom, that's exactly what I was looking for!</description>
      <pubDate>Mon, 10 Feb 2020 10:38:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-Zip-file-from-location-with-wildcard/m-p/623540#M19944</guid>
      <dc:creator>Nahidul</dc:creator>
      <dc:date>2020-02-10T10:38:03Z</dc:date>
    </item>
  </channel>
</rss>

