Previous Topic: Assignment CommandNext Topic: Conditional Commands


MOVE

Purpose

Moves a value to a target field.

Syntax

►►─── MOVE value to variable ── options ── . ─────────────────────────────────►◄

Expansion of options

►───┬─────────────────────────────────┬──────────────────────────────────────►◄
    ├─ ROUNDED ───────────────────────┤
    ├─ TRUNCATED ─────────────────────┤
    └─ ALLOWING assignment-condition ─┘

Parameters

value

Specifies the value being moved to variable. Value can contain an arithmetic expression, a numeric literal, a user-defined variable, or a literal enclosed in single quotation marks.

to variable

Specifies a variable data field that contains the result of the MOVE operation.

ROUNDED

Rounds the result of the move to the number of decimal positions found in variable.

TRUNCATED

Truncates the result of the move to the number of decimal positions found in variable.

The default specification is ROUNDED if the COBOL moves are enabled option on the Options and Directives screen has not been chosen and TRUNCATED if the option has been chosen.

ALLOWING

Specifies which error conditions would normally abend and should cause control to be returned to the dialog for error handling. The list of allowable assignment-condition names can be found in the section entitled "Arithmetic and Assignment Command Status Condition."

Usage

Consideration

ROUNDED/TRUNCATED is ignored if value is nonnumeric.

Example

The following example illustrates the use of the MOVE command to move the value from the ACCT-BAL field to the TOT-BAL field:

MOVE ACCT-BAL TO TOT-BAL.