# Terminate a batch

**URL:** <https://techcommunity.softwareag.com/t/terminate-a-batch/100758>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [June 17, 2012, 10:31am UTC](https://techcommunity.softwareag.com/t/terminate-a-batch/100758 "2012-06-17T10:31:58Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hezi](https://avatars.discourse-cdn.com/v4/letter/h/a5b964/32.png) [@Hezi](https://techcommunity.softwareag.com/u/Hezi)\
**Post date:** [June 17, 2012, 10:31am UTC](https://techcommunity.softwareag.com/t/terminate-a-batch/100758/1 "2012-06-17T10:31:58Z")

</div>

Hello,

I want to stop a batch processing using terminate, but I do not want that the jcl  
will get an error code (on every rc ne 0 we get a consloe alert).  
How can I use terminate oper1, oper2 to end the process but the jcl will not cause an alert?

With Regards,  
Hezi

---

<div class="post-metadata">

**Author:** ![Nikolay\_Kuhta](https://avatars.discourse-cdn.com/v4/letter/n/35a633/32.png) [@Nikolay\_Kuhta](https://techcommunity.softwareag.com/u/Nikolay_Kuhta)\
**Post date:** [June 17, 2012, 3:30pm UTC](https://techcommunity.softwareag.com/t/terminate-a-batch/100758/2 "2012-06-17T15:30:29Z")

</div>

Hi Hezi,  
Have you tried “TERMINATE 0” or simply “TERMINATE”?

Best regards,  
NK

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [June 17, 2012, 3:33pm UTC](https://techcommunity.softwareag.com/t/terminate-a-batch/100758/3 "2012-06-17T15:33:02Z")

</div>

Don’t understand the problem, TERMINATE allows you to specify a RC of 0 ?!?

---

<div class="post-metadata">

**Author:** ![Hezi](https://avatars.discourse-cdn.com/v4/letter/h/a5b964/32.png) [@Hezi](https://techcommunity.softwareag.com/u/Hezi)\
**Post date:** [June 17, 2012, 3:44pm UTC](https://techcommunity.softwareag.com/t/terminate-a-batch/100758/4 "2012-06-17T15:44:54Z")

</div>

Let me explain again:  
jcl example  
step 1. terminate 100  
step 2. if rc = 100 then goto step 4/  
step 3. what ever  
step 4. send message.

Even that I got terminate 100 I do not want that my $mrc in the jcl will alert that as been an error.

Hezi

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [June 17, 2012, 4:29pm UTC](https://techcommunity.softwareag.com/t/terminate-a-batch/100758/5 "2012-06-17T16:29:27Z")

</div>

Why do you check for a RC NE 0 then in the first place when you don’t  
want it to trigger a message ?

Are there “valid” return codes you want to still cause a message to be sent ?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [June 17, 2012, 4:40pm UTC](https://techcommunity.softwareag.com/t/terminate-a-batch/100758/6 "2012-06-17T16:40:55Z")

</div>

At any rate, you may want to check into using a&nbsp;&nbsp;&nbsp;[backend program](http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat427mf/parms/program.htm)

---

<div class="post-metadata">

**Author:** ![Douglas\_Kelly](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/douglas_kelly/32/102_2.png) [@Douglas\_Kelly](https://techcommunity.softwareag.com/u/Douglas_Kelly)\
**Post date:** [June 17, 2012, 6:08pm UTC](https://techcommunity.softwareag.com/t/terminate-a-batch/100758/7 "2012-06-17T18:08:15Z")

</div>

another approach: whatever you are calling for “send message” can probably be invoked from Natural with the CALL statement. So you don’t even need the return code.

---

<div class="post-metadata">

**Author:** ![Hezi](https://avatars.discourse-cdn.com/v4/letter/h/a5b964/32.png) [@Hezi](https://techcommunity.softwareag.com/u/Hezi)\
**Post date:** [June 18, 2012, 7:14am UTC](https://techcommunity.softwareag.com/t/terminate-a-batch/100758/8 "2012-06-18T07:14:01Z")

</div>

Got your point.  
I will try them both.

Hezi

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:02pm UTC](https://techcommunity.softwareag.com/t/terminate-a-batch/100758/9 "2021-04-02T15:02:04Z")

</div>


