<?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 Help with reading files from the folder on Linux in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-reading-files-from-the-folder-on-Linux/m-p/149150#M39388</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to read the files from the folder on Linux using PIPE.&amp;nbsp; There are currently 2 files (ABC_*.zip) in the folder.&amp;nbsp; But when I tried to use the following code but it does not work.&amp;nbsp; What may be wrong in the code? %let extl_dir=/PROD/PGM/;&amp;nbsp;&amp;nbsp; filename zl pipe "ls &amp;amp;extl_dir.ABC_*.zip";&amp;nbsp;&amp;nbsp; data ziplist_a;&amp;nbsp;&amp;nbsp; infile pl&amp;nbsp; end=last;&amp;nbsp;&amp;nbsp; length path $200 zipnm $50 filedt $15;&amp;nbsp;&amp;nbsp; input path $;&amp;nbsp;&amp;nbsp; zipnm=scan(path,-1,"/");&amp;nbsp;&amp;nbsp; filedt=scan(scan(path,-1,"_"),1,".");&amp;nbsp;&amp;nbsp; call symput('zip'||left(_n_), zipnm);&amp;nbsp;&amp;nbsp; call symput('path'||left(_n_), path);&amp;nbsp;&amp;nbsp; call symput('filedt'||left(_n_),filedt);&amp;nbsp;&amp;nbsp; if last then call symput('num_zip',_n_);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run; NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 97:25&amp;nbsp;&amp;nbsp;&amp;nbsp; 98:26&amp;nbsp;&amp;nbsp;&amp;nbsp; 99:28&amp;nbsp;&amp;nbsp;&amp;nbsp; 100:36 NOTE: The infile ZL is:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Unnamed Pipe Access Device,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PROCESS=ls /PROD/PGM/ABC_*.zip,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RECFM=V,LRECL=256 Stderr output: 'ls' is not recognized as an internal or external command, operable program or batch file. NOTE: 0 records were read from the infile PL. NOTE: The data set WORK.ZIPLIST_A has 0 observations and 3 variables. NOTE: DATA statement used (Total process time):&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; 0.07 seconds&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;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Feb 2015 13:56:20 GMT</pubDate>
    <dc:creator>pp2014</dc:creator>
    <dc:date>2015-02-02T13:56:20Z</dc:date>
    <item>
      <title>Help with reading files from the folder on Linux</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-reading-files-from-the-folder-on-Linux/m-p/149150#M39388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to read the files from the folder on Linux using PIPE.&amp;nbsp; There are currently 2 files (ABC_*.zip) in the folder.&amp;nbsp; But when I tried to use the following code but it does not work.&amp;nbsp; What may be wrong in the code? %let extl_dir=/PROD/PGM/;&amp;nbsp;&amp;nbsp; filename zl pipe "ls &amp;amp;extl_dir.ABC_*.zip";&amp;nbsp;&amp;nbsp; data ziplist_a;&amp;nbsp;&amp;nbsp; infile pl&amp;nbsp; end=last;&amp;nbsp;&amp;nbsp; length path $200 zipnm $50 filedt $15;&amp;nbsp;&amp;nbsp; input path $;&amp;nbsp;&amp;nbsp; zipnm=scan(path,-1,"/");&amp;nbsp;&amp;nbsp; filedt=scan(scan(path,-1,"_"),1,".");&amp;nbsp;&amp;nbsp; call symput('zip'||left(_n_), zipnm);&amp;nbsp;&amp;nbsp; call symput('path'||left(_n_), path);&amp;nbsp;&amp;nbsp; call symput('filedt'||left(_n_),filedt);&amp;nbsp;&amp;nbsp; if last then call symput('num_zip',_n_);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run; NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 97:25&amp;nbsp;&amp;nbsp;&amp;nbsp; 98:26&amp;nbsp;&amp;nbsp;&amp;nbsp; 99:28&amp;nbsp;&amp;nbsp;&amp;nbsp; 100:36 NOTE: The infile ZL is:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Unnamed Pipe Access Device,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PROCESS=ls /PROD/PGM/ABC_*.zip,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RECFM=V,LRECL=256 Stderr output: 'ls' is not recognized as an internal or external command, operable program or batch file. NOTE: 0 records were read from the infile PL. NOTE: The data set WORK.ZIPLIST_A has 0 observations and 3 variables. NOTE: DATA statement used (Total process time):&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; 0.07 seconds&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2015 13:56:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-reading-files-from-the-folder-on-Linux/m-p/149150#M39388</guid>
      <dc:creator>pp2014</dc:creator>
      <dc:date>2015-02-02T13:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help with reading files from the folder on Linux</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-reading-files-from-the-folder-on-Linux/m-p/149151#M39389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any Help???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2015 15:00:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-reading-files-from-the-folder-on-Linux/m-p/149151#M39389</guid>
      <dc:creator>pp2014</dc:creator>
      <dc:date>2015-02-02T15:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help with reading files from the folder on Linux</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-reading-files-from-the-folder-on-Linux/m-p/149152#M39390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are on SAS 9.4, then try to leverage the ZIP access method. &lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sascommunity.org/planet/blog/category/filename-zip/" title="http://www.sascommunity.org/planet/blog/category/filename-zip/"&gt; &amp;amp;raquo; FILENAME ZIP&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise, you will have to resort the third party software, here is a good paper:&lt;/P&gt;&lt;P&gt; &lt;A href="http://www2.sas.com/proceedings/sugi31/155-31.pdf" title="http://www2.sas.com/proceedings/sugi31/155-31.pdf"&gt;http://www2.sas.com/proceedings/sugi31/155-31.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good Luck,&lt;/P&gt;&lt;P&gt;Haikuo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2015 15:08:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-reading-files-from-the-folder-on-Linux/m-p/149152#M39390</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2015-02-02T15:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: Help with reading files from the folder on Linux</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Help-with-reading-files-from-the-folder-on-Linux/m-p/149153#M39391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a community, not a free support site. If you need immediate help, hire a consultant.&lt;/P&gt;&lt;P&gt;Also, it's easier to help if you provide logs that are readable. Have them in an attachment if you got problem pasting them into the text input field in the browser.&lt;/P&gt;&lt;P&gt;So how are you executing this code? From a Linux shell command prompt, Enterprise Guide connection, or?&lt;/P&gt;&lt;P&gt;Since it seems you are not executing the pipe in Linux.&lt;/P&gt;&lt;P&gt;To narrow down the problem, test to put the path explicitly in the pipe string (avoid the macro variable). The test the exact same command on a Linux shell prompt.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2015 15:10:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Help-with-reading-files-from-the-folder-on-Linux/m-p/149153#M39391</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-02-02T15:10:07Z</dc:date>
    </item>
  </channel>
</rss>

