(Area 3)
During record selection, this format of the SET command specifies data movement to be performed from one scalar variable or array element to another. You do not need to predefine the result field, but can implicitly define it in the SET command. You should, however, predefine all fields referenced in procedural commands so as to minimize the margin of error.
Data movement during record selection implies that the operation is to be performed prior to the sort, if any, and prior to printing of the reports. Fields from both the input buffer area and the General Storage Area (GSA) can be used as component parts of the SET command. When the result field is then referenced by field name in a subsequent report definition group, the system directs the value to the Hit File for processing.
The SET during record selection command is coded as follows. You can use EQ, EQUAL, TO, or EQUAL TO in place of = (equal sign) in this command.
►►─┬──────────┬─ SET ─────────────────────────────────────────────────────────► └─ label: ─┘ ►─┬─ result ────────┬─ = ─┬─ fieldname ──────────────┬───────────────────────► ├─ result(n1.n2) ─┤ ├─ 'alphanumeric literal' ─┤ └─ result(n1) ────┘ └─ numeric constant ───────┘ ►─┬───────────────────────────────────────────────────────┬─┬─────────┬──────►◄ └─┬─ HEADING ─┬─ ' heading 1 ' ─┬─────────────────────┬─┘ └─ ROUND ─┘ └─ HDG ─────┘ └─ ' ─ heading 2 ─ ' ─┘
Specifies an optional identifying label, possibly referenced within a GOTO command, that allows a GOTO branch to be made to this statement.
Specifies the name given a predefined field or array element to which the data is moved.
Specifies a user-supplied field name to which data is moved. Use of this parameter implicitly defines the field to contain the result.
The n1 and n2 indicate the number of integers and decimals, respectively. The value of n1+n2 must be greater than 0 and must not exceed 15. When the field contains no integers, n1 must be 0. When no decimals are necessary, n2 must be 0.
Specifies a user-supplied field name to which data is moved. Use of this parameter implicitly defines the field to contain the result. The field is generated as an alphanumeric field and resides in the GSA. n1, which indicates the length of the field in bytes, must not exceed 256.
When you omit n1 and do not predefine the result field, the system generates a field with the same length as the sending field, in alphanumeric format.
Specifies the name of a predefined scalar variable or array element, defined as residing in either the input record area or the GSA, and to be moved to the result field.
Specifies an absolute numeric constant to be moved to the result field. Define the receiving field of the SET command as numeric, packed decimal, zoned decimal, binary, or unsigned binary.
Specifies an alphanumeric constant, enclosed in apostrophes, as the sending field. When used, the result field is to be defined as alphanumeric. If the receiving field is larger than the sending field, the receiving field is padded with blanks. If the receiving field is smaller, the literal in the final result is left-justified and truncated.
Is an optional separator used to denote that subsequent literals are to be interpreted as headings. Heading specifications are valid only when the result field of the computation is implicitly defined. HDG can be used in place of HEADING.
Allows the user to assign one or two heading lines to the result field when the field is implicitly defined in the SET command. The heading lines appear as column headings if the field is printed in a report.
If you omit the parameter and implicitly define the result field, the Reporting Facility assigns the field name as heading line 1, with no second heading line.
Optionally defines whether the result will be rounded before being placed into the result field. For rounding to occur, the computed value must have more decimal places than the result field. The default is not to round.
The following command specifications illustrate some practical uses of the SET command:
SET RESULT-FIELD EQUAL TO FIELDB SET RESULT-FIELD(7.2) = 0 HDG 'AMOUNT' 'FIELD' SET FIELDA EQUAL TO ZERO SET INDEX EQ 1 SET FIELDA TO -123.45 SET FIELDB TO 'ABCDEFG'
Note: You cannot specify this format of the SET command in a report definition group.
|
Copyright © 2014 CA.
All rights reserved.
|
|