<?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: SAS code working properly in Base SAS but not working in Batch mode in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-working-properly-in-Base-SAS-but-not-working-in-Batch/m-p/308681#M270676</link>
    <description>Thank you very much.&lt;BR /&gt;now its working after changing the options in the batch server</description>
    <pubDate>Wed, 02 Nov 2016 06:38:52 GMT</pubDate>
    <dc:creator>chandusaladi</dc:creator>
    <dc:date>2016-11-02T06:38:52Z</dc:date>
    <item>
      <title>SAS code working properly in Base SAS but not working in Batch mode</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-working-properly-in-Base-SAS-but-not-working-in-Batch/m-p/308439#M270667</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the following code to generated error messages that occured during the SAS job run&lt;/P&gt;&lt;P&gt;the issue is when i am runnning the code through workspace server/EG it is sending the mail alerts where as when i scheduled it &amp;nbsp;and run through the batch server it is not sending the mail alerts where as "abortcancel" statement is executed which is in the same macro&amp;nbsp;&lt;/P&gt;&lt;P&gt;when an error occurs&lt;/P&gt;&lt;P&gt;&amp;nbsp;PS: SMTP is configured in both workspace and batch mode in similar way&lt;/P&gt;&lt;P&gt;%macro ab_stop;&lt;BR /&gt;/* &amp;amp;syserr is a default macro variable which is generated internally in SAS */&lt;BR /&gt;%if not (&amp;amp;syserr eq 0 or &amp;amp;syserr eq 4) %then %do;&lt;BR /&gt;FILENAME Mailbox EMAIL TO=('XXXX@YYY.com')&lt;BR /&gt;CC=('support@yyy.com')&lt;BR /&gt;Subject='JOB FAILURE!!!';&lt;BR /&gt;DATA _NULL_;&lt;BR /&gt;FILE Mailbox;&lt;BR /&gt;PUT "job failed due to following error";&lt;BR /&gt;PUT "&amp;amp;SYSERRORTEXT";&lt;BR /&gt;RUN;&lt;BR /&gt;%abort cancel;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table temp1 as&lt;BR /&gt;select *&lt;BR /&gt;from sba.cars;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%ab_stop;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table temp2&amp;nbsp;as&lt;BR /&gt;select *&lt;BR /&gt;from &lt;SPAN&gt;sashelp.cars&lt;/SPAN&gt;;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;%ab_stop;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks inadvance&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2016 06:32:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-working-properly-in-Base-SAS-but-not-working-in-Batch/m-p/308439#M270667</guid>
      <dc:creator>chandusaladi</dc:creator>
      <dc:date>2016-11-01T06:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code working properly in Base SAS but not working in Batch mode</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-working-properly-in-Base-SAS-but-not-working-in-Batch/m-p/308440#M270668</link>
      <description>What about providing the log?</description>
      <pubDate>Tue, 01 Nov 2016 07:08:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-working-properly-in-Base-SAS-but-not-working-in-Batch/m-p/308440#M270668</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-11-01T07:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code working properly in Base SAS but not working in Batch mode</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-working-properly-in-Base-SAS-but-not-working-in-Batch/m-p/308441#M270669</link>
      <description>&lt;P&gt;How are you running your batch jobs? If you are using a scheduler, then it can usually email you if a job fails so no coding is required. That is what we do and it is simple and reliable.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2016 07:12:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-working-properly-in-Base-SAS-but-not-working-in-Batch/m-p/308441#M270669</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-11-01T07:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code working properly in Base SAS but not working in Batch mode</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-working-properly-in-Base-SAS-but-not-working-in-Batch/m-p/308442#M270670</link>
      <description>the Current environment doesn't have SAS scheduler license so we are using OS scheduler which don't have capability to send mail alerts</description>
      <pubDate>Tue, 01 Nov 2016 07:17:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-working-properly-in-Base-SAS-but-not-working-in-Batch/m-p/308442#M270670</guid>
      <dc:creator>chandusaladi</dc:creator>
      <dc:date>2016-11-01T07:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code working properly in Base SAS but not working in Batch mode</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-working-properly-in-Base-SAS-but-not-working-in-Batch/m-p/308443#M270671</link>
      <description>&lt;P&gt;Following is the log when i run the program through Batch server&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Macro to abort code at that particular step in case of an error and send to the Error*/&lt;BR /&gt;64&lt;BR /&gt;65 %macro ab_stop;&lt;BR /&gt;66 /* &amp;amp;syserr is a default macro variable which is generated internally in SAS */&lt;BR /&gt;67 %if not (&amp;amp;syserr eq 0 or &amp;amp;syserr eq 4) %then %do;&lt;BR /&gt;68 FILENAME Mailbox EMAIL TO=('XXX@YYY.com')&lt;BR /&gt;71 CC=('xxxx@yyy.com'&lt;BR /&gt;72 'xxx@yyy.com')&lt;BR /&gt;73 Subject='JOB FAILURE!!!';&lt;BR /&gt;74 DATA _NULL_;&lt;BR /&gt;75 FILE Mailbox;&lt;BR /&gt;4 The SAS System 10:00 Monday, October 31, 2016&lt;/P&gt;&lt;P&gt;76 PUT "job failed due to following error";&lt;BR /&gt;77 PUT "&amp;amp;SYSERRORTEXT";&lt;BR /&gt;78 RUN;&lt;BR /&gt;79 %abort cancel;&lt;BR /&gt;80 %end;&lt;BR /&gt;81 %mend;&lt;BR /&gt;82&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table temp1 as&lt;BR /&gt;select *&lt;BR /&gt;from sba.cars;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;ERROR:Libref SBA&amp;nbsp;is not assigned.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: SAS set option OBS=0 and will continue to check statements. This might cause NOTE: No observations in data set.&lt;BR /&gt;NOTE: MVA_DSIO.OPEN_CLOSE| _DISARM| STOP| _DISARM| 2016-10-31T11:05:00,601-04:00| _DISARM| BatchServer| _DISARM| SAS| _DISARM| | _DISARM| 4529429| _DISARM| 14323712| _DISARM| 12| _DISARM| 13| _DISARM| 0| _DISARM| 40190216| _DISARM| 0.000000| _DISARM| 0.000460| _DISARM| 1793545500.601018| _DISARM| 1793545500.601478| _DISARM| 0.000000| _DISARM| | _ENDDISARM&lt;BR /&gt;NOTE: PROCEDURE| _DISARM| STOP| _DISARM| 2016-10-31T11:05:00,601-04:00| _DISARM| BatchServer| _DISARM| SAS| _DISARM| | _DISARM| 19574784| _DISARM| 14323712| _DISARM| 12| _DISARM| 13| _DISARM| 0| _DISARM| 40190216| _DISARM| 0.000000| _DISARM| 0.001256| _DISARM| 1793545500.600375| _DISARM| 1793545500.601631| _DISARM| 0.000000| _DISARM| | _ENDDISARM&lt;BR /&gt;&lt;BR /&gt;176 %ab_stop;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE| _DISARM| STOP| _DISARM| 2016-10-31T11:05:00,604-04:00| _DISARM| BatchServer| _DISARM| SAS| _DISARM| | _DISARM| 19574784| _DISARM| 14323712| _DISARM| 12| _DISARM| 13| _DISARM| 0| _DISARM| 40190216| _DISARM| 0.000000| _DISARM| 0.002365| _DISARM| 1793545500.602433| _DISARM| 1793545500.604798| _DISARM| 0.000000| _DISARM| | _ENDDISARM&lt;BR /&gt;NOTE: PROCEDURE SQL used ( (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ERROR: Execution canceled by an %ABORT CANCEL statement.&lt;BR /&gt;NOTE: The SAS System stopped processing due to receiving a CANCEL request.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2016 07:25:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-working-properly-in-Base-SAS-but-not-working-in-Batch/m-p/308443#M270671</guid>
      <dc:creator>chandusaladi</dc:creator>
      <dc:date>2016-11-01T07:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code working properly in Base SAS but not working in Batch mode</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-working-properly-in-Base-SAS-but-not-working-in-Batch/m-p/308460#M270672</link>
      <description>&lt;P&gt;That&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;ERROR:Libref SBA&amp;nbsp;is not assigned&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;points to a missing libname definition, either through metadata or autoexec.sas.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2016 09:12:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-working-properly-in-Base-SAS-but-not-working-in-Batch/m-p/308460#M270672</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-01T09:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code working properly in Base SAS but not working in Batch mode</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-working-properly-in-Base-SAS-but-not-working-in-Batch/m-p/308463#M270673</link>
      <description>&lt;P&gt;Main purpose of my code is to send the mail alerts when there is an error in the code. here is the error "Libref SBA is not assigned" so it should send the mail and then abort the program. but it is not sending the mail where as the statement that placed after mail statement "abort cancel" statement is executed , even though the statement is in the same macro as mail statement&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2016 09:21:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-working-properly-in-Base-SAS-but-not-working-in-Batch/m-p/308463#M270673</guid>
      <dc:creator>chandusaladi</dc:creator>
      <dc:date>2016-11-01T09:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code working properly in Base SAS but not working in Batch mode</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-working-properly-in-Base-SAS-but-not-working-in-Batch/m-p/308464#M270674</link>
      <description>&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/67912/HTML/default/viewer.htm#n1wrevo4roqsnxn1fbd9yezxvv9k.htm" target="_blank"&gt;&amp;amp;syserr&lt;/A&gt;&amp;nbsp;is reset at every step boundary, so a successful step in between will prevent your error detection. I'd rather use &amp;amp;syscc for this.&lt;/P&gt;
&lt;P&gt;And I see that you want to tolerate WARNINGs. I consider that a VERY BAD IDEA. Programs that do not always end with a return code of zero when they run "successfully" point to sloppy programming and are in dire need of debugging.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2016 09:30:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-working-properly-in-Base-SAS-but-not-working-in-Batch/m-p/308464#M270674</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-01T09:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code working properly in Base SAS but not working in Batch mode</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-working-properly-in-Base-SAS-but-not-working-in-Batch/m-p/308653#M270675</link>
      <description>&lt;P&gt;Check the SAS options (proc options will do this) of your SAS batch environment. You may find the&amp;nbsp;SYNTAXCHECK option is set:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lesysoptsref/68023/HTML/default/viewer.htm#n014qbvh3po8w5n1qlqbzr22vtg0.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lesysoptsref/68023/HTML/default/viewer.htm#n014qbvh3po8w5n1qlqbzr22vtg0.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this is the case then the option OBS = 0 will be set as soon as the SAS error occurs, hence your email DATA step will not produce any output. Try NO&lt;SPAN&gt;SYNTAXCHECK to see if this fixes the problem.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 03:27:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-working-properly-in-Base-SAS-but-not-working-in-Batch/m-p/308653#M270675</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-11-02T03:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code working properly in Base SAS but not working in Batch mode</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-working-properly-in-Base-SAS-but-not-working-in-Batch/m-p/308681#M270676</link>
      <description>Thank you very much.&lt;BR /&gt;now its working after changing the options in the batch server</description>
      <pubDate>Wed, 02 Nov 2016 06:38:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-working-properly-in-Base-SAS-but-not-working-in-Batch/m-p/308681#M270676</guid>
      <dc:creator>chandusaladi</dc:creator>
      <dc:date>2016-11-02T06:38:52Z</dc:date>
    </item>
  </channel>
</rss>

