BPX1PTJ (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 64 callers use BPX4PTJ (pthread_join) example.
                                              
         CALL  BPX1PTJ,              pthread_join                      +
               (THID,                Input: Thread ID                  +
               =A(0),                Input: ->Status Field or 0        +
               RETVAL,               Return value: 0 or -1             +
               RETCODE,              Return code                       +
               RSNCODE),             Reason code                       +
               VL,MF=(E,PLIST)       ----------------------------------