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

Sample code for USER ABEND routine


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
subhadeep_infy

New User


Joined: 06 Mar 2006
Posts: 10

PostPosted: Mon Mar 06, 2006 12:30 pm
Reply with quote

Hi,
I need a piece of code to write an user abend routine. Can anyone please help.

Thanks,
Subhadeep
Back to top
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 463

PostPosted: Mon Mar 06, 2006 12:48 pm
Reply with quote

HI Subhadeep

Welcome to Forum,,

Could you please elaborate your problem...

Regards
Rupesh
Back to top
View user's profile Send private message
subhadeep_infy

New User


Joined: 06 Mar 2006
Posts: 10

PostPosted: Mon Mar 06, 2006 2:20 pm
Reply with quote

Hi Rupesh,
I'm creating an abender routine which will be called by any particular program when it tries to abend due to any specific conition. This will be a User defined abend with the appropriate abend message passed from the program. I hope this helps your query.

Thanks,
Subhadeep
Back to top
View user's profile Send private message
KS

New User


Joined: 28 Feb 2006
Posts: 91
Location: Chennai

PostPosted: Mon Mar 06, 2006 3:54 pm
Reply with quote

USER-ABEND-ROUTINE SECTION.

MOVE SQLCODE TO WS99-SQLCODE.
DISPLAY 'UNEXPECTED SQL CODE OCCURRED ' WS-SQLCODE.
DISPLAY SQLERRMC.
DISPLAY 'PROGRAM NAME ' WS99-PROG-NAME.
DISPLAY 'PARA NAME ' WS99-PARA-NAME.
DISPLAY 'TABLE NAME ' WS99-TABLE-NAME.
IF WS99-SQLCODE = -904
OR WS99-SQLCODE = -911
DISPLAY 'FAILURE CAUSED BY DEADLOCK/TIMEOUT'
EXEC SQL
ROLLBACK
END-EXEC
MOVE 13 TO RETURN-CODE
STOP RUN.
IF WS99-WARNING
GO TO USER-ABEND-ROUTINE-END.

USER-ABEND-ROUTINE-END SECTION.
EXIT.

Declare all the necessary variables in the copybook and the needed error routines.
Hope this helps.If no get back.

Thanks,
KS
Back to top
View user's profile Send private message
subhadeep_infy

New User


Joined: 06 Mar 2006
Posts: 10

PostPosted: Mon Mar 06, 2006 5:35 pm
Reply with quote

Thanks Kutti,
Actually I've employed a similar logic in my code and it is working fine. But can we have anything which will give a system flush for the error code as well as the message ( similar to CEE3ABD abend routine). Currently for this particular piece of code we'll just receive a MAXCC code of 13 if the SQLCODE is -904 and then the program will stop running.

Regards,
Subhadeep
Back to top
View user's profile Send private message
KS

New User


Joined: 28 Feb 2006
Posts: 91
Location: Chennai

PostPosted: Tue Mar 07, 2006 9:53 am
Reply with quote

Syntax - CEE3ABD(abcode,cleanup)

Clean-up can take wo values :
0 - Abend issued without clean-up.
1 - Abend with normal termination.

Ex-
WORKING-STORAGE SECTION.
01 ABCODE PIC S9(9) BINARY.
01 TIMING PIC S9(9) BINARY.
PROCEDURE DIVISION.
PARA-ERROR.

MOVE 904 TO ABCODE.
MOVE 0 TO TIMING.
CALL "CEE3ABD" USING ABCODE,TIMING.
GOBACK.

Hope this helps.For more info, refer our manual.

Thanks ,
KS
Back to top
View user's profile Send private message
subhadeep_infy

New User


Joined: 06 Mar 2006
Posts: 10

PostPosted: Tue Mar 07, 2006 11:10 am
Reply with quote

Hi Kutti,
The piece of code posted by you calls the routine CEE3ABD. BUt I require the functinality acquired by CEE3ABD. For eg the "code" of CEE3ABD or any other abend routine or any alogorithm which is being used by such abend routines. I tried abending the program by dividing 1 by 0 but in this case, the functionality before the division is not processed.
e.g.
DISPLAY ' HI'
DIVIDE 1 BY WS-ZERO GIVING WS-ABEND.

where WS-ZERO contains zero.

In This case the output is not showing 'HI' before abending.

Thanks ,
Subhadeep
Back to top
View user's profile Send private message
subhadeep_infy

New User


Joined: 06 Mar 2006
Posts: 10

PostPosted: Tue Mar 07, 2006 2:23 pm
Reply with quote

Hi,
I've created an USER ABEND routine using the Algo Divide 1 by 0 as described in my previous post. Though it doesn't throw a user abend message as done by CEE3ABD, but it can be used nevertheless. If anyone has any knowledge about any other Algo please post the same.

Thanks,
Subhadeep
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts ISAM and abend S03B JCL & VSAM 10
No new posts PuTTY - "User is not a surrogate... IBM Tools 5
No new posts How to delete a user's alias from the... JCL & VSAM 11
Search our Forums:

Back to Top