BPX1GTH (__getthent) example

The following code retrieves information on the first process accessible to the caller. For the callable service, see __getthent (BPX1GTH, BPX4GTH) — Get thread data. For the data structure, see BPXYPGTH — Map the __getthent input/output structure. AMODE 64 callers use BPX4GTH (__getthent) example.
                                              
         LA    R5,BUFFERB            R5 -> Input parameters             
         ST    R5,BUFB               ->input buffer                     
         USING PGTHA,R5              R5 base for PGTHA                  
         XC    PGTHA(PGTHA#LEN),PGTHA  Null Input area                  
         MVI   PGTHAFLAG1,PGTHAPROCESS+PGTHACOMMAND+PGTHATHREAD         
         MVI   PGTHAACCESSTHID,PGTH#LAST   Last thread                  
         LA    R15,BUFFERA           PgthB, Output buffer               
         ST    R15,BUFA              ->output buffer                    
         DROP  R5                                                       
         SPACE ,                                                        
         CALL  BPX1GTH,              __getthent                        +
               (=A(PGTHA#LEN),       Input: length input parms BPXYPGTH+
               BUFA,                 Input: ->input parms      BPXYPGTH+
               =A(1024),             Input: length output area BPXYPGTH+
               BUFB,                 Input: ->output area      BPXYPGTH+
               RETVAL,               Return value: 0, -1               +
               RETCODE,              Return code                       +
               RSNCODE),             Reason code                       +
               VL,MF=(E,PLIST)       ----------------------------------