<?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: SAS in Unix: X Command in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-in-Unix-X-Command/m-p/292085#M60566</link>
    <description>&lt;P&gt;Another option would be to use SAS external file functions.&lt;/P&gt;
&lt;P&gt;May require some more&amp;nbsp;programming lines the the shell counterpart, but you'll keep all logic in SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yet another option is to first call your shell script, then call SAS with your SAS program,&amp;nbsp;avoiding the OS call from within SAS.&lt;/P&gt;</description>
    <pubDate>Wed, 17 Aug 2016 07:52:43 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2016-08-17T07:52:43Z</dc:date>
    <item>
      <title>SAS in Unix: X Command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-in-Unix-X-Command/m-p/291738#M60439</link>
      <description>&lt;P&gt;I was able to succesfully count the number of files in the New Folder in unix shell and output it to My SAS files folder&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;cd H:\My_SAS_Files\New_Folder&lt;/P&gt;&lt;P&gt;count='ls | wc -w'&lt;/P&gt;&lt;P&gt;{ echo -n 'Number of Files is ' &amp;amp; eval "$count"; } &amp;gt;&amp;gt; H:\My_SAS_Files\output&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To Check Number of Files:&lt;/P&gt;&lt;P&gt;cd ..&lt;/P&gt;&lt;P&gt;tail output&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to execute this in SAS to encoperate a loop and some macros, but I'm not sure how to get the X comamnd to work. Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;X "cd H:\My_SAS_Files\New_Folder";&lt;BR /&gt;X "count='ls | wc -w'";&lt;BR /&gt;X "{ echo -n 'Number of Files is ' &amp;amp; eval "$count"; } &amp;gt;&amp;gt; H:\My_SAS_Files\output";&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2016 18:17:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-in-Unix-X-Command/m-p/291738#M60439</guid>
      <dc:creator>krueg314</dc:creator>
      <dc:date>2016-08-15T18:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS in Unix: X Command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-in-Unix-X-Command/m-p/291746#M60444</link>
      <description>&lt;P&gt;Unix is not going to be able to find any files on a directory name that starts with H:.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I find is is easier to code using a DATA _NULL_ and the PIPE engine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let path=/mydirectory ;

data file_count;
  infile "cd &amp;amp;path ; ls -A | wc -l" pipe;
  path="&amp;amp;path";
  input files;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Aug 2016 18:45:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-in-Unix-X-Command/m-p/291746#M60444</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-08-15T18:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: SAS in Unix: X Command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-in-Unix-X-Command/m-p/291800#M60474</link>
      <description>&lt;PRE&gt;
Make a Shell file  xx.sh and put all the command into it ,execute it at SAS side:

X '/home/xx.sh' ;

&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Aug 2016 01:49:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-in-Unix-X-Command/m-p/291800#M60474</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-08-16T01:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: SAS in Unix: X Command</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-in-Unix-X-Command/m-p/292085#M60566</link>
      <description>&lt;P&gt;Another option would be to use SAS external file functions.&lt;/P&gt;
&lt;P&gt;May require some more&amp;nbsp;programming lines the the shell counterpart, but you'll keep all logic in SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yet another option is to first call your shell script, then call SAS with your SAS program,&amp;nbsp;avoiding the OS call from within SAS.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2016 07:52:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-in-Unix-X-Command/m-p/292085#M60566</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-08-17T07:52:43Z</dc:date>
    </item>
  </channel>
</rss>

