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 ─┴─┘
Syntax Rules
Specifies the parameter type. It must be coded starting in column 2.
A 1- to 32-character name that identifies the input data field. It can be coded in any column after REC. The name can consist of letters, numbers, or hyphens. The following rules apply to specifying field-name:
When the GROUP keyword is specified on a REC parameter, field-name identifies a group of multiply-occurring input fields or a floating group. The field name cannot be referenced on any other CA Culprit parameters. When the ELMNT keyword is specified on a REC parameter, field-name identifies a field within a group.
Identifies the location of the input field relative to the beginning of the input record. Depending on the record type, the start position of the first input field is specified as follows:
One field can overlap another field. An overlapping input field implicitly redefines the field. With overlapping input fields, a single byte position in a record is defined with different names and characteristics. Users can redefine a single input field any number of times.
When the GROUP keyword is specified on the REC parameter, start-position identifies the location of the group relative to either the beginning of the record or the previously defined group. The start position is the first byte of the group relative to the beginning of the record, unless a variably-repeating group precedes this group in the record, in which case start-position is always 1. This value represents a start position relative to the end of the immediately preceding group.
When the ELMNT keyword is specified on a REC parameter, start-position identifies the location of the field, relative to the beginning of the group. The first field within a group always has a start position of 1.
Specifies the length of the input field in bytes. Field-size is omitted on REC parameters that specify the GROUP keyword. The following table shows the range of sizes valid for field-size by data type.
|
Code |
Data Type |
Size in Bytes |
Sign |
Input File Representation |
|---|---|---|---|---|
|
Omitted |
Alphanumeric |
1-32,760 |
|
1 character per byte |
|
1 |
Binary |
1-8 |
Signed if an even number of bytes |
8 binary positions per byte |
|
2 |
Zoned decimal (EBCDIC) |
1-31 |
Yes |
1 digit per byte |
|
3 |
Packed decimal |
1-16 |
Yes |
2 digits per byte; the low-order portion of the last byte contains a A, B, C, D, E, or F |
|
4 |
Unsigned packed decimal |
1-15 |
No |
2 digits per byte |
|
5 |
Multi-bit binary |
1-32 bits |
No |
Bit string up to 32 bits |
Identifies the way numeric data is stored within a field:
|
Code |
Data type |
|---|---|
|
1 |
A binary input field |
|
2 |
A zoned decimal input field |
|
3 |
A packed decimal input field |
|
4 |
An unsigned packed decimal field |
|
5 |
A multi-bit binary field |
The field size for a multi-bit binary field is 2 to 4 digits:
Refer to the table under field-size for more information on specifying data types. Data-type is not coded for alphanumeric fields or for fields defined on a REC parameter that specifies the GROUP keyword.
CA Culprit does not support floating point input fields. However, the CA-supplied procedure module, CULLUS36 (floating point conversion), converts single- or double-precision floating point fields to 16-byte signed packed decimal numbers with 18 significant digits. CA-supplied procedure modules can also convert packed decimal input fields to binary or zoned decimal formats; these procedure modules are CULLUS33 (numeric field conversion) and CULLUS34 (zoned decimal formatting), respectively.
Indicates the number of digits to the right of an implied decimal point in a numeric input field. This specification is omitted on REC parameters that specify the GROUP keyword.
If decimal-place is not coded for a numeric input field, CA Culprit treats the field as an integer in all calculations used in selection or procedure logic and in automatic totaling. If specified, decimal-place must be a number in the range 0 through 31.
Identifies either a block of related multiply-occurring input fields or a floating group.
Specifies a 2-byte alphanumeric field that identifies the group. Group-id must be unique in the CA Culprit run.
When CA Culprit automatically generates REC parameters for fields defined to IDD, it assigns group ids sequentially, starting with 00. If more than 100 groups are generated, CA Culprit assigns lowercase alphabetic group ids.
Specifies the ID of the variably-repeating group on which the starting position of the floating group is based. This specification is used only with floating groups.
Specifies the length of a single occurrence of repeating data within the group, to a maximum of 32767 bytes.
Specifies a fixed number of field repetitions; it is a number in the range 1 through 32767. A period (.) must separate this value from group-size.
This specification can be omitted for floating groups that occur one time. If a value of 1 is specified for occurrence-count, references to fields within the group must include a subscript.
Specifies the name of a numeric input field in the fixed portion of the record; the value of this field determines the number of repetitions of a variably-repeating group.
Identifies an elementary item within a group of multiply-occurring fields and applies only when the associated group has been defined. One ELMNT parameter is required for each field within a group.
Identifies the ID of the group associated with the field named on the REC parameter containing the ELMNT keyword.
An alphanumeric literal, enclosed in single quotation marks, that can be used as a column header on a printed report. Auto headers are omitted on REC parameters that specify the GROUP keyword. Field definitions on generated REC parameters can have auto-headers associated with them in the data dictionary.
The following coding considerations apply:
An auto-header that is defined on a REC parameter does not print unless it is referenced on a type 5 or type 6 edit parameter.
Examples
Sample REC parameters are shown and described below.
Example 1
REC PURCHASE-ORDER-TOTAL-PRICE 54 4 3 DP=2
PURCHASE-ORDER-TOTAL-PRICE is a 4-byte packed signed decimal field with two decimal places; the field begins at byte 54 of the input record.
Example 2
REC ACCTNO 1 7 'CUSTOMER''S' 'ACCOUNT NUMBER'
This REC parameter defines ACCTNO as a 7-character alphanumeric field that begins at the first byte of the input record. An associated auto-header that contains two literals (CUSTOMER'S and ACCOUNT NUMBER) is also defined.
If the auto-header is requested on an edit parameter, a 2-line heading is centered above the column of account numbers; CUSTOMER'S prints above ACCOUNT NUMBER.
Example 3
REC END-OF-FIELD-INDICATOR 14 54 5
END-OF-FIELD-INDICATOR defines a field that occupies four bits (5 through 8) of the fourteenth byte of the input record. This field can be tested for numeric values in the range 0 through 15 or for binary values in the range 0000 through 1111.
Example 4
REC BINARY-FIELD 0 1 1
BINARY-FIELD defines a 1-byte field that begins in position 0; the data is in binary format. This field can be used in match-file runs to test the status of each file.
Example 5
The REC parameters listed below describe an input record that contains a field that repeats a fixed number of times:
REC POLICY-NUMBER 1 5 3 REC COVERAGE-CODE 6 3 REC EFFECTIVE-DATE 9 6 2 REC MAX-LIABILITY 15 5 3 REC ABSORPTION-GROUP 20 GROUP AA 4.4 REC ANNUAL-COVERAGE 1 4 3 DP=2 ELMNT AA REC RISK-LEVEL 36 1
The COBOL record description for these REC parameters appears below:
01 COVERAGE-DATE
05 POLICY-NUMBER PIC S9(9) COMP-3.
05 COVERAGE-CODE PIC XXX.
05 EFFECTIVE-DATE PIC 9(6).
05 MAX-LIABILITY PIC S9(9) COMP-3.
05 ANNUAL-COVERAGE PIC S9(5)V99 COMP-3 OCCURS 4.
05 RISK-LEVEL PIC X.
ABSORPTION-GROUP is a group that contains a multiply-occurring input field that occurs four times; the length of each group occurrence is four bytes. ABSORPTION-GROUP begins in position 20 of the input record.
ANNUAL-COVERAGE is an elementary item of group AA. It begins in position 1 of group AA; the field is a 4-byte packed decimal field that specifies two decimal places.
RISK-LEVEL is a singly-occurring field that follows group AA. It is assigned a fixed start position because it follows a multiply-occurring group that occurs a fixed number of times.
Example 6
The following REC parameters are similar to those used in the previous example; in this example, the record contains a group of fields that occur a varying number of times:
REC POLICY-NUMBER 5 5 3 REC COVERAGE-CODE 10 3 REC EFFECTIVE-DATE 13 6 REC LOCATION-NUMBER 19 2 3 REC LOCATION-INFO 21 GROUP AA 14.LOCATION-NUMBER REC LOCATION-ID 1 2 ELMNT AA REC LOC-EFF-DATE 3 6 2 ELMNT AA REC LOC-EXP-DATE 9 6 2 ELMNT AA REC OTHER DATA 1 GROUP BB AA 6 REC MAX-LIABILITY 1 5 3 ELMNT BB REC RISK-LEVEL 6 1 ELMNT BB
The COBOL record description for the above REC parameters appears below:
01 COVERAGE-DATA.
05 POLICY-NUMBER PIC S9(9) COMP-3.
05 COVERAGE-CODE PIC XXX.
05 EFFECTIVE-DATE PIC 9(6).
05 LOCATION-NUMBER PIC S9(3) COMP-3.
05 LOCATION-INFO OCCURS 1 TO 25 DEPENDING ON LOCATION-NUMBER.
10 LOCATION-ID PIC XX.
10 LOC-EFF-DATE PIC 9(6).
10 LOC-EXP-DATE PIC 9(6).
05 MAX-LIABLILITY PIC S9(9) COMP-3.
05 RISK-LEVEL PIC X.
POLICY-NUMBER begins in byte 5 of the input record because the file contains variable-length records. The record descriptor word occupies the first four bytes.
LOCATION-INFO is a variably-repeating group that begins in byte 21 of the input record; each occurrence of LOCATION-INFO is 14 bytes long. The value of LOCATION-NUMBER determines how many times LOCATION-INFO repeats.
LOCATION-INFO contains three elementary items identified by ELMNT AA. LOCATION-ID is defined as alphanumeric; the two date fields are defined as zoned decimal.
OTHER-DATA defines a floating group because it follows a variably-repeating group. OTHER-DATA is assigned a start position of 1 relative to the end of LOCATION-INFO; it is linked to LOCATION-INFO by the link-id, AA. The length of group BB is 6 bytes. Because group BB occurs once, the number of group repetitions is omitted. If 1 was specified for the number of group repetitions, every reference to MAX-LIABILITY and RISK-LEVEL would have to be subscripted.
|
Copyright © 2014 CA.
All rights reserved.
|
|