VARIABLE stage v1.0

Pipelines v2.0

 

Purpose, Operands, Streams used, Usage notes, Examples, See also

Home

 

Syntax

 
>>__VARiable__ _name________ __ __________ ____________________________________________><
              |_name[index]_|  |_TRACKing_|
              |_name.index__|
 

Purpose

 

Use the VARIABLE stage to retrieve or set an ooRexx variable, array or stem entry.

 

By default, when VARIABLE is the first stage of a pipeline; VARIABLE retrieves the value of an ooRexx variable and writes the value to its primary output stream. When VARIABLE is not the first stage of a pipeline, VARIABLE sets the specified variable to the contents of the first record in its primary input stream and then the VARIABLE stage terminates. If at termination; the VARIABLE stage determines that no input records have been read and that the specified ooRexx variable is a simple variable (not an array or stem entry); then the variable is dropped, otherwise the specified array or stem entry remains unchanged. VARIABLE also copies its primary input stream records to its primary output stream.

 

Operands

 

    

name

specifies the name of the ooRexx variable, array or stem entry on which to operate.

 

 

index

an unsigned integer which specifies the array or stem index.

 

    

TRACKing

specifies that VARIABLE, when it is the first stage of a pipeline; continuously obtains the value of the variable and writes it to the primary output stream. When VARIABLE is not the first stage of a pipeline, TRACKING specifies that VARIABLE sets the variable to the contents of each input record that is read. The final value of the variable is the last record read from VARIABLE’s primary input stream. The variable remains unchanged if no records are read from the primary input stream.

 

Note: that VARIABLE with the TRACKING operand, when it is the first stage of a pipeline; writes an infinite number of records unless you limit the number of records.

 

Streams used

 

The following streams are used by the VARIABLE stage:

 

Stream

Action

 

 

Primary input stream

VARIABLE reads records from its primary input stream, if it is connected and writes them the specified ooRexx array.

Primary output stream

VARIABLE writes records to its primary output stream, if it is connected.

 

Usage notes

 

     1)

VARIABLE does not delay the records.

 

     2)

If the VARIABLE stage discovers that both its primary input and primary output streams are not connected, the VARIABLE stage ends.

 

     3)

With the TRACKING operand, when it is the first stage of a pipeline; writes an infinite number of records unless you limit the number of records.

 

     4)

VARIABLE verifies that it has either/and a primary input stream and primary output stream connected and then begins execution.

 

Examples

 

None.

 

See also

 

Reference the following links for additional information:

 

ARRAY, STEM

 

History of change

 

None.