The application should test SQLCODE after each statement executes, because Adaptive Server updates it after each execution. As a rule, use the whenever statement, described in Chapter 8, “Handling Errors,” to perform the SQLCODE test.
Following are examples of using SQLCODE:
IF SQLCODE = 100
PERFORM END-DATA-PARA.
or
DISPLAY "SQL status code is" SQLCODE.