CL Programming

Changing the Value of a Variable

You can change the value of a CL variable using the Change Variable (CHGVAR) command. The value can be changed:

The CHGVAR command can be used to retrieve and to change the local data area also. For example, the following commands blank out 10 bytes of the local data area and retrieve part of the local data area:

CHGVAR %SST(*LDA 1 10) ' '
 
CHGVAR &A %SST(*LDA 1 10)

For a logical variable, the value to which the variable is to be changed must be a logical value. For decimal variables, a decimal or character value can be used. For character variables, either character or decimal values are accepted.

When specifying a decimal value for a character variable, remember the following:

For example, &A is a character variable to be changed to the value of the decimal variable &B The length of &A is 6. The length and decimal positions of &B are 5 and 2, respectively. The current value of &B is 123. The resulting value of &A is 123.00.

When specifying a character value for a decimal variable, remember the following:


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]