Previous Topic: Numeric-oriented Source Types

Next Topic: NDB Concepts

Transparent Source Types

Regardless of the target type, the local form of the source data is assigned to the target unchanged, that is, the local form of the source data becomes the local form of the target.

An exception is that the conversion of local form source data to a BOOLEAN typed target results in local form X'00' (FALSE) if the source is non-zero. Otherwise, the target local form is converted to X'01' (TRUE).

The external outputs of the source and target values can differ, depending on their respective types.

A type check results if the data is invalid for the source or target types.

Example:Transparent Source Types

&ASSIGN MDO=a.b.prt TYPE=OCTET DATA=AB.C
                   -* target type is PrintableString
&ASSIGN VARS=RESULT FROM MDO=a.b.prt
                   -* returns &RESULT = AB.C
&ASSIGN MDO=a.b.hex DATA=FF
                   -* source type is HEX STRING
&ASSIGN VARS=RESULT FROM MDO=a.b.hex TYPE=INT
                   -* target type is INTEGER
                   -* returns &RESULT = -1
&ASSIGN MDO=a.b.any DATA=DEFG
                   -* source type is ANY
&ASSIGN MDO=a.b.hex FROM MDO=a.b.any
                   -* target type is HEX STRING
&ASSIGN VARS=RESULT FROM MDO=a.b.hex
                   -* returns &RESULT = C4C5C6C7