Binyamin, The -818 SQLCode is a timestamp disparity between the load module and the DBRM. Make sure that the WLM which the SP runs in has been properly refreshed since the SP was last built.
-----Original Message----- From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of Binyamin Dissen Sent: Thursday, February 9, 2023 12:03 To: IBM-MAIN@LISTSERV.UA.EDU Subject: New DB2 external Stored Procedure question - setting sqlcode/sqlstate I am trying to return a NOT FOUND condition, so I am setting the SQLSTATE parameter to '02000' However, the calling program is getting DSNT408I SQLCODE = -443, ERROR: ROUTINE SP01 (SPECIFIC NAME SP01) HAS RETURNED AN ERROR SQLSTATE WITH DIAGNOSTIC TEXT DSNT418I SQLSTATE = 02000 SQLSTATE RETURN CODE DSNT415I SQLERRP = DSNXRRTN SQL PROCEDURE DETECTING ERROR DSNT416I SQLERRD = -818 0 0 -1 0 0 SQL DIAGNOSTIC INFORMATION DSNT416I SQLERRD = X'FFFFFCCE' X'00000000' X'00000000' X'FFFFFFFF' X'00000000' X'00000000' SQL DIAGNOSTIC INFORMATION 1. How can I specify the SQLCODE (that is returned to the CALLer)? Return-code doesn't work. 2. How can I specify the SQLSTATE so that NOT FOUND will be the condition? SIGNAL does not appear to work for COBOL code. -- Binyamin Dissen <bdis...@dissensoftware.com> http://www.dissensoftware.com Director, Dissen Software, Bar & Grill - Israel ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN