View previous topic :: View next topic
|
Author |
Message |
subhadeep_infy
New User
Joined: 06 Mar 2006 Posts: 10
|
|
|
|
Hi,
I need a piece of code to write an user abend routine. Can anyone please help.
Thanks,
Subhadeep |
|
Back to top |
|
|
Rupesh.Kothari
Member of the Month
Joined: 27 Apr 2005 Posts: 463
|
|
|
|
HI Subhadeep
Welcome to Forum,,
Could you please elaborate your problem...
Regards
Rupesh |
|
Back to top |
|
|
subhadeep_infy
New User
Joined: 06 Mar 2006 Posts: 10
|
|
|
|
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 |
|
|
KS
New User
Joined: 28 Feb 2006 Posts: 91 Location: Chennai
|
|
|
|
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 |
|
|
subhadeep_infy
New User
Joined: 06 Mar 2006 Posts: 10
|
|
|
|
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 |
|
|
KS
New User
Joined: 28 Feb 2006 Posts: 91 Location: Chennai
|
|
|
|
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 |
|
|
subhadeep_infy
New User
Joined: 06 Mar 2006 Posts: 10
|
|
|
|
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 |
|
|
subhadeep_infy
New User
Joined: 06 Mar 2006 Posts: 10
|
|
|
|
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 |
|
|
|