BPX1STA (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 64 callers use BPX4STA (stat) example.
                                              
         MVC   BUFFERA(19),=CL19'labrec/qual/current'                   
         MVC   BUFLENA,=F'19'                                           
         SPACE ,                                                        
         CALL  BPX1STA,              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                       +
               VL,MF=(E,PLIST)       ----------------------------------