IN
v1.3
v2.1

Purpose, Argument, Streams, Usage, Examples, Related

Syntax

>>──IN───────────────────────────────────────────────────────────────────────────────>< 

Purpose

IN is dual purpose. When IN is specified in a pipeline that is launched through the CALLPIPE stage command; IN reads records from that calling pipeline. When IN is specified in a pipeline that is connected to the STDOUT stream of another WIN32 process; IN reads records from its STDIN stream.

IN splits its input at Line-Feed characters; discarding both individual and groups of Carriage-Return characters and writes the resulting records to its primary output stream.

Argument
Streams

Stream
Action
Input
IN reads records from the CALLPIPE stage command of the calling pipeline or from its STDIN stream.
Primary output
IN writes records to its primary output stream.

Usage
  1. IN does not delay the records.

  2. When IN reads from its STDIN stream, it reads its input records one at a time; waiting for each one to be consumed from its primary output stream before reading another. When IN reaches end-of-file on its STDIN stream, IN disconnects its primary output stream and the stage ends.

  3. IN splits its input at Line-Feed characters; discarding both individual and groups of Carriage-Return characters and writes the resulting records to its primary output stream. IN discards the last Line-Feed character of its input where this would produce a null output record.

  4. You should only specify the IN stage command once in a pipeline; otherwise the results will be unpredictable.

  5. IN verifies that its secondary input and secondary output streams are not connected and then begins execution.
Examples
  1. The following pipeline calls the user-written stage: splitpath.rex to split the path environment variable into its individual path values.

    'pipe shell cmd path | callpipe splitpath.rex | console'
    

    splitpath.rex
    'pipe in', '| specs ws /=/ w-1 1', '| split at str /;/', '| out

    output:
    C:\WINDOWS\system32 C:\WINDOWS C:\WINDOWS\System32\Wbem C:\Program files\TenFiftyTwo\Pipelines

  2. This example reads its caller's primary input stream records and, using a translate table, it converts the records from EBCDIC to ASCII and writes the records back to its caller's primary output stream.

    EBCDIC to ASCII

  3. This last example formats its caller's primary input stream records so that, where possible, each record is no longer than a specified length.

    Max length
Related

CALLPIPE, CONSOLE, OUT, RUNPIPE, SHELLEXECUTE

History

Version
Date
Action
Description
Pipelines
1.3
??.??.2025
changed
Application-wide rewrite
2.1
1.2
04.02.2012
changed
IN reads input records from the CALLPIPE stage command of the calling pipeline (through a shared file segment) or from its STDIN stream; when it is specified in a pipeline that is connected to the STDOUT stream of another WIN32 process.
2.0
1.1
22.04.2008
changed
IN splits its input at Line-Feed characters; discarding both individual and groups of Carriage-Return characters and writes the resulting records to its primary output stream. IN discards the last Line-Feed character of its input where this would produce a null output record.
1.5
1.0
06.09.2007
created
First version.
1.0