View previous topic :: View next topic |
Author |
Message |
tommy123 Beginner
Joined: 04 May 2005 Posts: 21 Topics: 11
|
Posted: Mon May 23, 2005 5:48 pm Post subject: COBOL-DB2 STANDARD ERROR ROUTINE |
|
|
Hai,
I have seen in many COBOL-DB2 programs ,normally the abend para's are written like this below:
**********************************************************************************
* DECLARATIONS / MESSAGE STRUCTURES *
* *
**********************************************************************************
01 DSNTIAR-MESSAGE.
05 MESSAGE-LENGTH PIC S9(4) COMP VALUE +800.
05 DSNTIAR-MSG-TEXT OCCURS 8 TIMES INDEXED BY DSNTIAR-INDEX PIC X(120).
01 DSNTIAR-LINE-LENGTH PIC S9(9) COMP VALUE +120.
ABEND-PARA.
IF SQLCODE NOT EQUAL ZERO
CALL 'DSNTIAR' USING SQLCA DSNTIAR-MESSAGE DSNTIAR-LINE-LENGTH
IF RETURN-CODE EQUAL ZERO
PERFORM WITH TEST AFTER VARYING DSNTIAR-INDEX FROM 1 BY 1
UNTIL DSNTIAR-INDEX GREATER THAN 8
IF DSNTIAR-MSG-TEXT(DSNTIAR-INDEX) NOT EQUAL SPACE
DISPLAY DSNTIAR-MSG-TEXT(DSNTIAR-INDEX)
END-IF
END-PERFORM
END-IF
END-IF.
MOVE 12 TO RETURN-CODE.
STOP RUN.
Can anyone tell me why exactly do we use this piece of code and what does the description indicates in the ABEND-PARA ?
Is this kind of declaration standard and used in all shops / where can i get a detailed description of this code. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
|
|