Pippgmi
Pippgmi
John P. Hartmann
! Fourth Edition, November 2014.
Copyright International Business Machines Corporation 1995, 2010. All rights reserved.
US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
Table of Contents
Contents
| Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi
| Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi
Part 3. Copipes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Release—Return storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Extend—Try to extend an allocated area . . . . . . . . . . . . . . . . . . . . . . . . 55
Persistent—Allocate persistent storage anywhere . . . . . . . . . . . . . . . . . . . 55
ReleasePersistent—Return persistent storage . . . . . . . . . . . . . . . . . . . . . . 55
Resource management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Enqueue—Serialise access to a global area . . . . . . . . . . . . . . . . . . . . . . 56
Dequeue—Release exclusive access to a global area . . . . . . . . . . . . . . . . . 56
Exit management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Timer—Set TOD clock exit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Programming notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Enqueue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Storage management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Suspend and resume . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Global anchor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
The CMS Pipelines PIPMOD command . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Merging the PIPMOD INSTALL token . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
FPLSYSSV—Build a system services vector . . . . . . . . . . . . . . . . . . . . . 59
Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Contents v
| Preface
| Terminology
| Pipeline domain. A pipeline domain is created implicitly by the first PIPE command in a
| CMS session or a TSO job step. On CMS it remains until deleted explicitly or deleted by CMS
| ABEND recovery; on MVS it remains to the end of the job step.
| Additional pipeline domains can be created on CMS by the NUCXLOAD command loading the
| main pipeline module or a pipeline module at a different level than the default. Refer to
| Appendix D in CMS/TSO Pipelines: Author’s Edition.
| Pipeline set. A pipeline set comprises the pipelines specified on the PIPE command and
| all pipeline specifications added to it by the ADDPIPE and CALLPIPE pipeline commands.
| A pipeline set is also created by the runpipe stage.
CMS
On CMS, you must tunnel the parameter tokens through CMS command processing. This is
done by prefixing the list of parameter tokens with a doubleword that contains the PIPE
command; thus, the list of parameter tokens becomes part of the CMS tokenised parameter
list.
The parameter list is passed in general register 1. It must be list of tokens, each eight
bytes long and aligned on a fullword boundary (these are CMS tokens). The first token
contains the PIPE command. The remainder of the parameter list contains the token list
described in “Parameter token list” on page 4.
You can choose between CMSCALL or a direct branch to issue the pipeline.
MVS
On z/OS, you have the choice of LINK; or LOAD, branch, and DELETE. The entry point
name is PIPE (which is an alias for FPLPIPE).
You must use LOAD when you intend to run a copipe; otherwise the PIPE module could be
unloaded from storage and you would be branching wildly when you resume the pipeline.
Pass in general register 1 a parameter list that has one entry. The parameter must point to
the token list described in “Parameter token list” on page 4.
The pointer must have the leftmost bit turned on to indicate a parameter list that has one
entry.
Thus, the parameter is a pointer to the parameter structure in C parlance. In PL/I you
would pass a pointer to the first element of the token list.
nospie 31 Do not issue SPIE macro instructions. (This is the least significant
bit.)
nostae 30 Do not issue STAE macro instructions.
nostax 29 Do not issue STAX macro instructions.
The leftmost bit (bit 0) is reserved for the sign; it will never be assigned.
msgl Provide a default message level. This is equivalent to runpipe MSGLEVEL. On
CMS, all of the rightmost sixteen bits can be set, in contrast to the pipeline
option which masks some of them off. On z/OS, the bits for X'3100' are
masked off, because they would cause an ABEND if they were enabled.
pipe Provide the address and length of a character string that contains the pipeline
specification to be run.
If the operand sublist does not contain a length operand, the length attribute of
the address operand is used as the length of the pipeline specification.
rc Provide the address of a fullword to receive the return code from the request.
Whether or not this token is specified, the return code will also be set in
general register 15. Because the rc token cannot be used to report problems
in the parameter list itself, the application should initialise the area pointed to
with a value that will indicate failure to the application. Once the token list
has been validated, the return code will be stored at the address contained in
the rc token whenever the pipeline returns.
sysv Provide the address of a vector of system services entry points. The vector is
described in Chapter 13, “System services vector” on page 50. This token is
optional; a default set of system services interface routines is supplied by
CMS/TSO Pipelines.
uwrd Provide the address to be stored as the user word for the pipeline set that will
be created for the request. See Chapter 14, “CMS/TSO Pipelines user words”
on page 62.
You can specify tokens in any order. When a particular type of token is specified more
than once, the last instance takes precedence. A pipe token overrides a encd token and
vice versa. Note that the token identifier is a lower case character string. The formats of
the tokens are summarised in Figure 3.
Addresses and lengths are specified in a generalised form described in Chapter 3, “Speci-
fying addresses and lengths in control blocks” on page 14. If you do not build the tokens
with the macros supplied, you should refer to that chapter; it may save you some work.
Macro
Use the macro PIPTPARM to generate the list of parameter tokens.
label The label is attached to the beginning of the parameter list. On z/OS,
this label should be used as the argument in the CALL macro instruction.
type The token type. It can be written in upper case or in lower case (but not
in mixed case). The macro will generate a lower case token in both
cases. The type can optionally be enclosed in quotes.
operand The form that is appropriate to the request. Refer to Chapter 3, “Speci-
fying addresses and lengths in control blocks” on page 14 for ways to
specify operand values. If fewer operands are supplied than are
required, the remaining slots are padded with zeros. Excessive operands
are quietly ignored. If the pipe token is specified with only one addi-
tional suboperand, the operand specifies the address of the pipeline
specification, and it is assumed that the length of the string can be deter-
mined from the length attribute of the specified symbol.
CMS Specify YES to generate the eight character CMS command as a prefix to
the parameter token list. The COMMAND= operand specifies the
command; the default is PIPE. If it is present, the label will be attached
to this string rather than to the list of tokens. Omit the CMS parameter
or specify NO to generate a token list that can be used on z/OS.
COMMAND Specify the command to issue. This operand has effect only when
CMS=YES is specified.
FENCE Specify NO to suppress the fence that terminates the parameter token list.
You would use this operand only if you intend to assemble further
tokens “by hand”. The token list must be concluded by a doubleword
fence of all one bits.
Any addresses may be specified using the address notation that is defined in Chapter 3,
“Specifying addresses and lengths in control blocks” on page 14.
The encoded pipeline specification is specified by one PIPSCBLK macro and several
PIPSCSTG macros.
The PIPSCBLK macro specifies the overall structure of the pipeline specification; it includes
the message level, options, and name of the pipeline specification. If a string represen-
tation of the encoded pipeline specification exists, it can also be specified; this will be
made available in an event record.
PIPSCSTG macros are used to specify stages of the pipeline, as well as connectors and
labels. The macro PIPSCSTG is also used to specify the beginning of a pipeline. When a
stage is specified, its entry point can be specified as an address or as a name. If you
specify an address, you can use stages that are local to your program.
The encoded pipeline specification can consist of more than one list of PIPSCSTG macros in
which case the STAGES= keyword of the PIPSCBLK macro lists the first PIPSCSTG macro in
each list. Each list is terminated by TYPE=DONE. The list can be broken at any point.
To run an encoded pipeline with a PIPSCBLK of type RUNPIPE, you should build a param-
eter token list (using the PIPTPARM macro). The parameter token list must include an
“encd” token that specifies the name in the label parameter of the PIPSCBLK macro.
Encoded pipelines with a type of ADDPIPE or CALLPIPE are invoked through the PIPMISC
macro with the ENCODED operand. The address of the PIPSCBLK macro expansion must be
in register 1 when the PIPMISC macro is issued.
Macros
Note: The PIPSCBLK and PIPSCSTG macros are also used to define an encoded pipeline
specification to be added to the currently running pipeline set. For completeness, all
aspects of the macros are documented here even though some operands are not appropriate
to the initial pipeline specification of a pipeline set.
label Specify the label for the encoded pipeline specification. Use this label in
the “encd” parameter token. Note that the label is not specified in
column one of the card, as is customary.
PREFIX Specify the prefix to be used for labels that are generated when the type
is DSECT, CSECT, or INLINE.
The remaining operands are used only when the type is ADDPIPE, CALLPIPE, or RUNPIPE.
FLAG Specify global options. Note that multiple options are specified in a
comma separated sublist. The actual flags defined are prefixed the string
specified by the &PREFIX keyword (PIPSCAN by default). You can
specify TRACE, LISTERR, LISTRC, STOP, and LISTCMD.
NAME Specify the name string. The string can be enclosed in quotes; it can be
represented by the label on a character string constant; or it can be
specified as two suboperands containing the address and length of the
string, respectively.
MSGLEVEL Specify the bits to add and the bits to remove from the message level.
Only the bits for X'000017FF' can be turned on or off.
ORIGPSPEC Specify the original pipeline specification, if one exists. The string can
be enclosed in quotes; it can be represented by the label on a character
string constant; or it can be specified as two suboperands containing the
address and length of the string, respectively. This string is not used by
CMS/TSO Pipelines, but its contents are made available in an event
record, which can be used by the pipeline performance monitor known
as and similar applications. Thus, you are encouraged to supply this
string if you have it; but do not spend time computing it.
STAGES Specify the address of one or more sets of PIPSCSTG macros. The
default assumes that the pipeline specification consists of one list of
PIPSCSTG macros that immediately follows the PIPSCBLK.
Define DSECT
┌─TYPE=DSECT─┐
►►──PIPSCSTG──┬──────────┬──┴────────────┴──►
└─label──,─┘
►──┬─────────────────────────┬──►◄
│ ┌─SCANSTAGE─┐ │
└─,PREFIX=─┴─word──────┴──┘
Begin Pipeline
►►──PIPSCSTG──┬──────────┬──TYPE=BEGIN──►◄
└─label──,─┘
Note that the first PIPSCSTG macro of an encoded pipeline specification must be the begin
type; there are always as many begin items as there are pipelines in the pipeline
specification. (This is unlike the string representation of a pipeline specification, where the
initial end character is optional.)
Define Stage
►►──PIPSCSTG──┬──────────┬──TYPE=STAGE──►
└─label──,─┘
►──┬──────────────────────────────┬──►
└─,FLAG=─┬─┤ Flag ├─────────┬──┘
│ ┌─,────────┐ │
└─(──6─┤ Flag ├─┴─)─┘
►──┬─────────────────────────────────────────────────────┬──►
│ ┌─(0,0)───────────────────────────────┐ │
└─,MSGLEVEL=─┴─(─┬────────────┬─,─┬────────────┬─)─┴──┘
└─┤ A-type ├─┘ └─┤ A-type ├─┘
►──┬─────────────────────┬──┬────────────────────────┬──►
│ ┌─' '────┐ │ │ ┌─0──────┐ │
└─,LABEL=─┼─word───┼──┘ └─,STREAMID=─┼─number─┼──┘
└─'word'─┘ ├─word───┤
└─'word'─┘
►──┬─────────────────────────┬──►
│ ┌─0──────────┐ │
└─,ENTRY=─┴─┤ A-type ├─┴──┘
►──┬─────────────────────────────────────────┬──►
│ ┌─(0,0)───────────────────────┐ │
└─,VERB=─┼─label───────────────────────┼──┘
└─(─┤ A-type ├─,─┤ A-type ├─)─┘
►──┬─────────────────────────────────────────┬──►◄
│ ┌─(0,0)───────────────────────┐ │
└─,ARGS=─┼─label───────────────────────┼──┘
└─(─┤ A-type ├─,─┤ A-type ├─)─┘
ENTRY Specify this operand if you can resolve the program to run at assembly
time. Omit this operand if the pipeline specification parser must resolve
the program to run in the normal way. Specify the label on a PIPDESC
macro instruction that contains the program descriptor for the stage to
run, if the stage uses a program descriptor. If the stage does not use a
program descriptor (rather, it uses the original published interface),
specify the label of the first instruction in the program.
VERB Specify the name of the program to run. This can be specified as a
character string, the label on a character string, or a sublist containing
the address and the length of the character string.
ARGS Specify the argument string for the stage. This can be specified as a
character string, the label on a character string, or a sublist containing
the address and the length of the character string. This is often specified
by reference to the program’s register set.
Label Reference
►►──PIPSCSTG──┬────────┬──TYPE=LABEL──,──LABEL=─┬─word───┬───►
└─label,─┘ └─'word'─┘
►──┬────────────────────────┬──►◄
│ ┌─0──────┐ │
└─,STREAMID=─┼─number─┼──┘
├─word───┤
└─'word'─┘
Connector Reference
►►──PIPSCSTG──┬────────┬──TYPE=CONNECTOR──,──►
└─label,─┘
►──SIDE=─┬──────────────────────┬───┬────────────────────────┬──►
├─INPUT────────────────┤ │ ┌─0──────┐ │
├─(INPUT,CONDITIONAL)──┤ └─,STREAMID=─┼─number─┼──┘
├─OUTPUT───────────────┤ ├─word───┤
└─(OUTPUT,CONDITIONAL)─┘ └─'word'─┘
►──┬────────────────────────────┬──►◄
│ ┌─0──────┐ │
└─,STREAMNUMBER=─┴─number─┴──┘
STREAM-NUMBER Specify a number if you wish to refer to the number of the stream you
are connecting.
End of Segment
►►──PIPSCSTG──TYPE=DONE──►◄
This form generates a terminator to show the end of the segment being defined. It can be
after any other type of stage block.
S(8(R2))
S(PARMSTRING)
When an S-type address is specified that is resolved by the Assembler, the data must
be addressable from the register contents at the time CMS/TSO Pipelines is called.
The Assembler must have the same USING statements in effect when the macro is
assembled as will be in effect at the time CMS/TSO Pipelines is invoked to process
the request.
¹ As the address of a fullword that contains a pointer to the argument; that is, an indi-
rect reference. This is specified by prefixing a percent sign (%) to the address. The
fullword must be addressable from the register contents at the time CMS/TSO
Pipelines is called. The Assembler must have the same USING statements in effect
when the macro is assembled as will be in effect at the time CMS/TSO Pipelines is
invoked to process the request.
%PIPEPOINTER
¹ As a label of a storage address or a self-defining symbol. This is assembled as an
address constant. You can specify any expression that is valid in an A-type DC
instruction.
PIPELINE
L'PIPELINE
Negative numbers must be greater than -16M, lest they be interpreted as one of the
forms above; that is, if the sign bit is one, all eight leftmost bits must be one.
register 0 points; the parameter list is ignored by CMS/TSO Pipelines when it discovers the
parameter token list.
Syntax summary
A-type:
├──┬─(register)──────────┬──┤
├─S(s-type)───────────┤
├─label-*─────────────┤
├─%label──────────────┤
└─AssemblerExpression─┘
StringSpec:
├──┬─label───────────────────────┬──┤
└─(─┤ A-type ├─,─┤ A-type ├─)─┘
Address:
├──┬─(register)──────────┬──┤
├─%label──────────────┤
└─AssemblerExpression─┘
! Figure 4 shows a modern type-2 filter package for CMS. Omit FPLNXH for TSO.
! Filter packages may be installed actively by the filter package invoking the appropriate
! interface or passively through the filterpack stage. The first type is often referred to as a
! type-1 filter package whereas the latter is a type-2 filter package. CMS Pipelines supports
! both types of filter packages, but TSO Pipelines supports type-2 only.
! The corresponding CMS module is DMSPFP, which is on the system disk. The runtime
! library supplies FPLNXF.
! This level supports an entry point table and a message table, but no function table.
! FPLNXG
! FLNXG is the glue used with type-2 filter packages. It contains the assembled macro
! FPLFLTPK. This object module must be linked into type-2 filter packages. It contains
! address constants to resolve the contents of the filter package, but no code other that
! setting return code 16 when invoked as a command.
! FPLNXH
! FPLNXH supplies the active code of FPLNXF to install using the parameter list in FPLNXG.
! Thus, an active type-2 filter package can be constructed by linking both FPLNXH and
! FPLNXG into a CMS module.
! For completeness, all operands of the macros are described, even ones not appropriate to
! an entry point table in a filter package.
! ►►──PIPEPT──┬──────┬──┬───────────────────┬──►
! └─name─┘ │ ┌─NO──┐ │
! └─ENTRY──=──┴─YES─┴─┘
! ►──┬───────────────────────┬──►◄
! │ ┌─YES─┐ │
! └─SECONDARY──=──┴─NO──┴─┘
! name Specify the label to generate for the symbol table. The default is
! PIPEPT. You must specify FPLEPT for use with FPLNXG or FPLNXH.
!! ENTRY Specify YESor NO, as appropriate. ENTRY is ignored when
! SECONDARY is specified, as the symbol must be an entry to the
! object module for the symbol to be resolved.
!! SECONDARY Specify whether the entry point table is referred to from another
! entry point table or not. In particular, specify NO for a filter
! package.
! ►►──PIPEPTEN──name──entry──┬──────────────────────────┬──►
! │ ┌─NO──┐ │
! └─SELFRELOCATE──=──┴─YES─┴─┘
! ►──┬─────────────────┬──┬────────────────────┬──►
! │ ┌─A─┐ │ └─MIN──=──┬────────┬─┘
! └─ATYPE──=──┴─V─┴─┘ └─number─┘
! ►──┬───────────────────────┬──┬───────────────────────────┬──►◄
! │ ┌─0──────┐ │ └─PGMLANG──=────ASSEMBLER───┘
! └─COMMIT──=──┴─number─┴─┘
! ►►──PIPEPTED──►◄
! Example
! Using an entry point table file:
! pipe < fpltfp eptable | console
! ►msg900 fpltfpr1
! ►msg901 fpltfpr2
! ►Ready;
! fpleptbl fpltfp fpltfpep.text ( fplept
! ►Ready;
! If you wonder why CMS/TSO Pipelines does not use the CMS infrastructure, the answer is
! twofold: First, CMS Pipelines predates the CMS message repositories; and second, TSO
! does not support the CMS message infrastructure.
! ┌─FPLUME.REPOS─┐ ┌─FPLMTX.TEXT.A─┐
! ►►──FPLMSTXT──┼──────────────┼──┼───────────────┼──►◄
! └─infname──────┘ └─outfname──────┘
! 2. A single word that specifies the output file name and optional file type. The file type
! is abutted to the file name with a period. The default output file type is TEXT.
! Example
! The input repository file is shown below. It contains messages 900 and 901. Both are
! format 01 and one line.
! pipe < fpltfp repos | console
! ►& 3
! ►09000101E This is the first test message. (&1)
! ►09010101W This is the second test message. (&1)
! ►Ready;
! fplmstxt fpltfp fpltfpmt.text
! ►Ready;
! ►►──FPLGRXTX──inFile──┬─────────┬──┬────────────┬──►
! └─outFile─┘ └─entryPoint─┘
! ►──┬──────────────────┬──►◄
! │ ┌──
───────────┐ │
! └─(───6┬─NODIR───┬┴─┘
! └─COMRESS─┘
! inFile Specify the input file name and type separated by a period.
! Several file types modify the processing of FPLGRXTX:
! REXXES The input file contains a list of file names; the implied
! file type is REXX. This is the default file type.
! PACKAGE The input file contains a list of files. The tokens &1
! and &2 are removed from the first seven columns and
! the first three words are then the file name, the file
! type, and the file mode.
! EPTABLE The first word of each input line is the file name of
! the filter; the file type is REXX.
! For all file types, a leading asterisk indicates a comment, which is
! discarded.
! outFile Specify the output file name, type, and mode separated by periods.
! The default file type is TXTFIX.
! entryPoint Specify the the control section name to be generated.
!! NODIR Specify NODIR when you generate the entry point table manually,
! in particular if the filter package contains both REXX and Assem-
! bler filters. The file REXXES EPTABLE is created by default.
!! COMPRESS Compress each REXX program to a single line with redundant
! blanks removed.
! Example
! This example shows the list of files, the contents of the files, and the generation of the
! object module.
! Trying to run the filters outside the filter package gets an error message because the 900
! series of messages is reserved for user written filter packages:
! pipe rexx fpltfpr1
! ►No message text for message 900.
! ►... Issued from stage 1 of pipeline 1.
! ►... Running "rexx fpltfpr1".
! ►Ready;
! The function table is at the entry point FPLFUNTB, which is not negotiable. You can
! generate a self-installing type-2 filter package by including both FPLNXG and FPLNXH in the
! module.
! Refer to Chapter 16, “Sample spec function package” on page 67 for a complete sample
! function package.
! Notes:
! 1. In this chapter, “floating point” refers to a counter that contains a decimal floating
! point number, as defined later. That is, it is not a hardware-defined data item.
! Such a floating point number consists of a 31-digit decimal fraction, which is stored in
! a 16-byte packed decimal number, and a binary integer scale, which represent the
! power of ten with which the fraction is multiplied to obtain the number. A truly large
! range.
! 2. You must use the PIPCALL macro to call a CMS/TSO Pipelines service routine; external
! address constants will not work.
! 3. The pipeline services transfer vector must be available when a CMS/TSO Pipelines
! macro is issued or one of its subroutines is called.
! ►►──label──FPLFUNTB──┬──────────────────┬──┬────────────────────┬──►◄
! │ ┌─DSECT─┐ │ │ ┌─NO──┐ │
! └─TYPE=──┴─CSECT─┴─┘ └─EXTERNAL=──┴─YES─┴─┘
! ►►──<blank>──FPLFUNTE──name──entry──┬──────────────┬──►
! └─MIN=──number─┘
! ►──┬──────────────┬──RESULT=──┤ Type ├──►
! └─MAX=──number─┘
! ►──┬───────────────────────────┬──►◄
! │ ┌─,────────┐ │
! └─ARGS=──(───6─┤ Type ├─┴──)─┘
! Type:
! ├──(──┬─ANY────┬──┬───────────────────┬──)──┤
! ├─STRING─┤ │ ┌─,──────────┐ │
! ├─INT────┤ └─,───6┬─OPTIONAL─┬┴─┘
! └─FLOAT──┘ └─SAME─────┘
! The type of the result and of each argument is specified by the two keyword operands.
! The types and optional flags are:
! ANY Any type. The function determines and handles the actual argu-
! ment.
! STRING The argument is converted to a string, as required. This is unsuc-
! cessful only when there is no storage to hold the converted
! number.
! INT The argument is converted to an integer. spec will issue a
! message and terminate if the argument cannot be converted to a
! signed 32 bit binary number.
! FLOAT The argument is converted to a decimal floating point number
! having 31 digits precision and a fullword binary scale. spec will
! issue a message and terminate if the argument cannot be converted
! to float.
! OPTIONAL The argument is optional. You may also specify OPT.
! SAME The remainder of the arguments are the same as the one being
! defined. Specify MAX= if the maximum supported number of oper-
! ands is less than 255.
! ►►──<blank>──FPLFUNTN──►◄
! FUNX OVERLAY, +
! RESULT=STRING, +
! ARGS=(STRING,STRING,(INT,OPT),(INT,OPT), +
! (STRING,OPT)) FUNPACK
! FUNX POS,RESULT=INT, +
! ARGS=(STRING,STRING,(INT,OPT)) FUNPACK
! FUNX REVERSE,RESULT=STRING,ARGS=STRING FUNPACK
! FUNX RIGHT, +
! RESULT=STRING, +
! ARGS=(STRING,INT,(STRING,OPT)) FUNPACK
! FUNX SIGN,RESULT=INT,ARGS=FLOAT FUNPACK
! 13 Save area. The forward pointer at offset 8 contains the address of a 400-byte area that the
! function may use as save area or work area, or both. That is, HLLSTACK in PL/j parlance.
! Note that his 400-byte area is not contiguous with the save area in register 13.
! 14 Return address.
! 15 Entry point address. Return code on exit. A nonzero return code indicates a severe error;
! spec identifies the failing item in message 1490 and terminates.
! The counter is defined by the mapping macro FPLSPCTR. This section describes the labels
! defined when PREFIX= is omitted from the macro.
! For completeness, the following table describes all values used by CMS/TSO Pipelines.
! You do not need to decode all of the sixteen possible values. The sign nibble may be
! summarised by calling FPLSPVES. The address of the counter must be in general register 7;
! the encoded value is returned in general register 1. If the encoded value indicates a string,
! PIPSPSLW will return the string for any of the three string types.
! For the floating types, the implied decimal point is at the right of the digits string. Thus, a
! value is definitely an integer when the scale is not negative. The number is also an integer
! when the scale is negative, but greater than the negative of the number of trailing zeros in
! the digits field. You may call FPLSPVTI to normalise the counter so that the absolute value
! of the scale is as small as possible. After that, a negative scale indicates a true fractional
! number.
! The encoded values of the sign are also defined by the counter mapping macro FPLSPCTR.
! The prefix is not applied to these names.
! Data fields
! The data fields of the counter are:
! Again, recall that FPLSPSLW will take care of the last five fields for you.
! Macros
! You may need to use several of the CMS/TSO Pipelines macros. Here are a few.
! PIPBFRAP Use PIPBFRAP to append a string to a buffer, in particular the one provided for
! the result. Load the buffer address provided into register 1. The string to
! append is in registers 4 and 5 or you can specify a label as the second
! operand. If register 4 contains a negative value, the negative of the pad char-
! acter is in the rightmost byte of the register. Assuming you have squirrelled
! away the buffer address in register 6:
! PIPBFRAP (R6),'Not on your nelly!'
! Or you can specify everything in the required registers:
! LR R1,R6
! LA R4,=C'Not on your nelly!'
! LA R5,18 (Perhaps)
! PIPBFRAP ,
! A nonzero return code from PIPBFRAP indicates that CMS/TSO Pipelines has
! run out of storage. You must issue message 122 in this case unless you
! specify EXIT= on the macro.
! PIPBFRLD PIPBFRLD is a variant of PIPBFRAP that clears the buffer before loading the
! specified string.
! PIPVERV2 Verify that your function runs on a recent version of CMS/TSO Pipelines.
! After this macro, general register 15 contains a positive value if the entry point
! is available.
! Note that FPLNXH is loaded first, that the module entry point is reset to it, and that the
! module is generated from that symbol.
Coroutines are not a new concept for users of CMS/TSO Pipelines. Stages in a pipeline
run as coroutines; they take turns at processing data, but they do not call each other
directly. Instead, pipeline stages yield control to the pipeline dispatcher, which creates the
appearance that each stage is entirely in control of the sequence of events.
In the same way, pipeline sets run as coroutines when the runpipe built-in program is used
to run a pipeline and process the messages and event records that are issued.
With copipes, this concept is taken further to allow an application that is not in any way
controlled by CMS/TSO Pipelines to access data in the pipeline and to provide data for the
pipeline. A fitting stage is the space warp through which records move between the pipe-
line and the application program. A fitting stage is the application’s agent in the pipeline.
A pipeline can contain any number of fitting stages.
To allow for additional information that must be specified to run copipes, CMS/TSO
Pipelines has been changed to accept a new form of parameter list containing parameter
tokens. This parameter list cannot be mistaken for a command entered from the terminal.
The structure of the parameter list allows for easy future enhancement. Refer to
Chapter 1, “Issuing pipeline requests with parameter tokens” on page 2.
When the application starts the copipe, it can use either the current string representation of
the pipeline specification or a new format called an encoded pipeline specification. The
encoded pipeline specification is structured and does not rely on special characters to
delimit stages or pipelines. This is particularly useful when the application wishes to hand
over data that are in a format that the application does not understand or does not wish to
parse. Refer to Chapter 2, “Encoded pipeline specifications” on page 7.
Encoded pipeline specifications and copipes can be invoked only through parameter tokens,
but they are not mutually requisite; nor are they mutually exclusive. A pipeline that
contains a fitg parameter token is run as a copipe with the application that issues the
request. A pipeline request that does not include the fitg parameter token is run to
completion before control is returned to the application, just as it would be on a PIPE
command. In either case, the pipeline to be run can be specified either by a character
string (pipe token) or as an encoded pipeline specification (encd token).
General notes
1. Addresses and lengths are specified in a generalised way that can save you building
parameter lists dynamically when you need to substitute bits of runtime information
into a statically assembled structure. Refer to Chapter 3, “Specifying addresses and
lengths in control blocks” on page 14.
2. The word “label” is ambiguous when CMS/TSO Pipelines terminology is merged with
the terminology of procedural programming. In both cases, however, a label identifies
an object. In the syntax diagrams in this book, the syntax variable label is used for
labels that identify an Assembler instruction or a control block, whereas pipeLabel is
used for labels that define a multistream pipeline topology.
A pipeline set that runs as a copipe contains one or more fitting stages, each of which
defines a point at which the application can send data into the pipeline or receive data
from the pipeline depending upon the position of the fitting stage in the pipeline.
For each fitting stage, the application defines a request parameter list (RPL), which it uses
to indicate the next action the fitting stage should take.
For each pipeline set run as a copipe, the application defines a communications area to
contain the information needed to allow the application and the copipe to resume one
another. An application can define multiple communications areas and invoke multiple
concurrent copipes, but it remains to be seen whether this capability can be put to any
practical use.
The pipeline is invoked using a parameter token list that contains a fitg token that
specifies the address of the communications area and a pipe or encd token that specifies
the pipeline to run.
When nostart is specified in the flag byte of the communications area, the pipeline
returns on the initial command or call after the scanner has processed the pipeline
specification, but before any stages have been started. When nostart is omitted, the pipe-
line is started and runs until it can move no further data.
Any errors detected by the pipeline specification parser or syntax exits will cause a
nonzero return code on the initial call. This means that the pipeline has been abandoned
and thus, no address is provided for the resume function. If an rc parameter token was
provided, the fullword addressed by this token will be set to the return code, in addition to
it being provided in general register 15.
If the initial return code is zero, CMS/TSO Pipelines stores information in the communi-
cations area before it returns to the application (resumes the application). The communi-
cations area is declared and generated with the PIPFTPRM macro.
1 In the values for the flag bits, the variable symbol “&P.” represents the string specified by the PREFIX= keyword on the PIPFTPRM macro.
When CMS/TSO Pipelines returns control on the initial call with a return code of 0, the
pipeline set just created is kept in suspended animation until the application resumes it by
issuing the PIPRESUM macro. As the only parameter on PIPRESUM, the application provides
the address of the communications area, which contains the anchor that was returned
initially and a list of fitting requests (RPLs) describing buffers that contain input records
and places where the pipeline can store the address and length of output records. See
Figure 7 on page 39 for the parameter list layout. The pipeline dispatcher then runs until
it can find no more work to do. If the pipeline terminates, the status code is set to that
effect. The pipeline then returns to the application, allowing it to resume.
The application then takes another turn, processing the data it has received from the pipe-
line and providing new data to be processed in the pipeline. The application then resumes
the pipeline to allow it to take another turn.
A fitting stage represents a point in the pipeline where the calling program can inject or
extract records. In order that multiple fittings can be supported, the fittings are given an
identifier, which can be one to eight characters. Case is respected in fitting identifiers.
The scope of a fitting identifier is the pipeline set. That is, all fitting identifiers must be
unique within the pipeline set, which comprises the initial pipeline specification and all
pipeline specifications added by ADDPIPE and CALLPIPE.
A fitting stage can either read data from the pipeline or write data into the pipeline, but it
cannot do both. A fitting that writes data from the application into the pipeline is a first
stage; it has the behaviour typical of an input device driver. A fitting that reads data from
the pipeline into the application is not a first stage; it has the behaviour typical of an
output device driver. (It also passes the record to its output stream, if it is connected, and
it does not propagate end-of-file backwards.)
The pipeline can contain stages that wait for external events, as for example tcpclient.
When it does, the application can run while such a stage waits. See “Using stages that
wait for external events” on page 40.
Starting a copipe
A copipe is established if the pipeline request contains a fitg request token. Figure 6
shows the layout of the parameter list when a copipe request is issued on CMS.
The communications area would be defined by a PIPFTPRM macro in the work area:
PIPFTPRM TYPE=INLINE,PREFIX=COMM_
Note: On CMS, you can use only registers 0 and 1 as a base for S-type references; and
you must specify COPY=NO on the CMSCALL macro to be sure that the addresses passed to
CMS Pipelines are the ones you have passed to CMS. Refer to “Using S-type references on
CMS” on page 14 for further information.
Figure 7 shows the parameter list layout. This structure is the same on CMS and z/OS.
The leftmost bit of the pointer to the communications area must be on to indicate that
there is only one parameter on the resume operation. Return code -10 is set in general
register 15 and the resume operation is suppressed, if the parameter list has more than one
entry or if the communications area anchor does not point to the appropriate type of
control block.
Terminating a copipe
The application can force the copipe to terminate by issuing the PIPRESUM macro with the
TERMINATE=YES keyword operand. This forces the copipe to terminate all active fitting
stages. If this does not terminate the pipeline, all stages that are waiting for an external
event are signalled to terminate, in the same way they would terminate if a record were
passed to a pipestop stage. If this still does not terminate the pipeline, it will be forced to
stall. The application can be sure that the pipeline has been terminated and that all
resources have been released when it regains control after this final resume operation.
The application must ensure that the pipeline has terminated before it terminates itself.
Resource leakage is likely if the pipeline is left running; on z/OS, some of the lost
resources may be reclaimed at the end of the task, but others (e.g., subpool 0) will not be
reclaimed until the job step task terminates. On CMS, resources will not in general be
reclaimed until ABEND recovery.
If the “done” status code has not been received, the application should issue the PIPRESUM
macro to terminate, as described above. Such a call will always set the “done” status.
Once the application has received a “done” status code, it must not resume the pipeline.
Because the count of stages waiting is decremented as they become able to run, the appli-
cation can see NO_DATA and zero stages waiting if an event occurs after the pipeline
dispatcher has determined that there is no more work, but before the application tests the
counter. In this situation, the application should resume the pipeline once more. If
NO_DATA is still set and the counter is still zero, the pipeline is truly not able to move
further and the application must recover by supplying or consuming data, or it must termi-
nate the pipeline. An alternative strategy is to use the WAITRPL flag and throw the
problem over the fence to CMS/TSO Pipelines.
Using fitting stages to inject and extract records from the pipeline
The PIPFTRPL macro instruction generates the fitting request parameter list, which repres-
ents an action to be performed by a fitting stage. There must be a separate fitting request
parameter list for each fitting stage in the pipeline set.
A request can be in one of the states listed below. An application would normally create
an RPL in the Read or Write state, but it can even create an Idle RPL.
Some values indicate that the application is in control of the fitting, while others indicate
that CMS/TSO Pipelines is currently in control of the fitting. The application must not
change an RPL unless the fitting is in one of the states where it is indicated that the appli-
cation may change the state.
Idle The application does not wish any action to take place; CMS/TSO
Pipelines has no pending action to report. An idle request is ignored.
The application can reactivate an idle RPL by taking it to state Read or
Write, as appropriate, at some later time.
Ended The corresponding fitting stage has terminated. The application must not
change the state of such an RPL. To improve efficiency, the RPL should
be removed from the list.
Write The application has provided data to be written into the pipeline by the
fitting stage. The corresponding fitting stage must be first in a pipeline.
The application should store the address of the record in the field that
has the label &P.BUFFER; it should store the length of the record in the
field labelled &P.BUFFER_LENGTH. The contents of the designated storage
area must remain stable until the RPL reaches the W.Done state or the
Ended state.
Be careful!
¹ A particular fitting stage can either read or write, but it cannot do both.
¹ Only one RPL may refer to any particular fitting.
¹ The FITTING_PTR field of the RPL is resolved to the address of a control block that
represents the fitting stage; the application must not modify the contents.
¹ When a copipe is inactive, the only way to find its control block is through the anchor,
which you have control over. If you lose the anchor or terminate your application
before the pipeline has completed, you are likely to suffer storage leakage.
¹ If you resume the copipe after it has completed, results are unpredictable, but invari-
ably unpleasant. Expect an ABEND as your reward.
Macros
label Specify the label for type=csect. Note that the label is not specified in
column one of the card, as is customary.
TYPE Specify DSECT to generate a separate DSECT containing the definition of
this parameter list. Specify INLINE to generate the definition inside
some other section (DSECT or CSECT). Specify CSECT to generate a
parameter list without internal labels (entirely without labels if label is
omitted).
PREFIX Specify the prefix to be used for the labels that are generated when
type=DSECT or type=INLINE is used.
FLAGS Specify flag values to be assembled initially.
RPL Specify the address of the head of the list of RPLs.
label Specify the label for TYPE=CSECT. Note that the label is not specified in
column one of the card, as is customary.
TYPE Specify DSECT to generate a separate DSECT containing the definition of
this parameter list. Specify INLINE to generate the definition inside
some other section (DSECT or CSECT). Specify CSECT to generate a
parameter list without internal labels (entirely without labels if label is
omitted).
PREFIX Specify the prefix to be used for the labels that are generated when
type=DSECT or type=INLINE is used.
NEXT Specify the address of the next request parameter list in the chain.
FITTING Specify the identifier of the fitting stage you wish to reach. This is
specified as the argument of the fitting stage where it is defined in the
pipeline specification or in the ARGS= operand of the PIPSCSTG macro
that defines the stage. Fitting names must be unique across the pipeline
set. If you omit this keyword operand, you must store the fitting name
into the RPL before you make it available to CMS/TSO Pipelines.
START Specify the initial state for the request parameter list. You can specify
IDLE, READ or WRITE.
communi- Specify the address of the PIPFTPRM macro that defines the communi-
cations area cations area as the only positional operand. This operand is specified as
an “Address” type. This operand is required.
TERMINATE Specify YES to force the pipeline to terminate.
RPL Specify the address of a PIPFTRPL macro. This RPL must be the first on
the list of requests. Omit this operand to use the same RPLs as were
used in the previous resume operation.
WAITFOR Specify the address of an RPL that must be ready before the application
can resume.
This macro requires a work area to build its parameter list. It assumes that the macro is
issued within a PROC/PROCEND procedure. If you do not use these constructs, you must
code the PIPRESUM macro expansion “by hand”.
The symbol “&P.” stands for the prefix as specified in the PREFIX= operand of the macro
that defines the data area. The default is the name of the macro.
PIPFTPRM—Communications area
&P.REQTYPE
Figure 10. Values for
&P.TERMINATE 02 Terminate the pipeline. First signal all fitting stages to stop. If this does
not terminate the pipeline, it is stalled. This bit can be set by the PIPRESUM
macro.
&P.WAITRPL 04 The designated RPL must be ready or terminated before the application is
resumed. This bit can be set by the PIPFTPRM macro and by the PIPRESUM
macro.
&P.STATUS
Figure 11. Values for
&P.STATE
Figure 13 (Page 1 of 2). Values for
&P.REASON
Figure 14. Values for
Not only does this make it easier for the author to maintain CMS/TSO Pipelines for
multiple platforms, it also enables vendors to support CMS/TSO Pipelines in their own
operating systems by replacing these system services with their own code.
CMS/TSO Pipelines reaches the system service routines via the “system services vector”.
A user can replace parts or all of the system services vector by specifying the sysv param-
eter token. The token contains a pointer to a variable length vector of fullwords. This
vector should be generated by the macro FPLSYSSV. The vector that is actually used by
CMS/TSO Pipelines is constructed by merging the user specified vector with the current
vector or with the system defaults, which are supplied by CMS/TSO Pipelines.
The first fullword of the system services vector contains the count of entries in the vector
(excluding this first word). That is, a null vector consists of a single fullword of binary
zeros.
Terminology
The system services vector is designed with the CMS multitasking model in mind, but
CMS/TSO Pipelines makes no assumptions about there being processes and threads. In
this chapter, the term “task” will refer to the individual dispatchable unit supported by the
underlying host system.
A task is identified by a sixty-four bit number. The first fullword of this is arbitrarily
called the process ID; the second fullword is equally arbitrarily called the thread ID. A
task ID is a unique combination of process and thread IDs.
The term preemptive task switching describes a multitasking dispatcher that can switch
control between tasks at arbitrary times, for example as a result of an interrupt. OS/390 uses
such a dispatcher. The action of stopping a task temporarily is also called preempting it.
In contrast, both CMS Multitasking and CMS/TSO Pipelines use a coroutine style of
dispatching; both switch between tasks only when a task performs an overt action that
allows a task switch (such as suspending itself or creating another thread).
But CMS/TSO Pipelines supports being run by an operating system that uses preemptive
task switching. Thus, it calls a locking service to serialise access to global resources.
On CMS, the command is used to initialise CMS Pipelines. This command is normally
issued by the bootstrap module. On z/OS, the initialisation is performed as part of the first
PIPE command (there is no separate bootstrap module).
CMS Pipelines switches to user key when it processes the PIPMOD command; and it
switches back to key zero when it returns. The PIPE nucleus extension is a user nucleus
extension; branch entries to it must be in user key. Both commands must be entered in
supervisor state.
TSO Pipelines runs unauthorised; that is, in problem state and key 8.
CMS/TSO Pipelines itself does not change the supervisor/problem state nor does it enable
interrupts, but REXX does; thus, any REXX stage will enable for interrupts. It is unspecified
which built-in programs are in fact implemented as REXX programs, be that completely or
in parts.
! A few stages, such as buffer, instore, outstore, and storage supports an ALET operand to
! specify that data reside in the specified data space. As a result, these stages modify the
! addressing mode and access registers; they restore the addressing mode before calls to the
! pipeline dispatcher, but they do not save or restore the access registers.
Anchors
CMS/TSO Pipelines accepts, from the system service routines, a global anchor and an
anchor for each task. These anchors are for the sole use of the system service routines;
CMS/TSO Pipelines treats them as “magic cookies”.
The second word of the system services vector is the global anchor. The contents of this
word (which are zero by default) are provided when CMS/TSO Pipelines calls a service
and it does not know which task is associated with the call.
When CMS/TSO Pipelines knows for which task it is calling a service, it supplies the
task’s anchor.
Nota bene: Whether CMS/TSO Pipelines knows is not necessarily the same as whether
CMS/TSO Pipelines ought to know. Also note that CMS/TSO Pipelines does not serialise
access to the global anchor.
Register conventions
When CMS/TSO Pipelines calls a system service, it supplies parameters in general registers
0 and up.
It usually supplies a standard type-1 save area of eighteen fullwords in general register 13,
but see the Prologue and Epilogue services for exceptions. See also Enqueue and
Dequeue.
It supplies the anchor (either the global one or the task one) in general register 15.
Note that CMS/TSO Pipelines provides no base register for the system service routine.
The system service routine must return with general registers 2 through 13 unchanged
(except as noted for the storage management services). Where no return value is specified
for general register 0 or 1, the contents of the registers need not be restored.
System services
The various services are described in the following sections, grouped into the major cate-
gories,
¹ Task Management
¹ Storage Management
¹ Resource Management
¹ Exit Management
The first word of the heading for each section, which is the short name for the service, is
also the name of the keyword operand that specifies the entry point for the service when
you code the FPLSYSSV macro to build your system services vector.
Task management
CMS/TSO Pipelines uses this information to determine whether or not a PIPE recursion is
from a known thread by comparing the values with values returned previously. It also
passes the information to the Resume service; it does not interpret or use the values
returned in any other way.
Input:
! R0 Address of a 16-byte area where the service must return the identifier for the task.
R13 Standard type-1 save area.
R14 Return address.
R15 The global anchor.
Notes:
1. On CMS the process ID is returned in bytes 4-7 and the thread ID is returned in bytes
12-15. Other bytes are cleared to binary zeros.
2. On MVS the ASID is returned in bytes 0-7 and the TCBID in bytes 8-15.
Input:
R1 The address of a CMS WAITECB parameter list (three doublewords), which is followed
immediately by a standard OS ECB. The storage area is private to the task.
R13 Standard type-1 save area.
R14 Return address.
R15 The task’s anchor.
Output: None.
Resume—Resume a task
CMS/TSO Pipelines calls the Resume service when an asynchronous exit has posted a
pipeline ECB on which a stage is waiting. Thus, the stage can resume after a PIPWECB
macro. This service can also be called from a different thread as the result of a PIPPOST
macro instruction.
Input:
R0 The address of a CMS WAITECB parameter list (three doublewords), which is followed
immediately by a standard OS ECB (that is, the contents of general register 1 on the
corresponding call to the Suspend service).
R1 The thread ID to be resumed. This was returned in general register 0 by the TaskID
service.
R2 The process ID to be resumed. This was returned in general register 15 by the
TaskID service.
R13 Standard type-1 save area.
R14 Return address.
R15 The task’s anchor.
Output: None.
Storage management
Storage management services are called in cases where no work area is available; that is,
storage management is called precisely to allocate a work area. As a result, the two
storage allocation services and the release service do not follow standard type-1 save area
conventions.
on the operating system. On CMS, dropping the PIPMOD nucleus extension causes all
permanent storage to be returned; on ABEND recovery CMS Pipelines notes that its
permanent storage is no longer allocated. On z/OS, permanent storage is recovered by
the operating system when the job step task terminates.
When the task storage managers are called from prologue and epilogue code, general
register 13 will point to the save area provided by the system. The service routines may
use general registers 2 through 6 as additional work space; the storage allocation routines
must restore those registers they use from the save area before returning; the storage
release macro does not need to restore those registers.
The extend service and the permanent storage management services are never called from
a prologue; as a result they use standard calling conventions.
Input:
R0 The number of doublewords required.
R13 Standard type-1 save area. Registers have already been saved into this save area;
thus, the service routine must not store into it. But it must restore registers 2
through 6 from this save area, if they are used as work registers.
R14 Return address.
R15 The global anchor.
Output:
R0 The number of doublewords actually allocated. This number may be larger than the
number requested. Except when the Extend service has been used successfully,
CMS/TSO Pipelines returns the amount of storage actually allocated (rather than the
amount requested). When the storage is allocated as part of a buffer, CMS/TSO
Pipelines may use any additional storage that the storage manager might provide.
R1 The address of the first byte of the storage area allocated.
R15 Return code. 0 when storage is allocated; 1 when storage is not available.
Release—Return storage
CMS/TSO Pipelines calls the Release service to return an area of storage that was previ-
ously allocated by the Below or the Above service. It never splits an allocated area; if the
Extend service is provided and an area has been extended successfully, CMS/TSO Pipelines
will return all storage in an extended area as a single unit.
Input:
R0 The number of doublewords to release.
R1 The address of the first byte of the storage area to release.
R13 Standard type-1 save area. Registers have already been saved into this save area;
thus, the service routine must not store into it.
R14 Return address.
R15 The global anchor.
Output: None.
Input:
R0 The number of doublewords to add to the allocation.
R1 The address where storage should be allocated.
R13 Standard type-1 save area.
R14 Return address.
R15 The global anchor.
Output:
R0 The number of doublewords actually allocated. This number may be larger than the
number requested.
R15 The return code. 0 means that storage has been allocated. 1 means that storage is
not available; this may be because the storage area is already in use or because the
underlying system does not support allocation of storage at a particular address.
Input and output register conventions for the Persistent service is identical to the Above
one. General register 13 points to a standard type-1 save area for use by the service.
Resource management
The Enqueue service must ensure that only one task can enqueue on a particular address at
any one time; it can assume that the area will be enqueued for a short period. The next
system service call in the task will be for the Dequeue service.
Input:
R1 The address of a thirty-two byte area of storage for use by the Enqueue service. The
same area is used on all tasks when they access that particular area of storage.
Thus, the system service routine can build a semaphore or some other
synchronisation mechanism in this area. This area is initialised to binary zeros.
R13 Standard type-1 save area. The forward pointer at offset 8 of this save area points to
a 104-byte work area (which can be considered a standard type-1 save area with a
thirty-two byte extension).
R14 Return address.
R15 The global anchor.
Output: None.
Input:
R1 The address of the thirty-two byte area of storage that was passed to the Enqueue
service to obtain exclusive access to the area.
R13 Standard type-1 save area. The forward pointer at offset 8 of this save area points to
a 104-byte work area (which can be considered a standard type-1 save area with a
thirty-two byte extension).
R14 Return address.
R15 The global anchor.
Output: None.
Exit management
Input:
R0 If general register 0 is zero, the existing exit must be cancelled (if it is still estab-
lished). General registers R1 through R3 are not used.
If general register 0 is nonzero, it contains the address of the exit to be driven.
R1 A “user word” to be provided to the exit in general register 1 when it is called.
R2 The leftmost word of the TOD clock value at which time the exit must be driven.
R3 The rightmost word of the TOD clock value at which time the exit must be driven.
R13 Standard type-1 save area.
R14 Return address.
R15 The global anchor.
Output:
R15 The return code. 0 means that the exit is established. 1 means that the current time
is later than the TOD clock value specified (that is, the event has already occurred).
The exit will return with general registers 2 through 13 unchanged. The exit may call the
Timer service to establish a new event. The operating system must not drive the timer exit
recursively.
Programming notes
Enqueue
The Enqueue service should make no assumption that all enqueues will be for the same
area; but clearly it will suffice to enter a “must complete” mode which prevents any task
switching.
Storage management
The implementation may elect to treat requests for persistent storage the same as requests
for Above. The default CMS system service routine does so. The default TSO system
service routine allocates persistent storage from subpool 132.
Global anchor
If the operating system wishes to use a nonzero global anchor, it may be easier to issue
two PIPMOD commands. The first one should be for a vector of two fullwords, where the
second one contains the global anchor. The second PIPMOD command should then refer-
ence the system services vector that has been generated by the FPLSYSSV macro with the
TYPE=INLINE operand.
Issuing two PIPMOD commands assumes that CMS/TSO Pipelines can use the default
storage management for its global data area. If this is not the case, the operating system
must build a system services vector that contains the anchor as well as addresses of the
system service routines.
If reentrancy is not required, the operating system can generate the system services vector
with the TYPE=CSECT operand and then store the anchor at the address FPLSYSANCHOR
(assuming the default prefix is used).
If reentrancy (or read only code) is required, the operating system must build the system
services vector in dynamically allocated storage. It can use FPLSYSSV TYPE=DSECT macro
to define the system services vector in its work area. It can then copy the system services
vector expanded by FPLSYSSV TYPE=INLINE into this area and then store the global anchor.
CMS Pipelines will use the system services vector specified for all storage management
when initialised in this way.
The sysv token specifies the address of the system services vector override. This service
vector is used on all requests that are not related to a pipeline set. It also supplies the
default when a PIPE command is issued on a thread that has no active pipeline.
The usex token is valid only through this interface; it is four fullwords. It is supported
only as the first call after the PIPMOD nucleus extension is established (be that by
NUCXLOAD or SEGMENT LOAD) or immediately after CMS ABEND recovery. The second
fullword should contain binary zeros; the last two fullwords specify the name of the
nucleus extension to be set up to create a pipeline set. The usex parameter token serves
the function that is normally accomplished by the PIPMOD INSTALL command.
The vector specified with the PIPE command governs the pipeline set being created and
recursions from within this pipeline set.
Macro
Use the macro FPLSYSSV to generate the services vector override that is specified in the
sysv parameter token.
┌─TYPE=DSECT──┐ ┌─PREFIX=FPLSYS─┐
►►──label──FPLSYSSV──┼─TYPE=CSECT──┼──┴─PREFIX=word───┴──►
└─TYPE=INLINE─┘
►──┬────────────────┬──┬────────────────┬──┬─────────────────┬──►
└─ANCHOR=address─┘ └─TASKID=address─┘ └─ENQUEUE=address─┘
►──┬─────────────────┬──┬───────────────┬──┬───────────────┬──►
└─DEQUEUE=address─┘ └─BELOW=address─┘ └─ABOVE=address─┘
►──┬─────────────────┬──┬────────────────┬──┬─────────────────┬──►
└─RELEASE=address─┘ └─EXTEND=address─┘ └─SUSPEND=address─┘
►──┬────────────────┬──►◄
└─RESUME=address─┘
label The label for the generated system services vector. This is required for
TYPE=DSECT.
TYPE DSECT The constants are in a DSECT and have labels attached. The
label is used as name of the DSECT.
CSECT The constants are in the current section and have labels
attached.
INLINE The constants are in the current section and have no labels
attached. This is the recommended way of generating a
system services vector.
PREFIX The prefix to use when labels are attached to constants. The actual label
is composed of the prefix and the keyword name for the routine. The
unadorned prefix is generated for the count (the first word). You can
specify a null prefix.
address Specify the label of the entry point for the routine; or zero to use the
existing entry or default; or minus one to replace the existing entry with
the default. Specifying minus one in effect retracts an existing override.
The default for omitted keyword operands is zero.
Notes:
1. A certain amount of reasonableness is assumed in the use of the system services
vector, but this is not enforced.
2. If the Enqueue service is provided, the Dequeue service must be provided as well.
3. If the operating system does not use the default storage management for the operating
environment for which CMS/TSO Pipelines is generated, it must supply all four
storage management services, or none.
4. Either both of the Suspend and the Resume services must be specified, or none.
Notes:
1. On z/OS prior to TSO Pipelines 1.1.11, persistent storage was not used for the global
control blocks; thus the first two user words were initialised on each PIPE command.
Multitasking is not supported within a PIPE command. Recursions of the PIPE
command are not recognised; the pipelines will run in parallel, as determined by the
z/OS dispatcher.
2. On CMS, concurrent PIPE commands on different threads or processes are supported.
CMS/TSO Pipelines allocates the storage that contains the user words and initialises it to
binary zeros. It exposes the address of the user words in two ways:
¹ The CMS/TSO Pipelines exit facility exposes the user words for global, set, and stage,
but it does not expose the the user words for thread and specification. The stage user
words are exposed as part of a larger data area (called the PIPEBLOK), which is made
available to the exit. Refer to User Exit in CMS Pipelines Installation and Mainte-
nance Reference, SL26-0019.
¹ The PIPUWRD macro returns in register 15 the address of a list of five pointers to the
user words in the hierarchy described above. The list is stable until the next call for
pipeline services in the pipeline specification. (The return code is zero if there is no
active stage.)
Figure 17. PIPUWRD return code and the uwrd parameter token
PIPUWRD PIPTPARM
Note the use of the DMSPDEFS macro, which defines several symbolic constants that are
used by the other macros.
load pgmisamp (start
►DMSLIO740I Execution begins...
►Hello, World!
►Ready; T=0.05/0.11 10:26:41
When this program is combined with FPLNXH and FPLNXG into a filter package (that
contains no filters), spec will resolve the function name SUM to the function in this
package (unless someone installed another filter package in front of this one).
FUN TITLE ' User function test case for SPEC +00010000
COPYRIGHT IBM Danmark ApS 2010' 00020000
COPY PGMID 00030000
SPACE 2 00040000
*********************************************************************** 00050000
* * 00060000
* Test case for a filter package that contains user-written * 00070000
* functions for spec. * 00080000
* * 00090000
* Change activity: * 00100000
* 11 Apr 2010 New module by John P. Hartmann, CPHART(JOHN) * 00110000
* * 00120000
*********************************************************************** 00130000
SPACE 2 00140000
FPLFUN MODBEG FREETYPE=NONE 00150000
DMSPDEFS VECTOR=R9,VECTOR2=YES 00160000
FPLSPCTR PREFIX=C 00170000
COPY FPLFUNTB 00180000
COPY FPLFUNTE 00190000
FPLFUNTB , Flags 00200000
FPLFUNTE , Define length 00210000
EJECT 00220000
*********************************************************************** 00230000
* * 00240000
* Sum a series of binary numbers * 00250000
* * 00260000
*********************************************************************** 00270000
SPACE 2 00280000
SUMIT PROC SAREA=HLLSTACK,ENTRY=NO,WORKBASE=R11 00290000
PBEGIN , 00300000
PIPVERV2 EP=SPVTI 00310000
LTR R15,R15 00320000
PIPERM 1000,EXIT,COND=NOTPOSITIVE,SUB='FPLSPVTI' 00330000
LR R7,R2 Move counter base 00340000
LR R8,R3 00350000
LR R6,R0 Result 00360000
ZIP R0 Sum 00370000
USING C_SECT,R7 00380000
REPEAT , 00390000
CLI C_SIGN,C_SIGNOMITTED 00400000
CONTINUE COND=EQUAL 00410000
CLI C_SIGN,C_SIGNBIN 00420000
PIPERM 728,EXIT,COND=NOTEQUAL, +00430000
SUB=('Not binary:',(C_SIGN,1,HEX)) 00440000
A R0,C_BINARY 00450000
UNTIL INCR=(R7,C_LENGTH),BCT=R8 00460000
LR R7,R6 Get result 00470000
ST R0,C_BINARY 00480000
MVI C_SIGN,C_SIGNBIN 00490000
DROP R7 00500000
ZIP R15 00510000
PEXIT RC=(R15) 00520000
PROCEND , 00530000
EJECT 00540000
*********************************************************************** 00550000
* * 00560000
* Function table * 00570000
* * 00580000
*********************************************************************** 00590000
SPACE 2 00600000
ENTRY &MODULE.TB 00610000
&MODULE.TB FPLFUNTB TYPE=CSECT 00620000
FPLFUNTE SUM,SUMIT,RESULT=INT,MAX=10, +00630000
ARGS=(INT,(INT,OPT,SAME)) 00640000
FPLFUNTN , 00650000
MODEND PRINT=GEN 00660000
A gentle warning: You are not likely to succeed if you try just to pick a few lines out of
the above program if your function deals with string arguments.
Index
Fitting identifier
Special Characters Scope 38
fitting 34 flag 4
fitting mode 4 FLNXG 19
fitting requests 37 FPLEPTBL 20
FPLFLTPK 19
FPLFUN
A ASSEMBLE 67
Above 54
FPLGRXTX 23
Addressing in DSECTs 14
FPLMSTXT 22
ASID 52
FPLMSTXT 22
ASSEMBLE
FPLNXF 19
FPLFUN 67
FPLNXH 19
FPLPIPE command 3
B FPLSPCTR 29
FPLSPVES 29
Below 54
FPLSYSSV 50
C G
CALLTYP=EPLIST 14
CALLTYP=PROGRAM 14 GENMSG 22
CMSCALL 2, 14
Copipes 34
COPY=NO 14
L
LINK 3
Coroutine 50
LOAD 3
D M
DELETE 3
Macros
Dequeue 56
FPLSYSSV 50
DMSPDEFS 66
msgl 4
DMSPFP 19
DSECT
Addressing 14 N
NUCEXT 3
NUCXMAP
E NUCXMAP 5NUCXMAP 3
ECB 38
encd 4
Encoded pipeline specification 34, 7 P
Enqueue 56 Parameter tokens
EPTABLE 23 encd 4
REXXES 23 fitg 4
Extend 55 flag 4
External events 38 msgl 4
pipe 4
rc 5
F sysv 5, 58
filterpack 18 usex 58
fitg 4 uwrd 5
fitting 37 Persistent 55
R
rc 5
Release 54
ReleasePersistent 55
Resume 34, 53
REXXES 23
EPTABLE 23
RITA
RITA 5RITA 9
runpipe 34
S
SCBLOCK 3
Scope of fitting identifier 38
Status codes 37
Suspend 53
System service
Above 54
Below 54
Dequeue 56
Enqueue 56