Assignment variable
An assignment variable expressed as :length and <data-type> is useful to force the conversion of a field from one data-type, size and/or precision to another. The expression shown in the following example will cause the field beginning in column 14 (a 4-byte variable in zoned decimal format) to be converted into a 6-byte packed decimal field, with two decimal digits added to the right.
An assignment variable is also useful to force the result of a computation into a particular data-type, size and/or precision. For example, the characteristics of the value resulting from the expression shown in the following example will be 3.0P. (The first operand is converted to a 3-byte packed decimal value, and the second is converted to a 1-byte packed value. No decimal alignment is required. The size of the result will be the size of the larger operand).
If it is desired that the result be returned to zoned decimal format, a conversion such as the following example could be used.
edit picture
An assignment variable expressed as :<edit picture> is useful for converting a source value into an EBCDIC character string to perform the following:
- Numeric edit picture.
To format a numeric value into an EBCDIC character string - Date edit picture.
To format a date time value into an EBCDIC char string
Numeric edit picture | The following examples illustrate numeric edit picture masks: The first character of the picture string must be one of those shown in the following table:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Date edit picture | The date edit picture can contain substitution masks as shown in the following table. Any character string that does not match a substitution mask will appear unmodified in the result. The Example column in the following table shows the value generated if the data/time source value is Monday, January 18, 1999 at 17:42:16.743.205 Central Standard Time. Valid substitution masks for edit picture
An example of a edit picture containing a date mask for conversion follows: :'%YYYY%/%MO%/%DD%' := SYSDATE() This conversion mask would result in an 8-byte character string containing the formatted system date 1999/01/18. |