Technical data

DB statement—Use the DBQ utility BIND command to identify the
subschema you will use for testing and debugging. You cannot access a
subschema until you bind it. If your program has this DB statement:
DB PARTSS3 WITHIN PARTS FOR NEW.
the comparable BIND statement is as follows:
dbq>BIND PARTSS3 FOR NEW
ANY clause—The DBQ utility does not allow the ANY clause in a Record
Selection Expression. Instead, use the FIRST clause.
DUPLICATE clause—The DBQ utility does not allow the DUPLICATE clause
in a Record Selection Expression. Instead, use the NEXT clause.
WHERE clause—The operators of this clause are different.
For a complete discussion of generic DML, refer to the Oracle CODASYL DBMS
documentation on data manipulation and programming.
7.2 Sample Debugging and Testing Session
This section shows how to use the DBQ utility for debugging and testing HP
COBOL DML programs. Because the split screen limits the number of lines that
can be displayed at one time, the split screen figures show the Bachman diagram
only. Corresponding DBQ prompts, entries, and messages follow each Bachman
diagram and are shown in their entirety.
The session tests and finds a logic error in the DML program statements in
Example 7–1. The sample COBOL DML program is intended to:
1. Fetch the first PART in the database with a PART_ID equal to AZ177311
2. Fetch all SUPPLY records for the found PART
3. Check the PART’s SUPPLY records for SUP_RATINGs equal to 0
4. Change all SUP_RATINGs equal to 0 to 5, and print SUPPLY records
VENDOR_SUPPLY owners
5. Change PART’s PART_STATUS to X if one or more of its SUPPLY records has
a SUP_RATING equal to 5
Remember, the database key values displayed on your screen may be different
from those in the examples.
Note
If you are currently accessing PARTSS3 with the DBQ utility and have
made any changes to the database, use the ROLLBACK statement to
cancel your changes. Otherwise, you might change the results of the
debugging session.
7–2 Debugging and Testing HP COBOL DML Programs