Types of Expressions

In this section:

An expression can be one of the following:

Expressions and Field Formats

When you use an expression to assign a value to a field, make sure that you give the field a format that is consistent with the value returned by the expression. For example, if you use a character expression to concatenate a first name and last name and assign it to the field FULL_NAME, make sure you define the field as character.

Example: Assigning a Field Format of Sufficient Length

The following example contains a character expression that concatenates a first name and last name to derive the full name. It assigns the field FULL_NAME an alphanumeric format of sufficient length to accommodate the concatenated name:

DEFINE FILE EMPLOYEE
FULL_NAME/A25 = FIRST_NAME | LAST_NAME;
END
TABLE FILE EMPLOYEE
PRINT FULL_NAME
WHERE LAST_NAME IS 'BLACKWOOD'
END

The output is:

FULL_NAME          
---------          
ROSEMARIE BLACKWOOD