Purpose
Defines input field characteristics.
Syntax
Col 2 ▼ ►►─── REC field-name start-position field-size ───────────────────────────────► ►─┬─────────────┬──┬───────────────────────┬─────────────────────────────────► └─ data-type ─┘ └─ DP = decimal-places ─┘ ►─┬──────────────────────────────────────────────────────────────────────┬───► ├ GROUP group-id ┬───────────┬ group-size ┬──────────────────────────┬─┤ │ └─ link-id ─┘ ├─ .occurrence-count ──────┤ │ │ └─ .occurrence-field-name ─┘ │ └ ELMNT group-id ──────────────────────────────────────────────────────┘ ►─┬───────────────────┬──────────────────────────────────────────────────────►◄ │ ┌───────────────┐ │ └─▼─ auto-header ─┴─┘
Expansion of Field-name
►►─── data-item-name ─┬────────────────────────────────────────────────┬──────►◄ └─ ( ─┬─ KEYFILE ──────────────┬─┬─────────┬─ ) ─┘ ├─ database-record-name ─┤ └─ level ─┘ ├─ logical-record-name ──┤ └─ table-name ───────────┘
Syntax Rules
Syntax rules for database access, key files, or files defined to the data dictionary are as described under REC Parameter, except for those items explained below:
Specifies a name of a field in a database record, table, key file record, logical record, or record in a file defined to the data dictionary. See expansion of field-name below.
A 1- to 32-character name that identifies the field. It can be coded in any column after REC. The name can consist of letters, numbers, or hyphens. The following coding considerations apply to data-item-name:
A keyword that must be specified if data-item-name resides in a key file.
Specifies the name of the database record associated with the field; the database record must be specified on the PATH parameter.
Specifies the name of the logical record associated with the field; the name must be specified on the PATH parameter.
Specifies the table named on the first (or only) INPUT parameter.
Specifies the relative occurrence level of the database record or logical record within the CA Culprit input buffer. The value is an integer in the range 1 through 256; the default is 1. If specified, level must be separated from the name of the database record or logical record by a comma or a space and must precede a closing parenthesis.
Multiple levels can occur in a database access run under the following circumstances:
PATH01 EMPLOYEE STRUCTURE(MANAGES) * EMPLOYEE(REPORTS-TO)
The first occurrence of a repeating database record on an automatic retrieval PATH parameter is assigned level 1; the second occurrence is assigned level 2, and so on. If the record appears on one or more dummy PATH parameters, the first occurrence on the dummy path is one higher than the highest level for that record on the automatic retrieval path; the second occurrence is one higher than the previous appearance, and so on.
For multiply-occurring fields, level must be specified on the REC parameter that specifies the keyword GROUP as well as on the REC parameter that specifies the keyword ELMNT.
Specifies the start position of the field relative to the beginning of a record or the input buffer; a field that is not qualified by a record name, table name, or KEYFILE refers to a field in a position relative to the beginning of the input buffer.
The Input Parameter Listing indicates the start position of the field in the input buffer. Database and logical records begin in byte position 39 in the input buffer; tables begin in byte position 95, provided the table is not the result of a JOIN operation.
The user-supplied start position is 38 bytes less than the value CA Culprit reports on the Input Parameter Listing (38 bytes represents the amount of input buffer overhead). For example, from the generated REC parameters shown in the screen capture at the end of the Automatically Generated REC Parameters section, the user-supplied start position for PATIENT-NAME-0405 is 7.
Usage
If one of the options KEYFILE/database-record-name/ logical-record-name/table-name is specified, it must be enclosed in parentheses.
If data-item-name is a multiply-occurring field, both the REC parameter that specifies the keyword GROUP and the REC parameter that specifies the keyword ELMNT must qualify data-item-name with one of these options.
Examples
Sample user-supplied REC parameters are shown and described below.
Example 1: KEYFILE-Defined Field
REC KEY-EMP-NAME (KEYFILE) 10 25 'EMPLOYEE NAME'
KEY-EMP-NAME describes a field in a key file record. The 25-byte alphanumeric field starts in byte 10 of the key file record. EMPLOYEE NAME appears as a column heading if the field is referenced on a type 5 edit parameter that specifies header origin code HR.
Example 2: Database Record-Defined Field
REC EMP-ID (EMPLOYEE,1) 1 4 2 'EMPLOYEE ID' REC EMP-NAME (EMPLOYEE,2) 5 25 'EMPLOYEE NAME' PATHAA EMPLOYEE STRUCTURE(MANAGES) EMPLOYEE(REPORTS-TO)
These REC parameters rename the EMP-ID-0415 and EMP-NAME-0415 fields in the EMPLOYEE database record, which appears in Employee Database Subschema. EMP-ID is a field in the first occurrence of the EMPLOYEE database record on the PATH parameter; this 4-byte zoned decimal field begins in position 1 of the EMPLOYEE database record. EMP-NAME is a field in the second occurrence of the EMPLOYEE database record, qualified by (REPORTS TO) on the PATH parameter. This 25-byte alphanumeric field begins in position 5 of the EMPLOYEE database record.
Example 3: Database Record-Defined Field
REC NUMBER-OF-PROCEDURES (DENTAL-CLAIM) 126 2 1 REC CHARGES (DENTAL-CLAIM) 131 GROUP AA * 80.NUMBER-OF-PROCEDURES (DENTAL-CLAIM) REC TOOTH-NUMBER (DENTAL-CLAIM) 1 2 2 ELMNT AA REC SERVICE-DATE (DENTAL-CLAIM) 3 6 2 ELMNT AA REC PROCEDURE-CODE (DENTAL-CLAIM) 9 4 2 ELMNT AA
The fields defined to the data dictionary for the DENTAL-CLAIM record specify -0405 to identify the record. The user-supplied REC parameters in this example alter the data dictionary-defined fields:
The REC parameters define multiply-occurring fields that repeat a variable number of times depending on the value for NUMBER-OF-PROCEDURES. NUMBER-OF-PROCEDURES begins in byte position 126 of the DENTAL-CLAIM record. The REC parameter that specifies the keyword GROUP identifies byte position 131 as the start position of the multiply-occurring fields in the database record. The total length of the multiply-occurring fields associated with GROUP AA is 80 bytes. The three REC parameters that specify the keyword ELMNT identify elements of GROUP AA that occur in the first 12 bytes of the multiply-occurring field.
Example 4: Database Record-Defined Field
REC NUMBER-OF-PROCEDURES-2 (DENTAL-CLAIM,2) 126 2 1 REC CHARGES-2 (DENTAL-CLAIM,2) 131 GROUP AA * 80.NUMBER-OF-PROCEDURES (DENTAL-CLAIM,2) REC TOOTH-NUMBER-2 (DENTAL-CLAIM,2) 1 2 2 ELMNT AA REC SERVICE-DATE-2 (DENTAL-CLAIM,2) 3 6 2 ELMNT AA REC PROCEDURE-CODE-2 (DENTAL-CLAIM,2) 9 4 2 ELMNT AA
This example is the same as Example 3, except that each REC parameter specifies a level number. The level number indicates that the REC parameters define fields in the second occurrence of the DENTAL-CLAIM record in the input buffer. For multiply-occurring field definitions, the occurrence level must be specified for both the REC parameter that defines the group and the REC parameters that define the elements of the group.
Example 5: Logical Record-Defined Field
REC DEPT-ID (EMP-DEPT-LR) 49 4 'DEPARTMENT' 'ID'
DEPT-ID-0410 is a field in the EMP-DEPT-LR. The user-supplied REC parameter renames the field and redefines it as an alphanumeric value. The field begins in byte position 49 of the logical record; it is processed as a 4-byte alphanumeric field. DEPARTMENT ID can appear as a 2-line column header if the field is referenced on a type 5 edit parameter that specifies header origin code HR.
Example 6: Table-Defined Field
INPUT TABLE=ACCOUNTING TYPE=COPY REC DEPT-NAME (ACCOUNTING) 57 25
DEPT-NAME-0410 is the first field in table ACCOUNTING, which the user-defined REC parameter renames DEPT-NAME. The alphanumeric field begins in byte position 57 of the table row for a length of 25 bytes. The CA Culprit supplied REC parameter appears in the Input Parameter Listing as follows:
******** REC START SIZE TYPE DP FIELD-NAME RECORD-NAME,LEVEL ******** REC 00095 00025 DEPT-NAME ACCOUNTING
Note: The generated start position reflects 38 bytes of overhead at the beginning of the input buffer.
|
Copyright © 2014 CA.
All rights reserved.
|
|