Previous Topic: LOAD CommandNext Topic: MULTIPLY Command


MOVE Command

(Area 3)

The MOVE command moves a constant or the contents of a predefined field to another predefined field.

The format of the MOVE command is as follows:

►►─┬──────────┬─ MOVE ─ predefined field ─┬──────┬─ fieldname2 ───────────────►◄
   └─ label: ─┘                           └─ TO ─┘
label:

Specifies an optional identifying label, possibly referenced within a GOTO command, that allows a GOTO branch to be made to this statement.

predefined field

The predefined field can be any of the following:

numeric constant

Specifies an absolute numeric constant to be used as the sending field. When a numeric constant is referenced, you must define fieldname2 as zoned decimal, packed decimal, binary, or unsigned binary.

'alphanumeric literal'

Specifies an alphanumeric constant, enclosed in apostrophes, as the sending field. When used, you must define fieldname2 as alphanumeric.

hexadecimal

Specifies a hexadecimal literal, coded in the format literal X'nn', where nn represents an even number of valid hexadecimal digits to be used as the sending field. When used, you must define fieldname2 as alphanumeric.

LOW-VALUE

Specifies that fieldname2 is to be filled with binary low-values. Define fieldname2 as alphanumeric.

HIGH-VALUE

Specifies that fieldname2 is to be filled with binary high-values.

SPACE

Specifies that fieldname2 is to be initialized to blanks.

ZERO

Specifies that fieldname2 is to be initialized to zero, based on the type code associated with fieldname2. Predefine fieldname2 as zoned decimal, packed decimal, binary, or unsigned binary.

fieldname2

Specifies the name given a predefined field whose value represents the receiving field. You must predefine the field name.

The following is a sample input card file definition with some fields defined in the GSA. These fields illustrate some practical uses of the MOVE command.

Example

 INPT: FILE CARD
       DEFINE  COMPANY-NAME                 1-20     X     fields in an
       DEFINE  COMPANY-NUMBER              21-23     N     input buffer
       DEFINE  DEPARTMENT                     24     X
       DEFINE  COMMISSION                  25-31     P2
       DEFINE  YTD-SALES                   32-40     P2
       DEFINE  EMPLOYEE-NUMBER             41-45     N
       DEFINE WORK-FIELD(10)=' '                           miscellaneous
       DEFINE WORK-FIELD-2 EQ                              fields in
            WORK-FIELD                       1-4     B     the GSA
       DEFINE  ARRAY(4)=' '
       OCCURS 10 TIMES
       DEFINE  COMMISSION(5.2)=0
       DEFINE  INDEX(2.0)=1
 MOVE SPACES TO WORK-FIELD
 MOVE ZERO TO WORK-FIELD-2
 MOVE ARRAY(INDEX) TO WORK-FIELD
 MOVE INPT.COMMISSION TO GSA.COMMISSION
 MOVE LOW-VALUES TO ARRAY(9)
 MOVE X'C1C2C3C4C5' TO WORK-FIELD
 MOVE HIGH-VALUE TO DEPARTMENT
 MOVE COMPANY-NUMBER TO ARRAY(INDEX)

Note the following: