<?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: Systask return code in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Systask-return-code/m-p/651296#M195400</link>
    <description>Thanks Chris...Can I have an example please???</description>
    <pubDate>Thu, 28 May 2020 06:41:50 GMT</pubDate>
    <dc:creator>helannivas88</dc:creator>
    <dc:date>2020-05-28T06:41:50Z</dc:date>
    <item>
      <title>Systask return code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Systask-return-code/m-p/651146#M195328</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Hi,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;I have a systask command running in SAS EG where I'm launching a DB2 clpplus inside that. Below is the command&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;systask command "echo 'password' | clpplus -nw user@dsn @/home/test.sql"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;NOWAIT STATUS=T1_RC TASKNAME=T1_TASK SHELL="bash";&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;WAITFOR T1_TASK;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;%PUT NOTE: RC = &amp;amp;T1_RC;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;The above command is exactly correct and if I run , I'm getting the output what Im expecting and T1_RC ouput as 0.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Even when I had the wrong password in the command, the sas logs shows me as Invalid password. But still the return code is zero. Im not able to differentiate success/ failure with this return code.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;IS there any other way to capture the return code from systask command?? Please let me know&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Thanks&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2020 17:06:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Systask-return-code/m-p/651146#M195328</guid>
      <dc:creator>helannivas88</dc:creator>
      <dc:date>2020-05-27T17:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: Systask return code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Systask-return-code/m-p/651289#M195396</link>
      <description>&lt;P&gt;The return code informs you about the success of the command.&lt;/P&gt;
&lt;P&gt;The echo command doesn't fail, and the RC correctly tells you that.&lt;/P&gt;
&lt;P&gt;You might want to use the pipe engine to run the command, and look at the OS output to assess the result.&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2020 05:26:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Systask-return-code/m-p/651289#M195396</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-05-28T05:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: Systask return code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Systask-return-code/m-p/651296#M195400</link>
      <description>Thanks Chris...Can I have an example please???</description>
      <pubDate>Thu, 28 May 2020 06:41:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Systask-return-code/m-p/651296#M195400</guid>
      <dc:creator>helannivas88</dc:creator>
      <dc:date>2020-05-28T06:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Systask return code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Systask-return-code/m-p/651581#M195506</link>
      <description>&lt;P&gt;Maybe something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename CMD pipe&amp;nbsp;&amp;nbsp;"echo 'password' | clpplus -nw user@dsn @/home/test.sql";
data _null_;
&amp;nbsp; infile CMD;
&amp;nbsp; input;
&amp;nbsp; putlog _INFILE_ ;
  *if _INFILE_ = .. .then ...; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2020 23:06:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Systask-return-code/m-p/651581#M195506</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-05-28T23:06:51Z</dc:date>
    </item>
  </channel>
</rss>

