BPX1ATX (attach_exec) example
The program ictasma located at ict/bin
gets control on a subtask and as a child process of the caller,
and is passed arguments WK18, DEPT37A, and RATE(STD,NOEXC,NOSPEC).
No environment arguments are passed.
For the callable service, see attach_exec (BPX1ATX, BPX4ATX) — Attach a z/OS UNIX program.
AMODE 64 callers use BPX4ATX (attach_exec) 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
ST 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
ST R15,ARGSLST+04 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
ST R15,ARGSLST+08 Argument address parm list
*
MVC ENVCNT,=F'0' Number of env. data items passed
MVC ENVLENS,=F'0' Addr of env. data length list
MVC ENVPARMS,=F'0' Add of env. data
*
MVC EXITRTNA,=V(EXITRTN) ->exit routine
* MVC EXITPLA,=A(exit paramter list as expected by EXITRTN)
SPACE ,
CALL BPX1ATX, +
(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 +
EXITRTNA, Input: Exit routine address or 0 +
EXITPLA, Input: Exit Parm list address or 0+
RETVAL, Return value: Child PID or -1 +
RETCODE, Return code +
RSNCODE), Reason code +
VL,MF=(E,PLIST) ----------------------------------