HP 3000 Manuals

Factor 1 (Columns 18-27) [ HP RPG/iX Reference Manual ] MPE/iX 5.0 Documentation


HP RPG/iX Reference Manual

Factor 1 (Columns 18-27) 

The Factor 1 field names the 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).

Table 8-3 contains brief descriptions of the Factor 1 field.

          Table 8-3.  Factor 1 (Columns 18-27) 

---------------------------------------------------------------------------------------------
|                                             |                                             |
|                Columns 18-27                |                 Description                 |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| The name of a field, table, array, array    | The field containing the data or (if this   |
| element, or file.                           | is a 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.
They can also specify a message identification number in a User Message
Catalog (see the MSG operation).  Do not use alphanumeric literals in
arithmetic operations.

Alphanumeric literals can contain up to eight characters including
blanks.  When entering them, enclose the characters in quotation marks.
For instance, to use the literal ALPHALIT, enter "ALPHALIT".  (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.)  To include a quotation mark in
the literal itself, enter two quotation marks.  For example, to enter the
literal "NAME", enter """NAME""".

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 normally used with alphanumeric
fields.  *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 Factor 2 Field (or, if the Factor 2
Field is not used, the Result Field).

You can use figurative constants with operations such as CHAIN, COMP,
LOKUP, MOVE, MOVEL, and MOVEA.

Example 

Figure 8-6 gives four examples of how to use the Factor 1 field.  The
operation in line 1 uses a field name DATAX. Lines 2 and 3 use the
numeric literals 10 and -1, respectively.  Line 4 uses the figurative
constant *ZERO.
___________________________________________________________________________________
|                                                                                 |
|                1         2         3         4         5         6         7    |
|            678901234567890123456789012345678901234567890123456789012345678901234|
|              _______________________________________________________            |
|                                                                                 |
|     1     C           DATAX     ADD  100.50    RESULT  82                       |
|            C                      .                                             |
|            C                      .                                             |
|     2     C           10        MULT ALPHA     PROD   102                       |
|     3     C           -1        DIV  ALPHA     QUOTA  102                       |
|            C                      .                                             |
|            C                      .                                             |
|     4     C           *ZERO     COMP QUOTA                                      |
|                                                                                 |
|                                                                                 |
___________________________________________________________________________________

          Figure 8-6.  Using the Factor 1 Field 



MPE/iX 5.0 Documentation