<?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 Understnading for &amp;amp;SYSRC in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Understnading-for-amp-SYSRC/m-p/588205#M168075</link>
    <description>&lt;P&gt;I would like to capture the status of data step or proc step in one variable. In order to do that first I'm trying to make use of the automatic macro variable &amp;amp;SYSRC.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the below example (see line number 4851), there is a warning and so I would like to see the respective return code instead of 0 (indicates successful run without any warning/error). Am I doing something wrong?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;4840       /*Solution Component Name derivation*/
4841       if find("&amp;amp;etls_jobName","_INPUT_",'_') &amp;gt; 0
4842       then SOLN_CMPNT_NM= "DATA IMPORT";
4843       else if find("&amp;amp;etls_jobName","_EXPORT_") &amp;gt; 0
4844       then SOLN_CMPNT_NM = "DATA EXPORT" ;
4845       else if find("&amp;amp;etls_jobName","_LOA_") &amp;gt; 0
4846       then SOLN_CMPNT_NM = "DATA LOADER" ;
4847       else if find("&amp;amp;etls_jobName","_TRA_") &amp;gt; 0
4848       then SOLN_CMPNT_NM = "DATA TRANSER" ;
4849       else SOLN_CMPNT_NM = "OTHER" ;
4850       /*Job return code*/
4851       %PUT &amp;amp;SYSRC.;
0
4852       run;

WARNING: In a call to the FIND function or routine, the modifier "_" not valid.
NOTE: There were 1 observations read from the data set WORK.VARS.
NOTE: The data set WORK.METADATA has 1 observations and 10 variables.&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 12 Sep 2019 13:05:36 GMT</pubDate>
    <dc:creator>Babloo</dc:creator>
    <dc:date>2019-09-12T13:05:36Z</dc:date>
    <item>
      <title>Understnading for &amp;SYSRC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understnading-for-amp-SYSRC/m-p/588205#M168075</link>
      <description>&lt;P&gt;I would like to capture the status of data step or proc step in one variable. In order to do that first I'm trying to make use of the automatic macro variable &amp;amp;SYSRC.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the below example (see line number 4851), there is a warning and so I would like to see the respective return code instead of 0 (indicates successful run without any warning/error). Am I doing something wrong?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;4840       /*Solution Component Name derivation*/
4841       if find("&amp;amp;etls_jobName","_INPUT_",'_') &amp;gt; 0
4842       then SOLN_CMPNT_NM= "DATA IMPORT";
4843       else if find("&amp;amp;etls_jobName","_EXPORT_") &amp;gt; 0
4844       then SOLN_CMPNT_NM = "DATA EXPORT" ;
4845       else if find("&amp;amp;etls_jobName","_LOA_") &amp;gt; 0
4846       then SOLN_CMPNT_NM = "DATA LOADER" ;
4847       else if find("&amp;amp;etls_jobName","_TRA_") &amp;gt; 0
4848       then SOLN_CMPNT_NM = "DATA TRANSER" ;
4849       else SOLN_CMPNT_NM = "OTHER" ;
4850       /*Job return code*/
4851       %PUT &amp;amp;SYSRC.;
0
4852       run;

WARNING: In a call to the FIND function or routine, the modifier "_" not valid.
NOTE: There were 1 observations read from the data set WORK.VARS.
NOTE: The data set WORK.METADATA has 1 observations and 10 variables.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Sep 2019 13:05:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understnading-for-amp-SYSRC/m-p/588205#M168075</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2019-09-12T13:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Understnading for &amp;SYSRC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understnading-for-amp-SYSRC/m-p/588208#M168076</link>
      <description>&lt;P&gt;Why are you putting the vlaue of the macro variable before the data step has started running?&lt;/P&gt;
