Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

VARIABLE-TO-STRING( ) Convert variable

&pagelevel(3)&pagelevel

Domain: Conversion functions

The VARIABLE-TO-STRING( ) function converts an S variable of type structure into a string (for further details see section “Converting SDF command strings to S variables and viceversa” (Converting SDF command strings to S variables and vice versa )).

Format

VARIABLE-TO-STRING( )

VAR-TO-STR( )

VARIABLE-NAME = string_expression

Result type

STRING

Input parameters

VARIABLE-NAME = string_expression
Name of the S variable of type structure which is to be converted into a string. The variable name must be enclosed in apostrophes if it is specified as a literal (see the example below and the last example for IS-DECLARED()).

Result

The converted expression, in the form of a string

Error messages

SDP0475    VARIABLE MUST BE A STRUCTURE OR A LIST/ARRAY 
SDP0476    RESULT STRING TOO LONG 
SDP0477    INCORRECT SDF STRUCTURE
SDP1007    NO VARIABLE DECLARED

Example

/DECLARE-VARIABLE MYSTRUCT(TYPE=*STRUCTURE(DEF=*DYNAMIC))
/MYSTRUCT.OPERAND1.SYSSTRUC = ‘VALUE1‘
/MYSTRUCT.OPERAND1.OPERAND2 = ‘VALUE2‘
/MYSTRUCT.OPERAND1.OPERAND3#1 = ‘VALUE3‘
/WRITE-TEXT &(TO-C-LITERAL(VARIABLE-TO-STRING('MYSTRUCT'))) 
OPERAND1 = VALUE1(OPERAND2 =VALUE2, OPERAND3 = (VALUE3))