Previous Topic: Updating Status Variables

Next Topic: Referencing Parts of Dynamic Status Variables


Referencing Portions of Variables

You can use substrings to reference portions of a status or environmental variable. To specify a substring, use this format:

varname(startcol:endcol)

Example 1:

If the variable &TIMESTAMP contains the value 00:12:31:23:59:59, then &TIMESTAMP(4:8) equals 12:31.

Example 2:

The following SET statement sets the value of a status variable by using substrings of environmental variables. Suppose that the variable &DATE contains the value 12/31/00 and the variable &TIME contains the value 23:59:59. The following &TIMESTAMP variable is set as follows:

The following SET statement:

SET(&TIMESTAMP=&DATE(7:8):&DATE(1:2):&DATE(4:5):&TIME)

Produces this variable setting:

&TIMESTAMP=00:12:31:23:59:59