Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COBOL SQL error trapping question

Status
Not open for further replies.

TonyG

Programmer
Nov 6, 2000
79
US
Is there a way to trap SQL errors in a Fujitsu Net COBOL for Windows program ?
When i use the following code, it compiles and executes OK.

If i change "Default" to something like ":DefaultX" and put ":DefaultX" in the DECLARE section,
it compiles OK, but when i execute, it never gets to the SQLSTATE test but gives this message:

"JMP0371I-U[PID:00000868 TID:00000F28] ENVIRONMENT INFORMATION FILE ERROR TO PERFORM SQL.
'@SQL_USERID'. PGM=CPTEST ADR=00401C5F"

How do you go about trapping these errors before the system displays a message that the user has
no idea of.

Any help appreciated.
Tony

EXEC SQL
CONNECT TO Default
END-EXEC.

If SQLSTATE IS Not = Zeroes
Display "Connect to Default! SQLSTATE: ", SQLSTATE,
Display " ",
Display " CODE = ", SQLCODE,
Display " ",
Display " MSG = ", SQLMSG,
MOVE 1 TO OPENING-PROCEDURE-STATUS,
End-If.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top