If the OP would like to see some example source for this sort of thing, I 
included simple task and timer interactions in the "Example Cross-Memory 
Server" code I wrote for Share Dallas.

You can download the code from :

https://github.com/rscott-rocket/mxe

Rob Scott
Rocket Software

-----Original Message-----
From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of 
Tony Harminc
Sent: Tuesday, November 14, 2023 2:44 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: ATTACHX/STIMERM WAIT=YES

EXTERNAL EMAIL





On Mon, 13 Nov 2023 at 19:37, Paul Schuster <pgs4ibmm...@pacbell.net> wrote:

> How to handle this situation: task ‘A’ attaches a subtask, task ‘B’.
>
> The ‘B’ task issues a STIMERM WAIT=YES
>
> Task ‘A’ terminates, but gets the A03 abend since task ‘B’ still active.
>
> How can task ‘A’ communicate to the subtask ‘B’ that it (task ‘B’)
> needs to terminate?  Task ‘B’ is in the STIMERM wait, so it can’t do anything.
>

The typical approach is to not use WAIT on the STIMERM in Task B, but rather 
specify a local ECB to be POSTed. Then do your own WAIT, specifying both that 
ECB and also an ECB that Task A passes to Task B as an argument on the 
ATTACH[X]. When Task A wants to shut things down, it POSTs the ECB it passed to 
B, and then in turn *it* WAITs on the other ECB that you specified on the 
ATTACH with ECB=. When Task B awakes from its WAIT, it checks which ECB was 
posted. If it's the STIMER one, it does whatever it does for that, and goes 
back and re-issues the STIMERM and the WAIT. If it's the one saying "A says to 
shut down", B cleans up and returns to the system, which then POSTs the ECB 
that A put on the ATTACH.

This assumes that in your description Task A *intends* to shut down B and then 
itself. If Task A instead terminates unexpectedly, then you need to figure out 
what you *want* it to do. You could put ESTAI= on the ATTACH, and catch B's 
abend there. But if A abended in the first place...

This isn't really as complex as I'm making it sound with a poorly organized 
description. Just don't do that WAIT on the STIMERM.

Tony H.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
lists...@listserv.ua.edu with the message: INFO IBM-MAIN

================================
Rocket Software, Inc. and subsidiaries ■ 77 Fourth Avenue, Waltham MA 02451 ■ 
Main Office Toll Free Number: +1 855.577.4323
Contact Customer Support: 
https://my.rocketsoftware.com/RocketCommunity/RCEmailSupport
Unsubscribe from Marketing Messages/Manage Your Subscription Preferences - 
http://www.rocketsoftware.com/manage-your-email-preferences
Privacy Policy - http://www.rocketsoftware.com/company/legal/privacy-policy
================================

This communication and any attachments may contain confidential information of 
Rocket Software, Inc. All unauthorized use, disclosure or distribution is 
prohibited. If you are not the intended recipient, please notify Rocket 
Software immediately and destroy all copies of this communication. Thank you.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to