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 "efaultX" and put "efaultX" 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.
When i use the following code, it compiles and executes OK.
If i change "Default" to something like "efaultX" and put "efaultX" 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.