BPX4PTJ (pthread_join) example

The following code gets the termination status of a specified thread (THID). For the callable service, see pthread_join (BPX1PTJ, BPX4PTJ) — Wait on a thread. AMODE 31 callers use BPX1PTJ (pthread_join) example.
                                              
         CALL  BPX4PTJ,              pthread_join                      +
               (THID,                Input: Thread ID                  +
               =AD(0),               Input: ->Status Field or 0        +
               RETVAL,               Return value: 0 or -1             +
               RETCODE,              Return code                       +
               RSNCODE),             Reason code                       +
               MF=(E,PLIST)          ----------------------------------