<?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: Abort only one of several included jobs in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Abort-only-one-of-several-included-jobs/m-p/42461#M8690</link>
    <description>You can cancel execution of  %included file by using &lt;BR /&gt;
ABORT CANCEL FILE;&lt;BR /&gt;
or %ABORT CANCEL FILE;&lt;BR /&gt;
&lt;BR /&gt;
within the %included file at the conditional statement.&lt;BR /&gt;
This is new in version 9.2. It can be used in a %included file or an autoexec file. There's a warning in the documentation about the effect of ABORT CANCEL FILE on open macros, (it closes them) when executed within a %include file.</description>
    <pubDate>Wed, 20 Jan 2010 16:56:06 GMT</pubDate>
    <dc:creator>martha_sas</dc:creator>
    <dc:date>2010-01-20T16:56:06Z</dc:date>
    <item>
      <title>Abort only one of several included jobs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Abort-only-one-of-several-included-jobs/m-p/42456#M8685</link>
      <description>Hi all,&lt;BR /&gt;
&lt;BR /&gt;
I'm trying to implement a job, which includes 4 others sequentially and insert a conditional statement in job 3, which aborts only this job nr. 3 but then executes the last one.&lt;BR /&gt;
&lt;BR /&gt;
I understand abort abend/return do abort the whole session with different results. Is there a way to code the above mentioned behaviour?&lt;BR /&gt;
&lt;BR /&gt;
The jobs are ran in batch mode.&lt;BR /&gt;
&lt;BR /&gt;
Thanks a lot.</description>
      <pubDate>Tue, 19 Jan 2010 08:31:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Abort-only-one-of-several-included-jobs/m-p/42456#M8685</guid>
      <dc:creator>ThomasH</dc:creator>
      <dc:date>2010-01-19T08:31:35Z</dc:date>
    </item>
    <item>
      <title>Re: Abort only one of several included jobs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Abort-only-one-of-several-included-jobs/m-p/42457#M8686</link>
      <description>Hi Thomas&lt;BR /&gt;
&lt;BR /&gt;
If you use an %include statement then you have to see this as one job / one chunk of code and not several jobs. &lt;BR /&gt;
You will therefore have to build your job logic in a way that part of the code is not executed when a certain condition is met. An abort statement will - as you say - abort the whole job.&lt;BR /&gt;
You could - for example - populate a macro var in your job when the condition is met (using call symput) and then stop this data step using 'stop'. Then have all subsequent steps in a macro where you only execute code if the macro var is not populated.&lt;BR /&gt;
&lt;BR /&gt;
If this is about having a master job which starts child jobs then you could use rsubmit blocks to spawn jobs (an rsubmit can also be used on the same machine to create several SAS sessions in parallel). Google a bit: There is a white paper explaining on how to do this.&lt;BR /&gt;
&lt;BR /&gt;
HTH&lt;BR /&gt;
Patrick</description>
      <pubDate>Tue, 19 Jan 2010 13:44:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Abort-only-one-of-several-included-jobs/m-p/42457#M8686</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2010-01-19T13:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: Abort only one of several included jobs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Abort-only-one-of-several-included-jobs/m-p/42458#M8687</link>
      <description>If we are talking about SAS coding from end-to-end (multiple child jobs included from a master one), I cannot see anything else that a macro or rsubmit/autosignon solution.&lt;BR /&gt;
