BPX1LST (lstat) example

The following code obtains the file status for the file described by the symbolic name labrec/sym. For the callable service, see lstat (BPX1LST, BPX4LST) — Get status information about a file or symbolic link by path name. For the data structure, see BPXYSTAT — Map the response structure for stat. AMODE 64 callers use BPX4LST (lstat) example.
                                              
*   symbolic name established using symlink (BPX1SYM) system call       
         MVC   BUFFERA(10),=CL10'labrec/sym'                            
         MVC   BUFLENA,=F'10'                                           
         SPACE ,                                                        
         CALL  BPX1LST,              Get file status                   +
               (BUFLENA,             Input: Pathname length            +
               BUFFERA,              Input: Pathname                   +
               STATL,                Input: Length of buffer needed    +
               STAT,                 Buffer, mapped by BPXYSTAT        +
               RETVAL,               Return value: 0 or -1             +
               RETCODE,              Return code                       +
               RSNCODE),             Reason code                       +
               VL,MF=(E,PLIST)       ----------------------------------