Skip to main content

Is there any way of moving one character of a string variable into another variable in the Dialog System? For example:

 

YES-STRING  X 3

Y-STRING      X 1

 

The 'YES-STRING' contains the word "YES" and I would like to move the letter 'Y' from the 'YES-STRING' to the 'Y-STRING'. I can do this in the COBOL program by doing the following :

MOVE YES-STRING(1:1) TO Y-STRING.   

 

But can this be done in the dialog? I know the Dialog System can move entire variable such as:

  MOVE YEST-STRING Y-STRING

 

But I want to be able to move just a character of a string to another variable in the Dialog System. Thanks in advance for your help.

 

- Alex Castro

Is there any way of moving one character of a string variable into another variable in the Dialog System? For example:

 

YES-STRING  X 3

Y-STRING      X 1

 

The 'YES-STRING' contains the word "YES" and I would like to move the letter 'Y' from the 'YES-STRING' to the 'Y-STRING'. I can do this in the COBOL program by doing the following :

MOVE YES-STRING(1:1) TO Y-STRING.   

 

But can this be done in the dialog? I know the Dialog System can move entire variable such as:

  MOVE YEST-STRING Y-STRING

 

But I want to be able to move just a character of a string to another variable in the Dialog System. Thanks in advance for your help.

 

- Alex Castro

Reference modification does not appear to be supported directly in Dialog System script. Subscripting is but not reference modification. The standard COBOL rules for truncation will apply so if you move a 3 character field to a 1 character field then only 1 character will be moved. If you need to do more extensive formatting then you could always do a callout to a COBOL subprogram that would format the data fields for you and then return to Dialog System script afterwards.

Is there any way of moving one character of a string variable into another variable in the Dialog System? For example:

 

YES-STRING  X 3

Y-STRING      X 1

 

The 'YES-STRING' contains the word "YES" and I would like to move the letter 'Y' from the 'YES-STRING' to the 'Y-STRING'. I can do this in the COBOL program by doing the following :

MOVE YES-STRING(1:1) TO Y-STRING.   

 

But can this be done in the dialog? I know the Dialog System can move entire variable such as:

  MOVE YEST-STRING Y-STRING

 

But I want to be able to move just a character of a string to another variable in the Dialog System. Thanks in advance for your help.

 

- Alex Castro

Okay, thanks for your response.