RUNPIPE stage v1.2

Pipelines v1.9

 

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

Home

 

Syntax

 
              _WAIT_________
             |_SYNCHronous__|
>>__RUNpipe__|______________|____________ __ ___________________ ______________________><
             |_NOWAIT_______|_ _______ __|  |           _.PPL_  |
             |_ASYNCHronous_| |_QUIET_|     |_pipeline_|______|_|
 
Notes: 
(1)  You must not specify any spaces between the pipeline operand and the .PPL extension.
 

Purpose

 

Use the RUNPIPE stage command to launch the specified target pipeline. RUNPIPE reads records from its primary input stream and for each record launches the target pipeline and then writes the input record to its primary output stream.

 

With the pipeline operand, each time RUNPIPE reads an input record it launches the target pipeline; passing the input record as the command-line argument. If you do not specify a fully qualified path, RUNPIPE searches the current working directory for the file. If you do not specify the .PPL extension, RUNPIPE will append it.

 

Without the pipeline operand, each time RUNPIPE reads an input record it extracts the first word or quote (“) delimited phrase and uses this as the name of the target pipeline.  The remainder of the input record data is used as its command-line argument. If you do not specify a fully qualified path, RUNPIPE searches the current working directory for the file. If you do not specify the .PPL extension, RUNPIPE will append it.

 

When you specify the WAIT operand, which is the default; RUNPIPE reads an input record from its primary input stream; launches the target pipeline and waits for it to complete before writing the input record to its primary output stream. This process is repeated until end-of-file is reached on its primary input stream. If the target pipeline ends with an error exit code, the RUNPIPE stage ends with an error exit code.

 

When you specify the NOWAIT operand; RUNPIPE reads an input record from its primary input stream, (and unless the QUIET operand is also specified) initialises a new console and launches the target pipeline, but it does not wait for the target pipeline to complete, RUNPIPE immediately writes the input record to its primary output stream. This process is repeated until end-of-file is reached on its primary input stream. With the NOWAIT operand, an error exit code returned by the target pipeline is ignored. It is not possible to predict the order in which either pipeline will end.

 

Operands

 

    

WAIT

SYNCHronous

specifies that RUNPIPE should launch the target pipeline and to wait for it to finish processing before writing an input record to the primary output stream. This is the default.

 

    

NOWAIT

ASYNCHronous

specifies that RUNPIPE should create a new console (unless the QUIET operand is also specified) and launch the target pipeline, but to continue processing; immediately writing an input record to the primary output stream without waiting for the target pipeline to finish processing.

 

 

QUIET

specifies that the target pipeline is launched (without an attached console) as a stand-alone background pipeline. The target pipeline can read from input files and write to output files, issue system commands, launch other pipelines and execute other processes; but it must not request console input. A pipeline launched with the NOWAIT QUIET combination; may be useful for executing long running background tasks that periodically collect system information, issue maintenance commands, etc.

 

    

pipeline

is the name of the target pipeline file. If the pipeline file is not in the current working directory, you must specify a fully qualified path and filename. If you do not specify the .PPL extension operand, RUNPIPE will append it.

 

Streams used

 

The following streams are used by the RUNPIPE stage:

 

Stream

Action

 

 

Primary input stream

RUNPIPE reads records from its primary input stream.

Primary output stream

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

 

Usage notes

 

     1)

When the WAIT operand is specified, RUNPIPE delays each record until the target pipeline has finished processing. When the NOWAIT operand is specified, RUNPIPE does not delay the records.

 

     2)

If the RUNPIPE stage discovers that its primary input stream is not connected, the RUNPIPE stage ends.

 

     3)

The target pipeline inherits the stall detection monitor setting of the calling pipeline; only if the WAIT operand is specified and the callers’ pipeline explicitly defines the MONITOR option keyword or the caller inherited the MONITOR option setting from its caller, and so on.

 

     4)

If the target pipeline or its argument contains spaces, you must enclose them in quotation marks. For example:

 

runpipe “my pipeline.ppl” “argument 1” argument2

 

     5)

RUNPIPE verifies that its secondary input and output streams are not connected and then begins execution.

 

Examples

 

Creating multiple output files
Running a pipeline (with WAIT)
Running a pipeline (with NOWAIT)

 

See also

 

Reference the following link for additional information:

 

CALLPIPE