I use this code to get the error message from DSNTIAR

CALL_PARM       DS      0F
PARM_1          DC      A(SQLCA)
PARM_2          DC      A(MSGLEN)
PARM_3          DC      A(MSGSIZE)

MSGSIZE         DC      F'72'           LENGTH OF EACH LINE
MSGAREA         DS      H,CL(20*72)     
                ORG     MSGAREA         
MSGLEN          DC      AL2(20*72)      20 lines of 72 bytes
MSG_TEXT        DS      CL72            
                ORG                   

        LA      R1,CALL_PARM                                         
        L       R15,=V(DSNTIAR)             DSNTIAR EXPANDS THE ERROR
        BASR    R14,R15                                              

        LA      R4,MSG_TEXT     POINT TO FIRST 72 BYTE LINE
        LA      R5,20           20 LINES
LOOP    EQU     *
        output  72 bytes to wherever (check >= blanks)
        LA      R4,72(,R4)
        BCT     R5,LOOP

Warning - there could be typos in the above.
You could also check R15 after the call and output a message if not 0. The 
routine used to have 8 lines but in V8 or V9 of DB2 we got RC=4 because the 
message did not fit. As a result we changed to 20 lines.

Hope it helps.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to