BPX4STA (stat) example

The following code obtains status about file labrec/qual/current . For the callable service, see stat (BPX1STA, BPX4STA) — Get status information about a file by pathname. For the data structure, see BPXYSTAT — Map the response structure for stat. AMODE 31 callers use BPX1STA (stat) example.
                                              
         MVC   BUFFERA(19),=CL19'labrec/qual/current'                   
         MVC   BUFLENA,=F'19'                                           
         SPACE ,                                                        
         CALL  BPX4STA,              Get file status                   +
               (BUFLENA,             Input: Pathname length            +
               BUFFERA,              Input: Pathname                   +
               STATL,                Input: Length of buffer needed    +
               STAT,                 Buffer, BPXYSTAT                  +
               RETVAL,               Return value: 0 or -1             +
               RETCODE,              Return code                       +
               RSNCODE),             Reason code                       +
               MF=(E,PLIST)          ----------------------------------