&lt;P&gt;Your %PUT is displaying the value of SYSRC from before the data step has even been compiler.&lt;/P&gt;
&lt;P&gt;Since the macro processor finishes with the code before it is passed to the compiler and so before the data step runs you ran this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put &amp;amp;sysrc;
data ....;
 ...
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Sep 2019 13:10:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understnading-for-amp-SYSRC/m-p/588208#M168076</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-09-12T13:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: Understnading for &amp;SYSRC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understnading-for-amp-SYSRC/m-p/588215#M168080</link>
      <description>&lt;P&gt;I ran the code as per your instruction but still I'm getting the return code as 0 for the program which had warning.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;2097       %PUT &amp;amp;SYSRC;
0
2098       /*derive operationl metadata*/
2099       data metadata;
2100       set vars;
2101       /*Solution Component Name derivation*/
2102       if find("&amp;amp;etls_jobName","_INPUT_",'_') &amp;gt; 0
2103       then SOLN_CMPNT_NM= "DATA IMPORT";
2104       else if find("&amp;amp;etls_jobName","_EXPORT_") &amp;gt; 0
2105       then SOLN_CMPNT_NM = "DATA EXPORT" ;
2106       else if find("&amp;amp;etls_jobName","_LOA_") &amp;gt; 0
2107       then SOLN_CMPNT_NM = "DATA LOADER" ;
2108       else if find("&amp;amp;etls_jobName","_TRA_") &amp;gt; 0
2109       then SOLN_CMPNT_NM = "DATA TRANSER" ;
2110       else SOLN_CMPNT_NM = "OTHER" ;
2111       /*Job return code*/
2112       /*%PUT &amp;amp;SYSRC.;*/
2113       run;

WARNING: In a call to the FIND function or routine, the modifier "_" not valid.
NOTE: There were 1 observations read from the data set WORK.VARS.
NOTE: The data set WORK.METADATA has 1 observations and 10 variables&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Sep 2019 13:32:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understnading-for-amp-SYSRC/m-p/588215#M168080</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2019-09-12T13:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: Understnading for</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understnading-for-amp-SYSRC/m-p/588219#M168081</link>
      <description>&lt;P&gt;Why are you still writing the value from before the step.&lt;BR /&gt;What value does SYSRC have AFTER the data step is run?&lt;BR /&gt;Are you sure that DATA steps even change the value of SYSRC?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;730   %let sysrc=0;
731   %put &amp;amp;=sysrc;
SYsrc=0
732   data x;
733    This is not valid SAS code;
       ----
       180
ERROR 180-322: Statement is not valid or it is used out of proper order.

734   run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.X may be incomplete.  When this step was stopped there were 0 observations and
         0 variables.
WARNING: Data set WORK.X was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds


735   %put &amp;amp;sysrc;
0
736
737   %let sysrc=0;
738   %put &amp;amp;=sysrc;
SYsrc=0
739   data x;
740    impossible=1/0;
NOTE: Division by zero detected during the compilation phase, detected at line 740 column 14.
741   run;

NOTE: The data set WORK.X has 1 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


