<?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 X Statement, Call System and Named Pipe in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/X-Statement-Call-System-and-Named-Pipe/m-p/70553#M15265</link>
    <description>I realize that all three options can allow a SAS user to pass system command to the operating system for execution. I wonder the differences among three methods and their pros and cons. &lt;BR /&gt;
&lt;BR /&gt;
I normally use named pipe to redirect the results as the source of the infile. But, I usually use X (anywhere in SAS) and Call System in the data step. &lt;BR /&gt;
&lt;BR /&gt;
But, I saw people use named pipe to execute "DEL" commaind in Windows insead using X command.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for the help!</description>
    <pubDate>Tue, 07 Sep 2010 15:44:45 GMT</pubDate>
    <dc:creator>ReilingLee</dc:creator>
    <dc:date>2010-09-07T15:44:45Z</dc:date>
    <item>
      <title>X Statement, Call System and Named Pipe</title>
      <link>https://communities.sas.com/t5/SAS-Programming/X-Statement-Call-System-and-Named-Pipe/m-p/70553#M15265</link>
      <description>I realize that all three options can allow a SAS user to pass system command to the operating system for execution. I wonder the differences among three methods and their pros and cons. &lt;BR /&gt;
&lt;BR /&gt;
I normally use named pipe to redirect the results as the source of the infile. But, I usually use X (anywhere in SAS) and Call System in the data step. &lt;BR /&gt;
&lt;BR /&gt;
But, I saw people use named pipe to execute "DEL" commaind in Windows insead using X command.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for the help!</description>
      <pubDate>Tue, 07 Sep 2010 15:44:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/X-Statement-Call-System-and-Named-Pipe/m-p/70553#M15265</guid>
      <dc:creator>ReilingLee</dc:creator>
      <dc:date>2010-09-07T15:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: X Statement, Call System and Named Pipe</title>
      <link>https://communities.sas.com/t5/SAS-Programming/X-Statement-Call-System-and-Named-Pipe/m-p/70554#M15266</link>
      <description>And there would also be SYSTASK() and %SYSTASK() which I like especially under UNIX as it allows you to choose the shell.

Message was edited by: Patrick</description>
      <pubDate>Tue, 07 Sep 2010 19:00:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/X-Statement-Call-System-and-Named-Pipe/m-p/70554#M15266</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2010-09-07T19:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: X Statement, Call System and Named Pipe</title>
      <link>https://communities.sas.com/t5/SAS-Programming/X-Statement-Call-System-and-Named-Pipe/m-p/70555#M15267</link>
      <description>I think that the biggest differences bewteen the two are that, with a pipe, you can communicate both ways bewteen SAS and the program or call you are executing.&lt;BR /&gt;
&lt;BR /&gt;
A nice summary of possible uses of pipes can be found in the following SGF paper:&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/forum2008/092-2008.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/forum2008/092-2008.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Pipes are also nice in that you don't have to change your system options like noxwait, xsync, etc.&lt;BR /&gt;
&lt;BR /&gt;
However, when you don't have to communicate both ways, they require an extra step in that you have to first declare them, and then use them.&lt;BR /&gt;
&lt;BR /&gt;
HTH,&lt;BR /&gt;
Art</description>
      <pubDate>Tue, 07 Sep 2010 19:00:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/X-Statement-Call-System-and-Named-Pipe/m-p/70555#M15267</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2010-09-07T19:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: X Statement, Call System and Named Pipe</title>
      <link>https://communities.sas.com/t5/SAS-Programming/X-Statement-Call-System-and-Named-Pipe/m-p/70556#M15268</link>
      <description>I took a quick look at the paper. I see the benefits using named pipe in Example 1, 2, and 3 because the substep reads the results and processes them. &lt;BR /&gt;
&lt;BR /&gt;
In example 4, does it have any benefits over X statement?</description>
      <pubDate>Thu, 09 Sep 2010 15:35:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/X-Statement-Call-System-and-Named-Pipe/m-p/70556#M15268</guid>
      <dc:creator>ReilingLee</dc:creator>
      <dc:date>2010-09-09T15:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: X Statement, Call System and Named Pipe</title>
      <link>https://communities.sas.com/t5/SAS-Programming/X-Statement-Call-System-and-Named-Pipe/m-p/70557#M15269</link>
      <description>Indeed there is little difference when a command like MKDIR is executed through a PIPE.&lt;BR /&gt;
&lt;BR /&gt;
Using a pipe might be preferred over X as X may cause a DOS box to pop up.  There are options for that but with PIPE you don't need them.&lt;BR /&gt;
&lt;BR /&gt;
You might also consider using the DCREATE function for directory creation.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
x "mkdir test%sysfunc(left(%sysfunc(datetime(),16.3)))";&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
   length command $128;&lt;BR /&gt;
   command = cats('mkdir test',put(datetime(),16.3-L));&lt;BR /&gt;
   infile dummy pipe filevar=command;&lt;BR /&gt;
   run;&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
   path = dcreate(cats('test',put(datetime(),16.3-L),'.'));&lt;BR /&gt;
   putlog 'NOTE: ' PATH=;&lt;BR /&gt;
   run;&lt;BR /&gt;
[pre]</description>
      <pubDate>Fri, 10 Sep 2010 15:18:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/X-Statement-Call-System-and-Named-Pipe/m-p/70557#M15269</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2010-09-10T15:18:43Z</dc:date>
    </item>
  </channel>
</rss>

