BPX4RDD (readdir) example

The following code reads multiple name entries from the specified directory (DIRECTDES). For the callable service, see readdir (BPX1RDD, BPX4RDD) — Read an entry from a directory. For the data structure, see BPXYDIRE — Map directory entries for readdir. AMODE 31 callers use BPX1RDD (readdir) example.
                                              
       MVC   DIRECTDES,..          Directory descriptor from  opendir   
         LA    R15,BUFFERA                                              
         STG   R15,BUFA                                                 
         MVC   BUFLENA,=F'1023'                                         
         CALL  BPX4RDD,              Read entries from a directory     +
               (DIRECTDES,           Input: Directory file descriptor  +
               BUFA,                 Output: ->buffer         BPXYDIRE +
               PRIMARYALET,          Input: buffer ALET                +
               BUFLENA,              Input: buffer size                +
               RETVAL,               Return value: 0, -1, entries read +
               RETCODE,              Return code                       +
               RSNCODE),             Reason code                       +
               MF=(E,PLIST)          ----------------------------------