Set

PURPOSE:  The SET command assigns a value to one or more fields.  SET also allows arithmetic and string operations to be performed using system fields, Global Storage fields, or system functions and store the computed value to any valid system field or global storage field..

Syntax

SET exp TO \\field_names\\ [IF; UNLESS clause]

exp

is an expression that may consist of constants (numbers or strings), system fields, Global Storage fields, and system functions-any of which may be connected in a valid series by arithmetic operators or functions to cause a desired computation.  The computed value must be appropriate for the data type of the destination field.

field_names

is one or more field names separated by commas.  The fields may be Global Storage fields or those system fields whose values can be changed.

IF; UNLESS

is a conditional clause.  Only system fields and declared Global Storage fields can be tested.

EXAMPLES

*TYPE @NUMBER
.00
*SET 1.23 TO @NUMBER
*TYPE @NUMBER
1.23
*USE GS PERSON
*SET "RC" TO %INIT
*SET "ADDING."+%INIT TO @STRING(2)
*TYPE @STRING(2)
ADDING.RC
*SET "/" TO @DELIM
*SET "’" + @RTRIM @STRING(2) + "’" TO @STRING(5)
*TYPE @STRING (2)
'ADDING.RC'

NOTES:  The SET command is used to set values to system fields and Global Storage fields and can be used in CM's but not PM's.  Assignment Statements are used within Process Modules to set values in fields.

SEE ALSO:  Assignment Statements in PMs