&lt;BR /&gt;
For a macro approach, you could enclose the job nr.3 into one big macro, and then use the %GOTO statement to skip the desired code as necessary.&lt;BR /&gt;
&lt;BR /&gt;
See: &lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a000209058.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a000209058.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
"Self"-submitting sequentially the desired jobs may also work, just issue the ENDSAS statement to interrupt job nr.3's session without generating an error.&lt;BR /&gt;
&lt;BR /&gt;
See: &lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000289392.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000289392.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
If we are talking about multiple SAS jobs (scripts) submitted externally from SAS (let say JCL, shell script, batch script) then it's a lot more simpler, you just have to control the execution through the JCL/script you are using.&lt;BR /&gt;
&lt;BR /&gt;
Cheers from Portugal.&lt;BR /&gt;
&lt;BR /&gt;
Daniel Santos @ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;</description>
      <pubDate>Tue, 19 Jan 2010 14:16:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Abort-only-one-of-several-included-jobs/m-p/42458#M8687</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2010-01-19T14:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: Abort only one of several included jobs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Abort-only-one-of-several-included-jobs/m-p/42459#M8688</link>
      <description>What OS?  Is SAS running locally or on a remote server?&lt;BR /&gt;
&lt;BR /&gt;
And are you running these "jobs" under a comprehensive job-scheduler or manually?  Is a scheduler facility available to you or are you expecting to accomplish this processing only within SAS?&lt;BR /&gt;
&lt;BR /&gt;
How do you currently thread the job-executions - are they submitted manually or is there a "master control job" to sequence the SAS code execution based on prior "job nr." results?&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Tue, 19 Jan 2010 14:21:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Abort-only-one-of-several-included-jobs/m-p/42459#M8688</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-01-19T14:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Abort only one of several included jobs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Abort-only-one-of-several-included-jobs/m-p/42460#M8689</link>
      <description>Thanks a lot for your answers - there are one or two approaches I will look into. &lt;BR /&gt;
&lt;BR /&gt;
Job scheduling in this case is controlled by one master job.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Thomas</description>
      <pubDate>Tue, 19 Jan 2010 17:14:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Abort-only-one-of-several-included-jobs/m-p/42460#M8689</guid>
      <dc:creator>ThomasH</dc:creator>
      <dc:date>2010-01-19T17:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Abort only one of several included jobs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Abort-only-one-of-several-included-jobs/m-p/42461#M8690</link>
      <description>You can cancel execution of  %included file by using &lt;BR /&gt;
ABORT CANCEL FILE;&lt;BR /&gt;
or %ABORT CANCEL FILE;&lt;BR /&gt;
&lt;BR /&gt;
within the %included file at the conditional statement.&lt;BR /&gt;
This is new in version 9.2. It can be used in a %included file or an autoexec file. There's a warning in the documentation about the effect of ABORT CANCEL FILE on open macros, (it closes them) when executed within a %include file.</description>
      <pubDate>Wed, 20 Jan 2010 16:56:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Abort-only-one-of-several-included-jobs/m-p/42461#M8690</guid>
      <dc:creator>martha_sas</dc:creator>
      <dc:date>2010-01-20T16:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: Abort only one of several included jobs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Abort-only-one-of-several-included-jobs/m-p/42462#M8691</link>
      <description>This is great!&lt;BR /&gt;
&lt;BR /&gt;
Didn't knew about this useful feature.&lt;BR /&gt;
&lt;BR /&gt;
Let's hope Thomas is running 9.2.&lt;BR /&gt;
&lt;BR /&gt;
Cheers from Portugal.&lt;BR /&gt;
&lt;BR /&gt;
Daniel Santos @ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;</description>
      <pubDate>Wed, 20 Jan 2010 17:14:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Abort-only-one-of-several-included-jobs/m-p/42462#M8691</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2010-01-20T17:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: Abort only one of several included jobs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Abort-only-one-of-several-included-jobs/m-p/42463#M8692</link>
      <description>Nope, unfortunately I'm running 9.1, but I'll keep this in mind for somewhen else. So thanks for the hint! :)

Message was edited by: ThomasH</description>
      <pubDate>Thu, 21 Jan 2010 15:13:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Abort-only-one-of-several-included-jobs/m-p/42463#M8692</guid>
      <dc:creator>ThomasH</dc:creator>
      <dc:date>2010-01-21T15:13:38Z</dc:date>
    </item>
  </channel>
</rss>

