MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

COBOL-DB2 STANDARD ERROR ROUTINE

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
tommy123
Beginner


Joined: 04 May 2005
Posts: 21
Topics: 11

PostPosted: Mon May 23, 2005 5:48 pm    Post subject: COBOL-DB2 STANDARD ERROR ROUTINE Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Mon May 23, 2005 8:05 pm    Post subject: Reply with quote

Tommy123,

DSNTIAR is an IBM supplied Error Reporting Routine for DB2. The DSNTIAR program takes error data from SQLCA, adds explanatory text and presents it in a more user friendly format. You can call DSNTIAR from a Cobol program to display a formatted message when an error occurs when accessing DB2.

Check this link which explains in detail about DSNTIAR

http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/DSNAPH10/2.1.5.4?SHELF=&DT=20010209162045&CASE=

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group