742   %put &amp;amp;sysrc;
0
&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Sep 2019 13:42:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understnading-for-amp-SYSRC/m-p/588219#M168081</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-09-12T13:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Understnading for &amp;SYSRC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understnading-for-amp-SYSRC/m-p/588221#M168082</link>
      <description>&lt;P&gt;SYSRC have value as 0 even&amp;nbsp;after the data step has ran with warnings. Value is not changing even &amp;amp;sysrc is placed before,after or in the program. Could you please help me understand with one example?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 13:44:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understnading-for-amp-SYSRC/m-p/588221#M168082</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2019-09-12T13:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Understnading for</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understnading-for-amp-SYSRC/m-p/588223#M168083</link>
      <description>&lt;P&gt;Even in your example value of &amp;amp;sysrc has not changed and it is suppose to change after the line number 735 in your log&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 13:46:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understnading-for-amp-SYSRC/m-p/588223#M168083</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2019-09-12T13:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: Understnading for &amp;SYSRC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understnading-for-amp-SYSRC/m-p/588227#M168085</link>
      <description>&lt;P&gt;I don't think that data steps change SYSRC.&amp;nbsp; Try looking at SYSERR instead.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 13:48:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understnading-for-amp-SYSRC/m-p/588227#M168085</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-09-12T13:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: Understnading for</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understnading-for-amp-SYSRC/m-p/588236#M168089</link>
      <description>Even it is also not changing from default value 0&lt;BR /&gt;</description>
      <pubDate>Thu, 12 Sep 2019 13:55:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understnading-for-amp-SYSRC/m-p/588236#M168089</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2019-09-12T13:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: Understnading for</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understnading-for-amp-SYSRC/m-p/588269#M168100</link>
      <description>&lt;P&gt;I think there is another new system option that will force SAS to treat WARNING message, like in your posted example, as ERROR messages.&amp;nbsp; You might try that and see if it changes whether SYSERR is changed or not.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 14:35:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understnading-for-amp-SYSRC/m-p/588269#M168100</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-09-12T14:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: Understnading for</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understnading-for-amp-SYSRC/m-p/588272#M168101</link>
      <description>I never heard of that new system option. If you could recall that option&lt;BR /&gt;please let me know.&lt;BR /&gt;</description>
      <pubDate>Thu, 12 Sep 2019 14:43:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understnading-for-amp-SYSRC/m-p/588272#M168101</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2019-09-12T14:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: Understnading for &amp;SYSRC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understnading-for-amp-SYSRC/m-p/588442#M168180</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I would like to capture the status of data step or proc step in one variable. In order to do that first I'm trying to make use of the automatic macro variable &amp;amp;SYSRC.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the below example (see line number 4851), there is a warning and so I would like to see the respective return code instead of 0 (indicates successful run without any warning/error). Am I doing something wrong?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;4840       /*Solution Component Name derivation*/
4841       if find("&amp;amp;etls_jobName","_INPUT_",'_') &amp;gt; 0
4842       then SOLN_CMPNT_NM= "DATA IMPORT";
4843       else if find("&amp;amp;etls_jobName","_EXPORT_") &amp;gt; 0
4844       then SOLN_CMPNT_NM = "DATA EXPORT" ;
4845       else if find("&amp;amp;etls_jobName","_LOA_") &amp;gt; 0
4846       then SOLN_CMPNT_NM = "DATA LOADER" ;
4847       else if find("&amp;amp;etls_jobName","_TRA_") &amp;gt; 0
4848       then SOLN_CMPNT_NM = "DATA TRANSER" ;
4849       else SOLN_CMPNT_NM = "OTHER" ;
4850       /*Job return code*/
4851       %PUT &amp;amp;SYSRC.;
0
4852       run;

WARNING: In a call to the FIND function or routine, the modifier "_" not valid.
NOTE: There were 1 observations read from the data set WORK.VARS.
NOTE: The data set WORK.METADATA has 1 observations and 10 variables.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Maxim 1: &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=mcrolref&amp;amp;docsetTarget=p07ugdul4v0llpn1denhfknmr7sb.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;READ THE DOCUMENTATION!!!&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;amp;sysrc contains the return code of EXTERNAL(!) commands run by the x statement.&lt;/P&gt;
&lt;P&gt;What you want to check is &amp;amp;syscc, which contains the current status of the SAS session itself.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2019 06:26:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understnading-for-amp-SYSRC/m-p/588442#M168180</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-09-13T06:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: Understnading for &amp;SYSRC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Understnading-for-amp-SYSRC/m-p/588445#M168182</link>
      <description>&lt;P&gt;I tried with &amp;amp;syscc as well but it still giving the value as 0 for the program which I posted in the Initial post.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2019 06:40:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Understnading-for-amp-SYSRC/m-p/588445#M168182</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2019-09-13T06:40:13Z</dc:date>
    </item>
  </channel>
</rss>

