<?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: How do I obtain diagnostic info from an executed OS command (that failed) in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/How-do-I-obtain-diagnostic-info-from-an-executed-OS-command-that/m-p/545440#M7277</link>
    <description>&lt;P&gt;In addition to infile pipe, use&lt;/P&gt;
&lt;PRE&gt;2&amp;gt;&amp;amp;1&lt;/PRE&gt;
&lt;P&gt;at the end of the command string to redirect stderr to stdout, so that&amp;nbsp;&lt;EM&gt;all&lt;/EM&gt; messages/responses end up in the SAS log.&lt;/P&gt;</description>
    <pubDate>Sat, 23 Mar 2019 06:11:38 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-03-23T06:11:38Z</dc:date>
    <item>
      <title>How do I obtain diagnostic info from an executed OS command (that failed)</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-do-I-obtain-diagnostic-info-from-an-executed-OS-command-that/m-p/545390#M7272</link>
      <description>&lt;P&gt;I am trying to create a job in DI Studio that runs an OS command via the X statement.&lt;/P&gt;&lt;P&gt;For troubleshooting purposes, I need access to the return value from the OS, or the output from the execution, or something that would indicate if it is failing and why.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For simplicity's sake, suppose I had the following code (in the 'pre-code') tab.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;x echo $(date) &amp;gt;&amp;gt;RunLog.txt ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and there was a permissions issue with the output file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I obtain error information from the 'x' command?&amp;nbsp; Or hopefully anything that would have gone to the console or error device.&lt;/P&gt;&lt;P&gt;I realize that control is passing temporarily out of SAS's control, so maybe nothing is possible, but I figured it's worth asking about.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, the command may need to have quotes around it, but in either case, the job runs successfully (I.E. no error from DI Studio's point of view), but the command was never executed.&lt;/P&gt;&lt;P&gt;I'm on Studio V4.902&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2019 22:14:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-do-I-obtain-diagnostic-info-from-an-executed-OS-command-that/m-p/545390#M7272</guid>
      <dc:creator>JereNeal</dc:creator>
      <dc:date>2019-03-22T22:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: How do I obtain diagnostic info from an executed OS command (that failed)</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-do-I-obtain-diagnostic-info-from-an-executed-OS-command-that/m-p/545395#M7273</link>
      <description>&lt;P&gt;I never use the X command in production SAS code.&lt;/P&gt;
&lt;P&gt;Use a data step with a PIPE.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  infile "x echo $(date) &amp;gt;&amp;gt;RunLog.txt" pipe;
   input;
  put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 23 Mar 2019 00:22:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-do-I-obtain-diagnostic-info-from-an-executed-OS-command-that/m-p/545395#M7273</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-03-23T00:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I obtain diagnostic info from an executed OS command (that failed)</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-do-I-obtain-diagnostic-info-from-an-executed-OS-command-that/m-p/545440#M7277</link>
      <description>&lt;P&gt;In addition to infile pipe, use&lt;/P&gt;
&lt;PRE&gt;2&amp;gt;&amp;amp;1&lt;/PRE&gt;
&lt;P&gt;at the end of the command string to redirect stderr to stdout, so that&amp;nbsp;&lt;EM&gt;all&lt;/EM&gt; messages/responses end up in the SAS log.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Mar 2019 06:11:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-do-I-obtain-diagnostic-info-from-an-executed-OS-command-that/m-p/545440#M7277</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-03-23T06:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I obtain diagnostic info from an executed OS command (that failed)</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-do-I-obtain-diagnostic-info-from-an-executed-OS-command-that/m-p/545895#M7290</link>
      <description>&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;Thank you for the reply.&amp;nbsp; As it turns out, because I was unaware that SAS Studio is a different product than SAS DI Studio, I have posted to the wrong forum, but your answer is probably just as applicable for DI Studio.&amp;nbsp; If you would not use the X command in prod, then perhaps it's a rule I would want to follow as well, so can you let me know why you choose not to use it?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 16:56:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-do-I-obtain-diagnostic-info-from-an-executed-OS-command-that/m-p/545895#M7290</guid>
      <dc:creator>JereNeal</dc:creator>
      <dc:date>2019-03-25T16:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I obtain diagnostic info from an executed OS command (that failed)</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-do-I-obtain-diagnostic-info-from-an-executed-OS-command-that/m-p/545898#M7291</link>
      <description>Because it does not give you any control over where the outputs from the command go.&lt;BR /&gt;</description>
      <pubDate>Mon, 25 Mar 2019 17:04:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-do-I-obtain-diagnostic-info-from-an-executed-OS-command-that/m-p/545898#M7291</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-03-25T17:04:22Z</dc:date>
    </item>
  </channel>
</rss>

