PEEKTO command v1.1

Pipelines v2.1

 

Needs examples

 

Purpose, varname, Usage, Examples, Related

Home

 

Syntax

 
>>──PEEKTO──┬─────────┬──────────────────────────────────────────────────────────────><
            └─varname─┘
 

Purpose

 

Use the PEEKTO command 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 command; 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

 

1.

The record that PEEKTO inspects but does not consume, remains in the input stream until a READTO ooRexx command is issued to actually consume the record. If you issue another PEEKTO command without first issuing the READTO command, 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 command 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.

 

Related

 

ARRAY, OUTPUT, READTO, VARIABLE

 

History

 

Version

 

Date

Action

Description

Pipelines

1.1

28.12.2021

changed

Application-wide rewrite.

2.1

1.0

04.02.2012

created

First version.

2.0