<?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 &amp;amp;syscc=0 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/amp-syscc-0/m-p/825951#M326238</link>
    <description>&lt;P&gt;Hello - hope everyone is ok.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am running the code below and kept getting the 'ERROR' email.&amp;nbsp; I've checked the previous data steps and found no errors.&amp;nbsp; Does anybody have an idea what I am missing? Thanks a lot!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;%if &amp;amp;syscc=0 %then %do;&lt;BR /&gt;proc export data=ReportData&lt;BR /&gt;dbms=xlsx&lt;BR /&gt;replace&lt;BR /&gt;outfile='\\drive\Daily_Reporting\Report Name';&lt;BR /&gt;sheet='Data';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;filename mymail email 'jsmith@email.com'&lt;BR /&gt;from='jsmith@email.com'&lt;BR /&gt;subject='Report Name'&lt;BR /&gt;attach=("\\drive\Daily_Reporting\Report Name'" content_type="appication/xlsx");&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;file mymail&lt;BR /&gt;to=(&lt;BR /&gt;'lsmith@email.com'&lt;BR /&gt;)&lt;BR /&gt;cc=('jsmith@email.com');&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;BR /&gt;%else %do;&lt;BR /&gt;filename mymail email 'jsmith@email.com'&lt;BR /&gt;from='jsmith@email.com'&lt;BR /&gt;subject='Report Name';&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;file mymail&lt;BR /&gt;to=('jsmith@email.com');&lt;BR /&gt;put "ERROR :(";&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jul 2022 15:01:04 GMT</pubDate>
    <dc:creator>Eugenio211</dc:creator>
    <dc:date>2022-07-28T15:01:04Z</dc:date>
    <item>
      <title>&amp;syscc=0</title>
      <link>https://communities.sas.com/t5/SAS-Programming/amp-syscc-0/m-p/825951#M326238</link>
      <description>&lt;P&gt;Hello - hope everyone is ok.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am running the code below and kept getting the 'ERROR' email.&amp;nbsp; I've checked the previous data steps and found no errors.&amp;nbsp; Does anybody have an idea what I am missing? Thanks a lot!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;%if &amp;amp;syscc=0 %then %do;&lt;BR /&gt;proc export data=ReportData&lt;BR /&gt;dbms=xlsx&lt;BR /&gt;replace&lt;BR /&gt;outfile='\\drive\Daily_Reporting\Report Name';&lt;BR /&gt;sheet='Data';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;filename mymail email 'jsmith@email.com'&lt;BR /&gt;from='jsmith@email.com'&lt;BR /&gt;subject='Report Name'&lt;BR /&gt;attach=("\\drive\Daily_Reporting\Report Name'" content_type="appication/xlsx");&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;file mymail&lt;BR /&gt;to=(&lt;BR /&gt;'lsmith@email.com'&lt;BR /&gt;)&lt;BR /&gt;cc=('jsmith@email.com');&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;BR /&gt;%else %do;&lt;BR /&gt;filename mymail email 'jsmith@email.com'&lt;BR /&gt;from='jsmith@email.com'&lt;BR /&gt;subject='Report Name';&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;file mymail&lt;BR /&gt;to=('jsmith@email.com');&lt;BR /&gt;put "ERROR :(";&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 15:01:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/amp-syscc-0/m-p/825951#M326238</guid>
      <dc:creator>Eugenio211</dc:creator>
      <dc:date>2022-07-28T15:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: &amp;syscc=0</title>
      <link>https://communities.sas.com/t5/SAS-Programming/amp-syscc-0/m-p/825955#M326239</link>
      <description>&lt;P&gt;What exactly is the value of &amp;amp;syscc ? If it is not 0 then the code shown behaves as intended.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From the documentation:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV class="xis-eDocBody"&gt;
&lt;DIV class="xis-refDictEntry"&gt;
&lt;P class="xis-shortDescription"&gt;Contains the current condition code that SAS &lt;STRONG&gt;returns to your operating environment&lt;/STRONG&gt; (the operating environment condition code).&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So likely you are checking the wrong variable as this is intended to notify something related to the overall status of a SAS job when completed, which is why you can have code that assigns values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps you are looking for the SYSERR automatic variable? You want to check the documentation for that but not all procedures will set the variable.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 15:21:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/amp-syscc-0/m-p/825955#M326239</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-07-28T15:21:11Z</dc:date>
    </item>
  </channel>
</rss>

