Corrections to Chapter 2
Pages 66-69
If an SQLCODE other than 0 or 100 is encountered when a row is fetched
in module 170 of the sales inquiry program, the current code in that module
does not end the PERFORM 160 loop in module 140 that gets invoice information
UNTIL END-OF-INVOICES. You can correct this problem using one of two techniques.
First, you can add another condition to the PERFORM 160 statement so it
looks like this:
PERFORM 160-GET-INVOICE-INFORMATION
UNTIL END-OF-INVOICES
OR NOT VALID-CURSOR
You can also correct this problem by modifying the error checking code
in module 170 like this:
IF SQLCODE NOT = 0
MOVE 'Y' TO END-OF-INVOICES-SW
IF SQLCODE NOT = 100
MOVE 'N' TO VALID-CURSOR-SW
If you make this change, you can also remove the IF VALID-CURSOR statement
from module 160, since the END-OF-INVOICES condition in that module will
always be true if the cursor is not valid.
|