BPX1MPC (mvsprocclp) examples

  1. The following code causes all z/OS UNIX-related resources to be released for this thread, and if this is the last thread in the process, for the process.
                                                  
             XC    WAST(WAST#LENGTH),WAST                                   
             MVI   WASTEXITCODE,57       User defined exit code             
             SPACE ,                                                        
             CALL  BPX1MPC,              MVS Process cleanup               +
                   (WAST,                Input: Ending status code 0-255   +
                   RETVAL,               Return value: 0, -1 or 1          +
                   RETCODE,              Return code                       +
                   RSNCODE),             Reason code                       +
                   VL,MF=(E,PLIST)       ---------------------------------- 
  2. To indicate that the process ended with a specific code, the application should set up the WAST as follows, and then call BPX1MPC:
    **************************************************************
    *  Set up the WAST (exit status word)                        *
    *  with a user defined exit code                             *
    **************************************************************
    LA    R3,0                    Set R3 with zero and
    ST    R3,LOCALWAST            clear the WAST
    LA    R14,LOCALWAST           Get address of WAST
    MVI   WASTEXITCODE(R14),44    Set exit status
  3. To indicate that the process ended with a terminating signal, the application should set up the WAST as follows prior to calling BPX1MPC:
    **************************************************************
    *  Set up the WAST (exit status word)                        *
    *  with a terminating signal                                 *
    **************************************************************
    LA    R3,0                  Set R3 with zero and
    ST    R3,LOCALWAST          clear the WAST
    LA    R14,LOCALWAST         Get address of WAST
    MVI   WASTSIGTERM(R14),09   Exit with sigterm (x'09')
  4. If an application does not care about the terminating status of a process, and the parent will not check the status after issuing a call to the wait service, then the application should set the WAST to zero prior to calling BPX1MPC:
    **************************************************************
    *  Set up the WAST (exit status word)                        *
    *  Do not set any exit codes                                 *
    **************************************************************
    LA    R3,0                  Set R3 with zero and
    ST    R3,LOCALWAST          clear the WAST
    LA    R14,LOCALWAST         Get address of WAST

For the callable service, see mvsprocclp (BPX1MPC, BPX4MPC) — Clean up kernel resources. For the data structure, see BPXYWAST — Map the wait status word. AMODE 64 callers use BPX4MPC (mvsprocclp) example.