BPX4SPN (spawn) example
The program ictasma located at ict/bin
gets control as a child process of the caller, and is passed
arguments WK18, DEPT37A, and RATE(STD,NOEXC,NOSPEC). No
environment arguments are passed. The file descriptor
count is set to 0, indicating that the child shall
inherit all of the parent's file descriptors. The inheritance
area passed is set to all zeroes, indicating that the child
shall inherit the parent's attributes without change. For
the callable service, see spawn (BPX1SPN, BPX4SPN) — Spawn a process.
AMODE 31 callers use BPX1SPN (spawn) example.
MVC BUFLENA,=F'16'
MVC BUFFERA(16),=C'/ict/bin/ictasma'
MVC ARGCNT,=F'3'
* First
LA R15,=F'4' Length
ST R15,ARGLLST+00 Length parm list
LA R15,=CL4'WK18' Argument
STG R15,ARGSLST+00 Argument address parm list
* Second
LA R15,=F'7' Length
ST R15,ARGLLST+04 Length parm list
LA R15,=CL7'DEPT37A' Argument
STG R15,ARGSLST+08 Argument address parm list
* Third
LA R15,=F'22' Length
ST R15,ARGLLST+08 Length parm list
LA R15,=CL22'RATE(STD,NOEXC,NOSPEC)' Argument
STG R15,ARGSLST+16 Argument address parm list
*
MVC ENVCNT,=F'0' Zero environment args passed
MVC ENVLENS,=F'0' Addr of env. data length list
MVC ENVPARMS,=F'0' Add of env. data
*
MVC FDCNT,=F'0' Zero file descriptors passed
MVC FDLST,=F'0' File Descriptor list
*
XC INHE(INHE#LENGTH),INHE Clear Inheritance structure
SPACE ,
CALL BPX4SPN, +
(BUFLENA, Input: Pathname length +
BUFFERA, Input: Pathname +
ARGCNT, Input: Argument count +
ARGLLST, Input: Argument length list +
ARGSLST, Input: Argument address list +
ENVCNT, Input: Environment count +
ENVLENS, Input: Environment length list +
ENVPARMS, Input: Environment address list +
FDCNT, Input: File desriptor count +
FDLST, Input: File descriptor list +
=A(INHE#LENGTH), Input: Length of Inheritance area +
INHE, Input: Inheritance area +
RETVAL, Return value: Child PID or -1 +
RETCODE, Return code +
RSNCODE), Reason code +
MF=(E,PLIST) ----------------------------------