Assignments

An EGL assignment copies data from one area of memory to another and can copy the result of a numeric or text expression into a source field.


Syntax diagram for the assignment statement
target
A field, record, fixed record, or system variable.

You can specify a substring on the left side of an assignment statement if the target field is of type CHAR, DBCHAR, or UNICODE. The substring area is filled (padded with blanks, if necessary), and the assigned text does not extend beyond the substring area but is truncated, if necessary. For syntax details, see Substrings.

source
A record, fixed record, or a numeric or character expression

Examples of assignments are as follows:

  z = a + b + c;
  myDate = VGVar.currentShortGregorianDate;
  myUser = sysVar.userID;
  myRecord01 = myRecord02;
  myRecord02 = "USER";

The behavior of an EGL assignment statement is different from that of a move statement, which is described in move.

The assignment rules are described in Assignment compatibility in EGL.

Related concepts
Syntax diagram for EGL statements and commands

Related reference
Assignment compatibility in EGL
move
Substrings

Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.