Factor 2 (Columns 33-42) [ HP RPG/iX Reference Manual ] MPE/iX 5.0 Documentation
HP RPG/iX Reference Manual
Factor 2 (Columns 33-42)
The Factor 2 field names an operand to use in the operation. What you
enter in this field depends on the operation you're using (see the
description for the operation in this chapter).
--------------------------------------------------------------------------------------------
| | |
| Columns 33-42 | Description |
| | |
--------------------------------------------------------------------------------------------
| | |
| The name of a field, table, array, | The field containing the data or (if this is a |
| array element, or file. | file) the name of the file. |
| | |
| Subroutine name. | The internal subroutine to execute. |
| | |
| A label. | The label for a TAG, ENDSR, or GOTO operation. |
| | |
| An alphanumeric, numeric literal, or a | The actual data to be used. |
| figurative constant. | |
| | |
| Blank. | The operation does not use an operand in this |
| | field. |
| | |
--------------------------------------------------------------------------------------------
Field, Table, Array, Subroutine, and Label Names
You must define field names that you enter in this field somewhere in the
program. Some field names, however, are predefined; you can use them
without defining them. These fields are UDATE, UMONTH, UDAY, UYEAR,
PAGE, PAGE1-PAGE7, and *ERROR.
Alphanumeric Literals
Alphanumeric literals are constants that consist of ASCII characters.
Alphanumeric literals can contain up to eight characters including
blanks. Do not use alphanumeric literals in arithmetic operations.
When entering alphanumeric literals, enclose them in quotation marks.
For instance, to use the literal ALPHALIT, enter "ALPHALIT". To include
a quotation mark in the literal itself, enter two quotation marks. For
example, to enter the literal NAME, enter """NAME""".
If you want to use apostrophes instead of quotation marks to enclose
alphanumeric literals, enter the apostrophe in the QUOTE= parameter of
the $CONTROL compiler subsystem command.
Numeric Literals
A numeric literal is the actual number that is used in the operation.
Use numeric literals the same way you use field names. Numeric literals
can contain up to ten characters, including a decimal point and a leading
plus or minus sign (unsigned literals are treated as positive numbers).
For example, 123.68 is a valid numeric literal.
Do not embed blanks in numeric literals and do not enclose them in
quotation marks.
Figurative Constants
Figurative constants are predefined names that, when used, produce one or
more identical characters. The figurative constants *BLANK and *BLANKS
produce one or more blanks and are used with alphanumeric fields only.
*ZERO and *ZEROS produce one or more zeros and are used with either
numeric or alphanumeric fields. The number of blanks or zeros produced
depends on the size of the Result Field.
You can use figurative constants only with the operations CHAIN, COMP,
LOKUP, MOVE, MOVEL, and MOVEA.
Example
Figure 8-47 gives four examples of how to use the Factor 2 Field. The
operations starting in line 1 use alphanumeric literals. The ADD
operation in line 2 uses a numeric literal and the operation in line 3
uses a field name. Finally, the operations starting in line 4 use
figurative constants.
________________________________________________________________________________
| |
| 1 2 3 4 5 6 7 |
| 678901234567890123456789012345678901234567890123456789012345678901234|
| _______________________________________________________ |
| |
| 1 C MOVE "AFRES" SERV 10 |
| C MOVE "2001" TITLE 15 |
| C . |
| C . |
| 2 C DATAX ADD 100.50 RESULT 82 |
| C . |
| C . |
| 3 C 10 MULT ALPHA PROD 102 |
| C . |
| C . |
| 4 C MOVE *ZEROS RESULT |
| C MOVE *BLANK TITLE |
| C MOVE *ZEROS QUOTA 64 |
| C MOVE *BLANKS SERV |
| |
| |
| |
________________________________________________________________________________
Figure 8-47. Using the Factor 2 Field (columns 33-42)
MPE/iX 5.0 Documentation