IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Using HANDLE ABEND LABEL


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
S0C7

New User


Joined: 19 May 2006
Posts: 26

PostPosted: Fri Nov 14, 2008 2:53 pm
Reply with quote

Hi,

I have the following code:

Code:

EXEC CICS HANDLE ABEND LABEL (Para1) END-EXEC
EXEC CICS LINK PROGRAM (Pgm1) FROM (area1) RESP(WSRESP) END-EXEC
EXEC CICS HANDLE CANCEL END-EXEC.



Now, if we get an abend in the link, the handle would perform Para1. Would the control "go to" Para1 or would it simply perform para1 and come back to the code that follows HANDLE CANCEL...? If it's a "go to" Para 1, is there any better way to come back to the code that follows HANDLE CANCEL...? I am changing an existing program and dont want to put in much code.
Any wise ideas on how to keep the code really clean and achieve what is stated above...? icon_rolleyes.gif
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Nov 14, 2008 4:47 pm
Reply with quote

SOC7,

Quote:
Now, if we get an abend in the link, the handle would perform Para1. Would the control "go to" Para1 or would it simply perform para1 and come back to the code that follows HANDLE CANCEL...?


It depends on what you have coded in the PARA1.

Quote:
EXEC CICS LINK PROGRAM (Pgm1) FROM (area1) RESP(WSRESP) END-EXEC


Also do note that the handle abend will not be inherited in linked program pgm1. Simple, this handle abend would work only in this program.
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Fri Nov 14, 2008 7:59 pm
Reply with quote

EXEC CICS HANDLE

will perfomr GO TO, it will not return to statement following HANDLE


Remove the HANDLE

and code
EXEC CICS LINK PROGRAM (PGM1) RESPONSE(WSRESP)
NOHANDLE END-EXEC.

then check WSRESP to determine if link occurred properly
Back to top
View user's profile Send private message
S0C7

New User


Joined: 19 May 2006
Posts: 26

PostPosted: Mon Nov 17, 2008 7:55 pm
Reply with quote

Aaru wrote:
SOC7,

Quote:
Now, if we get an abend in the link, the handle would perform Para1. Would the control "go to" Para1 or would it simply perform para1 and come back to the code that follows HANDLE CANCEL...?


It depends on what you have coded in the PARA1.

Quote:
EXEC CICS LINK PROGRAM (Pgm1) FROM (area1) RESP(WSRESP) END-EXEC


Also do note that the handle abend will not be inherited in linked program pgm1. Simple, this handle abend would work only in this program.



Thanks Earl, Aaru,
I was already in favor of using RESP, but the deisgn required me to use HANDLE ABEND for the linked program.

Are we sure on the point that the HANDLE ABEND would not be inherited in the linked program? I didnt find much info on ibm's reference guide on this. If you have any doc that highlights this point then please direct me to the same.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Nov 17, 2008 8:37 pm
Reply with quote

From the Application Programming Guide:
Quote:
3.5.1.2 Link to another program expecting return

If the program receiving control is not already in main storage, it is loaded. When a RETURN command is processed in the linked program, control is returned to the program initiating the link at the next sequential process instruction.

The linked program operates independently of the program that issues the LINK command with regard to handling exception conditions, attention identifiers, and abends. For example, the effects of HANDLE commands in the linking program are not inherited by the linked-to program, but the original HANDLE commands are restored on return to the linking program. You can use the HANDLE ABEND command to deal with abnormal terminations in other link levels. Figure 76 shows the concept of logical levels.
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Mon Nov 17, 2008 9:08 pm
Reply with quote

Quote:
Are we sure on the point that the HANDLE ABEND would not be inherited in the linked program?


My 30+ years of experience says >> YES
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Nov 18, 2008 7:00 pm
Reply with quote

SoC7,

Quote:
Are we sure on the point that the HANDLE ABEND would not be inherited in the linked program?


That is what the manual Says too. Refer to the manuals section.

Btw, Any specific reason for your name to be S0C7??
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts ISAM and abend S03B JCL & VSAM 10
No new posts Abend S0C4 11 (Page Translation Excep... PL/I & Assembler 16
No new posts WER999A - UNSUCCESSFUL SORT 8ED U Ab... SYNCSORT 5
No new posts the system or user abend SF0F R=NULL COBOL Programming 0
No new posts Need to get an DLI abend like U0200 IMS DB/DC 2
Search our Forums:

Back to Top