A scalar variable is a single data occurrence located in either the General Storage Area (GSA) or the input record area. You must assign attributes describing the type of occurrence, giving it a location that references the field name associated with it. Scalar variables are the smallest addressable unit in a Reporting Facility program.
The primary method of defining a scalar variable is with the DEFINE command, but you can also define scalar variables using the implicit field definition facilities supplied by the SET, COMPUTE, or DECODE commands.
When defining a scalar variable, assign specific attributes describing the type of variable. You must define a scalar variable as one of the following:
You can assign any of the above attributes to a variable defined in an input record area. Variables defined as residing in the GSA can be defined as being numeric or alphanumeric only.
Reference to the newly assigned field name results in the alternate type of the occurrence being processed. For example, define and initialize a numeric zoned decimal variable in the GSA as shown:
DEFINE ALPHANUMERIC-FIELD(7)=' ' DEFINE ZONED-DECIMAL-FIELD EQ ALPHANUMERIC-FIELD 1-7 N . . . MOVE ZERO TO ZONED-DECIMAL-FIELD
|
Copyright © 2014 CA.
All rights reserved.
|
|