Purpose
Specify selection criteria that are applied to each input record.
Syntax
Col 2 ▼ ►►─┬─ SELect ─┬───────────────────────────────────────────────────────────────► └─ BYPass ─┘ ►─┬──────────────────────────────────────────────────────────────────┬───────► ├─ BUFFER ───────────────────────────────────────────────────────┬─┘ └┬─ database-record-name ─┬─┬────────────────┬─ in PATH path-id ─┘ └─ logical-record-name ──┘ └─ record-level ─┘ ►─── when boolean-expression ────────────────────────────────────────────────►◄
Expansion of boolean-expression
┌───────────────────────────┬─ AND ─┬────────────────────────────────────┐ │ └─ OR -─┘ │ ►►─▼─┬ literal ──────────────┬ test-operation ─┬┬─ NUMERIC ───────────────┬┬┴─►◄ └ field-name-expression ┘ │├─ literal ───────────────┤│ │└─ field-name-expression ─┘│ └ ( field-name-range ) ─────┘
Expansion of field-name-expression
►►─┬── field-name ──┬──& Lh.──────────────────┬────┬──────────────────────────►◄ │ ├─ .subscript-value ──────┤ │ │ └─ .subscript-field-name ─┘ │ ├─ DBKEY ───────────────────────────────────────┤ ├─ DBKEY-PAGE ──────────────────────────────────┤ ├─ DBKEY-LINE ──────────────────────────────────┤ ├─ DBKEY-ALPHA ─────────────────────────────────┤ └─ REC-NAME ────────────────────────────────────┘
Expansion of Field-name-range
►►──┬─ literal ───────────────┬─ TO ──┬─ literal ───────────────┬─────────────►◄ └─ field-name-expression ─┘ └─ field-name-expression ─┘
Syntax Rules
Except as described below, syntax rules for SELECT/BYPASS parameters are the same as those described under SELECT/BYPASS Parameters. Special syntax rules that apply to database access follow:
Specifies the name of either a database record, logical record, or a table in a preceding PATH parameter:
CA Culprit evaluates multiple SELECT/BYPASS parameters in the following manner:
PATHAA DEPARTMENT EMPLOYEE SELECT DEPARTMENT WHEN DEPT-ID-0410 EQ (5100 3200) SELECT DEPARTMENT WHEN DEPT-NAME-0410 EQ 'BRAINSTORMING'
PATHAA DEPARTMENT EMPLOYEE SELECT DEPARTMENT WHEN DEPT-ID-0410 EQ 5100 SELECT EMPLOYEE WHEN EMP-LAST-NAME-0415 EQ 'CRANE'
Applies when the named record occurs more than once on a single path. Record-level is an integer in the range 1 through 256 that specifies the occurrence level of the named record; the default is 1.
Specifies that the selection criteria apply to the named record on a particular path; path-id must be a primary path id. If no path ID is specified, the selection criteria apply to all preceding PATH parameters that specify the named record.
CA Culprit tests this expression at run time when it retrieves a record or fills an input buffer. See the expanded syntax described below.
Syntax rules for this expression are described in Chapter 3, Input Definition Parameters. The following considerations apply to database access:
PATHAA DEPARTMENT EMPLOYEE EXPERTISE PATHBB DEPARTMENT EMPLOYEE COVERAGE SELECT EMPLOYEE WHEN EMP-ID-0415 EQ 0054
Therefore, the selection criteria that are applied to path AA cannot be changed before they are applied to path BB by changing the value of a global work field within the procedure logic of a report, as shown below:
GW0 ID 0054 SELECT EMPLOYEE WHEN EMP-ID-0415 EQ ID
PATHAA DEPARTMENT EMPLOYEE EMPOSITION SELECT EMPLOYEE WHEN DEPT-ID-0410 EQ 4000
Examples
Sample SELECT/BYPASS parameters are shown and described below.
Example 1
PATH01 EMPLOYEE COVERAGE SELECT EMPLOYEE IN PATH 01 WHEN EMP-ID-0415 LT 0100
CA Culprit selects all EMPLOYEE records in path 01 that have an employee ID value less than 100. CA Culprit will not retrieve the COVERAGE records for employees with an ID that exceeds this limit, and will not return a string for path 01.
Example 2
PATH01 EMPLOYEE DEPARTMENT PATH02 EMPLOYEE COVERAGE SELECT EMPLOYEE WHEN EMP-ID-0415 LT 0100
This example is similar to Example 1, except that the SELECT parameter does not specify a path id. In this case, CA Culprit applies the selection criteria to both path 01 and path 02.
Example 3
PATH01 EMPLOYEE(02) DEPARTMENT SELECT EMPLOYEE WHEN EMP-ID-0415 LT 0100
For each employee record with an employee ID less than 100, CA Culprit returns a string consisting of the EMPLOYEE record and the DEPARTMENT record; the path ID is 01. For all other employee records, CA Culprit returns a string that contains the EMPLOYEE record; the path ID is 02.
Example 4
PATHB7 DEPARTMENT EMPLOYEE EXPERTISE SELECT EMPLOYEE WHEN EMP-ID-0415 EQ (0048 0053 0074) SELECT EMPLOYEE WHEN DEPT-ID-0410 EQ 4000
Of the strings returned to the input buffer for path B7, CA Culprit selects only those strings that specify either the employee ID or department ID values coded on the SELECT parameters.
Example 5
PATHB8 DEPARTMENT EMPLOYEE EXPERTISE SELECT EMPLOYEE WHEN EMP-ID-0415 EQ (0048 0053 0074) SELECT DEPARTMENT WHEN DEPT-ID-0410 EQ 4000
This example differs from the preceding example because the two SELECT parameters specify different database record names. Of the strings returned for path B8, CA Culprit selects only those strings that specify both 4000 for the department ID and 0048, 0053, or 0074 for the employee id.
Example 6
KEYFILE 80 KF=5 4 REC EMP-ID (KEYFILE) 5 4 2 BYPASS EMP-ID EQ (0479 0329 0015)
The KEYFILE parameter describes the characteristics of a sequential file that contains employee ID key values. The BYPASS parameter instructs CA Culprit to ignore all key file records with employee ID values equal to the values in parentheses.
Example 7
INPUT TABLE=ACCOUNTING TYPE=COPY INPUT TABLE=PERSONNEL TYPE=CONSOL SELECT ACCOUNTING WHEN EMP-NAME-0415 GT 'M'
In this example, CA Culprit consolidates the tables ACCOUNTING and PERSONNEL. The SELECT parameter processes only those rows in both tables where the employee's name begins with the letters in the range N through Z.
|
Copyright © 2014 CA.
All rights reserved.
|
|