Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Sample code for USER ABEND routine

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Sample code for USER ABEND routine
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: 464

PostPosted: Mon Mar 06, 2006 12:48 pm    Post subject: Re: Need sample code for USER ABEND routine
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    Post subject: Re: Need sample code for USER ABEND routine
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    Post subject:
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    Post subject: Re: Need sample code for USER ABEND routine
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    Post subject:
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    Post subject: Re: Need sample code for USER ABEND routine
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    Post subject: Re: Need sample code for USER ABEND routine
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ASP3 ABEND IN CICS Vedant CICS 0 Fri Oct 20, 2017 3:18 pm
No new posts User access certification In Mainfram... Virendra Shambharkar All Other Mainframe Topics 4 Tue Oct 03, 2017 12:32 pm
No new posts Speed-up/reduce CPU use of code prino PL/I & Assembler 0 Tue Sep 26, 2017 12:05 am
This topic is locked: you cannot edit posts or make replies. how to code for GDG in Rexx cvnlynn CLIST & REXX 13 Wed Aug 09, 2017 9:13 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us