RUNPIPE stage v1.1

Pipelines v1.6

 

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

Home

 

Syntax

 
              _WAIT_________
             |_SYNCHronous__|
>>__RUNpipe__|______________|__ ___________________ ___________________________________><
             |_NOWAIT_______|  |           _.PPL_  |
             |_ASYNCHronous_|  |_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 keyword, 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 keyword; RUNPIPE reads an input record from its primary input stream, 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 keyword, 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 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.

 

    

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 keyword is specified, RUNPIPE delays each record until the target pipeline has finished processing. When the NOWAIT keyword 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 keyword is specified and the caller explicitly specifies the MONITOR pipeline option or the caller inherited the MONITOR 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, IN, OUT, SHELLEXECUTE

 

History of change

 

Version

Action

Description

 

 

 

1.1

Added

During stage initialisation, RUNPIPE verifies that the target pipeline exists and that its command-line argument is properly formed; this provides a clearer and more robust error detection process.