Purpose
Specifies the characteristics of a sequential file that contains key values.
Syntax
Col 2 ▼ ►►─── KEYfile ─┬────────────────────────────────────────────┬─────────────────► └─ record-size ─┬─ F ◄─┬───┬──────────────┬─┘ ├─ V ───┤ └─ block-size ─┘ └─ U ───┘ ►─┬──PS ◄──┬───────────────────┬───┬───┬─────────────────────┬───────────────► │ └─ ( device-type ) ─┘ │ │ ┌─────────────────┐ │ ├─ IS ───┬───────────────────┬───┤ └─▼─ input-options ─┴─┘ │ └─ ( device-type ) ─┘ │ ├─ CARD ─────────────────────────┤ ├─ VS ───────────────────────────┤ └─ UM ( module-name ) ───────────┘ ►──┬───────────────────────────────────────────────────────────────────────┬──►◄ │ ┌─────────────────────────────────────────────────────────────────┐ │ └──▼─┬─ KF = start-position ─┬─ field-size ─┬──────────────────────┬─┴──┘ │ └─ DBK ────────┘ │ ├─ DD = ─┬─┬─ SYS002 ◄──┬───────────────┬─────────────────────┤ │ │ └─ ddname ───┘ │ │ │ ├─┬─ SYS002,002 ◄────────────┬─┤ │ │ │ └─ file-name logical-unit ─┘ │ │ │ └─┬─ SYS002 ◄ ──┬──────────────┘ │ │ └─ link-name ─┘ │ ├─ DD2 = file-name logical-unit ──────────────────────────────┤ ├─ FN = file-name ─┬───────────┬──────────────────────────────┤ │ └─ version ─┘ │ ├─ LT = ─┬─ S ◄ ┬┬──────────────────────────────────────────┬─┤ │ ├─ N ──┤└─ skip-file-count ─┬────────────────────┬─┘ │ │ └─ A ──┘ └─ skip-block-count ─┘ │ │ │ └─ LRFNAME = lr-field-name ┬─────────────────────────────────┬┘ └ database-record-name OF lr-name ┘
Syntax Rules
Syntax rules for the KEYFILE parameter are the same as those described for the INPUT parameter in Chapter 3, Input Definition Parameters, with the exception of special KEYFILE characteristics described below:
Identifies the parameter type; it must be coded starting in column 2.
A keyword expression that indicates the location and size of the key field in the sequential file. This keyword expression must be specified under the following circumstances:
Specifies the starting position of the key field in the key file record.
Specifies the length, in bytes, of the key field, if it is not a db-key field. Field-size must be the same value as the length of the field in the database record, logical record, or a table.
A keyword that identifies start-position as the beginning of a db-key. The key file must contain db-key values in an 8-digit hexadecimal format. Leading zeros, if any, must be included.
Specifies the ddname (z/OS or z/VM), filename (z/VSE), or linkname for the key file.
(z/OS and z/VM only). Specifies the name assigned to the DD or FILEDEF statement that defines the key file; the default is SYS002.
(z/VSE only) Specifies the name assigned to the input file in execution JCL and the number of the device on which the appropriate file resides; the default is SYS002,002.
Logical-unit must be a number in the range 0 through 255. When DD=file-name is specified, logical-unit must also be specified. The default logical unit number is 002.
Specifies that the key file is defined to the data dictionary.
The name of the sequential file defined to the Integrated Data Dictionary (IDD). If the name contains special characters (that is, anything other than letters, numbers, or hyphens), it must be enclosed in single quotation marks.
Optionally identifies the version of the file to be accessed. If version is omitted, CA Culprit accesses the highest version number for the named file.
When the KEYFILE parameter specifies a FN= keyword expression, IDD automatically supplies CA Culprit with the characteristics used to define the file to the data dictionary. If appropriate values are set in the data dictionary, the user can omit the following file characteristics from the KEYFILE parameter: the record size, record type, block size, file type, device type, or user module name or label type.
IDD also automatically generates a REC parameter for each key file field referenced on other CA Culprit parameters. Depending upon the security features in effect, the user may or may not be able to redefine a key file field by coding a user-supplied REC parameter.
Note: If the WHERE clause references a key file field, the field must be defined to the data dictionary; that is, it cannot be a user-defined field.
Identifies either a logical record field in the CA Culprit input buffer or a table column name. This keyword expression is required only when the WHERE clause on the PATH or INPUT parameter specifies KEY-VALUE.
For each record in the key file, CA Culprit places the key value into the input buffer field identified by the LRFNAME= keyword expression. References to KEY-VALUE in the WHERE clause then access the value in the input buffer field. Each logical record that meets the criteria specified in the WHERE clause is processed. CA Culprit resets the input buffer value before it retrieves the next logical record occurrence in case the value was altered by the previous DBA-specified retrieval path.
Is either the name of a field in the logical record or a table column name. The size and data type of the field must be the same as that defined for the key file field. For example, if the logical record field contains a 2-byte binary value, the values in the key file must be 2-byte binary values.
Is required if lr-field-name:
If specified, this expression must be enclosed in parentheses.
When the field name is the name of a column in a table view, database-record-name exists in the form RFUR-nnnnnn-DATA, where nnnnnn is the table definition number (TDN) of the source table. The TDN appears on ASF's Table Definition screen. It also appears as the numeric portion of the subschema value assigned to the source table in CA Culprit's Input Parameter Listing.
In addition, lr-name is the logical record name assigned to the table view. The name appears in ASF's Extended Table Definition screen. It also appears in the LR-NAME field in CA Culprit's Input Parameter Listing.
Examples
Example 1: KEYFILE Parameter and CALC-key Values
PATHAA DEPARTMENT EMPLOYEE KEYFILE 80 KF=10 4
The sequential file defined by the KEYFILE parameter contains 80-byte fixed-length records. By default, the file is identified on DD statement SYS002. The key file field begins in position 10 for 4 bytes. The key values must be CALC-key values because the entry record on the PATH parameter is a database record that is not accessed by using an index.
Example 2: KEYFILE Parameter and Db-key Values
PATH01 EMPLOYEE DEPARTMENT PATH02 EMPLOYEE OFFICE KEYFILE 150 F 300 PS(TAPE) KF=5 DBK
The sequential tape file contains 150-byte fixed-length records; each block contains two records. The file contains the db-key values for database record occurrences of the EMPLOYEE record; each db-key value is an 8-character hexadecimal (4-byte) value that starts in position 5 of the key file record. CA Culprit retrieves all EMPLOYEE records that have associated db-key values and related DEPARTMENT and OFFICE records.
Example 3: KEYFILE Parameter and Associated REC and SELECT Parameters
PATH01 EMPLOYEE DEPARTMENT PATH02 EMPLOYEE OFFICE KEYFILE 150 F 300 PS(TAPE) KF=5 DBK REC EMP-ID (KEYFILE) 20 4 SELECT EMP-ID (KEYFILE) EQ (0001 TO 0099)
This example is similar to the one above except that CA Culprit selects key file records that have a value for EMP-ID in the range 1 through 99. The REC parameter identifies EMP-ID as a field in a keyfile. The SELECT parameter applies the selection criteria to the key file values. After the key file records are selected, CA Culprit accesses only those record occurrences that have db-keys equal to the key file values.
Example 4: KEYFILE Parameter and Automatic File Definition
KEYFILE FN=EMPL-FILE KF=23 10
In this example, the sequential key file is fully defined to the data dictionary. IDD supplies CA Culprit with the characteristics of the file, such as the record length and record type. The 10-byte field that contains the key values starts in position 23 of each key file record.
Example 5: KEYFILE Parameter and Logical Record Key Values
PATH01 DEPT-EMP-LR WHERE EMP-LAST-NAME EQ KEY-VALUE KEYFILE CARD KF=10 15 LRFNAME=EMP-LAST-NAME
The key values in this card file begin in position 10 of each card for 15 bytes. CA Culprit compares the key file values to the value of EMP-LAST-NAME in the logical record. If the values match, CA Culprit retrieves all DEPT-EMP-LR logical records that specify the key file value.
Example 6: KEYFILE Parameters and Logical Record Key Values
PATH03 DEPT-EMP-LR WHERE EMP-NAME EQ KEY-EMP-NAME * AND DEPT-ID EQ 5100 KEYFILE FN=KEY-EMP-FILE
KEY-EMP-FILE is the name of the key file defined to the data dictionary. KEY-EMP-NAME, which appears on the PATH parameter, is a field in the key file. CA Culprit retrieves all logical records where the value for the logical record field EMP-NAME equals the value of the key file field and where the value of the department ID in the logical record is 5100.
Example 7: KEYFILE Parameter and Data Table Columns
INPUT TABLE=PERSONNEL TYPE=COPY * WHERE EMP-ID-0415 EQ KEY-VALUE KEYFILE 80 KF=1 4 LRFNAME=EMP-ID-0415
The key file contains employee ids starting in position 1 for a length of four bytes. CA Culprit accesses all rows in table PERSONNEL where the value in column EMP-ID-0415 is the same as the ID in the key file field.
|
Copyright © 2014 CA.
All rights reserved.
|
|