Programming Examples

In the example that uses the 850-FIND-BEGRNG-<Index> call, we only define one value for the Sub Account key field. This means that the 850-FIND-BEGRNG-<Index> and 860-FIND-NXTRNG-<Index> calls get only those records where Company, Account, and Sub-Account exactly match the single key field values set in the DB fields.

In this new example, we give two values for the last key field defining the range: a beginning value (in DB-SUB-ACCOUNT ) and an end value (in DBRNG-SUB-ACCOUNT ). The 850-FIND-SUBRNG-<Index> and 860-FIND-NXTRNG-<Index> calls must still get only those records that exactly match the key field values set in the DB fields for Company and Account. However, this time the returned records no longer need to have a value for Sub-Account that exactly matches the key field value defined in the DB field. Instead, the record must have a value for Sub-Account that lies within the range specified by the DB-SUB-ACCOUNT and DBRNG-SUB-ACCOUNT fields.

***     This call processes a subrange of records.
        MOVE WS-COMPANY             TO DB-COMPANY.
        MOVE WS-ACCOUNT             TO DB-ACCOUNT.
        MOVE WS-FROM-SUB-ACCOUNT    TO DB-SUB-ACCOUNT.
        MOVE WS-THRU-SUB-ACCOUNT    TO DBRNG-SUB-ACCOUNT.
        MOVE GLMSET1-SUB-ACCOUNT    TO WS-DB-SUB-RNG.
        PERFORM 850-FIND-SUBRNG-GLMSET1.
        PERFORM
            UNTIL (GLMASTER-NOTFOUND)
            PERFORM 999-PROCESS-GLM
            PERFORM 860-FIND-NXTRNG-GLMSET1
        END-PERFORM.