Previous Topic: Assignment OperationsNext Topic: Accessing SQL Defined Tables


Control Operations

Purpose

These control the flow of processing in a CA Culprit report.

Syntax

►►─┬─ PERFORM sequence ───────────────────────────────────────────────┬───────►◄
   ├─ RETURN ─────────────────────────────────────────────────────────┤
   ├─ CALL ─┬─ USnn ────┬─┬─────────────────────────────────────────┬─┤
   │        └─ DB-EXIT ─┘ │     ┌─────────────────────────────┐     │ │
   │                      └─ ( ─▼─┬─ literal ───────────────┬─┴─ ) ─┘ │
   │                              └─ field-name-expression ─┘         │
   │                  ┌─────────────┐                                 │
   └─┬─ PICK ───┬─ ( ─▼─ edit-line ─┴─ ) ─────────────────────────────┘
     ├─ UNPICK ─┤
     ├─ TAKE ───┤
     ├─ RELS ───┤
     └─ DROP ───┘

Syntax Rules

For a discussion of the basic syntax rules, see Control Operations.

For use with a database, the following special syntax rules apply:

CALL DB-EXIT

Instructs CA Culprit to pass processing control to the DB-EXIT facility, which is described in detail in Appendix L, The DB-EXIT Facility.

literal/field-name-expression

Specifies literals, input fields, or work fields whose values are used as arguments for the DB-EXIT call. CA Culprit moves each value to an ARGn field.

As many as nine arguments can be specified. The argument values must be specified in sequence; that is, ARG1 corresponds to the first value in the list, ARG2 corresponds to the second argument in the list, and so on.

Argument values for each type of DB-EXIT call appear in Appendix L, The DB-EXIT Facility.

Examples

Sample process parameters are shown and described below.

Example 1

017010 PATH-ID EQ 'AA' TAKE

CA Culprit compares the value of the PATH-ID field in the input buffer to AA. If the comparison is true, CA Culprit extracts all the type 5 edit parameters coded for Report 01.

Example 2

017010 MOVE 'OWNER'            TO ARG1
017020 MOVE 'NON-HOSP-CLAIM '  TO ARG2
017030 MOVE 'COVERAGE-CLAIMS ' TO ARG3
017040 IF REC-NAME EQ 'NON-HOSP-CLAIM' DB-EXIT

The MOVE operations transfer literal values to arguments that are associated with a branch to DB-EXIT. CA Culprit branches to DB-EXIT if the value of REC-NAME in the input buffer equals the database record named in process statement 040.

Example 3

017010 IF REC-NAME EQ 'NON-HOSP-CLAIM' 500
              -
              -
017500 CALL DB-EXIT ('OWNER' 'NON-HOSP-CLAIM ' 'COVERAGE-CLAIMS ')

This example illustrates an alternate method to execute a branch to DB-EXIT. CA Culprit compares the value of REC-NAME in the input buffer to the literal coded on process statement 010. If the comparison is true, CA Culprit branches to process statement 500 and calls the DB-EXIT facility, using the literals within the parentheses as values for ARG1, ARG2, and ARG3, respectively.