PEEKTO subcommand v1.0

Pipelines v2.0

 

Purpose, Operands, Usage notes, Examples, See also

Home

 

Syntax

 
>>__PEEKTO__ _________ ________________________________________________________________><
            |_varname_|
 

Purpose

 

Use the PEEKTO subcommand to inspect the next record in the input stream without consuming the record. If an ooRexx variable is specified, the variable is set to the contents of that record. PEEKTO reads records from the CALLPIPE stage of the calling pipeline; leaving that record in the input stream. Repeated calls through PEEKTO, without specifying a subsequent READTO subcommand; returns that same input record.

 

Operands

 

    

varname

is the name of the variable in which PEEKTO is to place the contents of the input record. The variable may index an array or a stem. The name you specify must be a valid name for an ooRexx variable. If you do not specify varname, no variable is set.

 

Usage notes

 

     1)

The record that PEEKTO inspects but does not consume, remains in the input stream until a READTO Pipelines subcommand is issued to actually consume the record. If you issue another PEEKTO subcommand without first issuing the READTO pipeline subcommand, PEEKTO continues to inspect that same input record waiting to be processed.

 

     2)

Use PEEKTO without specifying varname if you wish only to set a return code indicating whether there is another record in the input stream.

 

     3)

When the PEEKTO subcommand determines that there are no more records to read; it sets the ooRexx variable RC to a value of 12 (end-of-file), and the variable specified by varname is dropped.

 

Examples

 

None.

 

See also

 

Reference the following links for additional information:

 

ARRAY, OUTPUT, READTO, VARIABLE

 

History of change

 

None.