The following code opens directory
/etc/passwd so
that it can be read by readdir. For the callable service, see
opendir (BPX1OPD, BPX4OPD) — Open a directory. AMODE 64 callers use
BPX4OPD (opendir) example.
MVC BUFLENA,=F'11'
MVC BUFFERA(11),=CL11'/etc/passwd'
SPACE ,
CALL BPX1OPD, Open a directory +
(BUFLENA, Input: Directory name length +
BUFFERA, Input: Directory name +
RETVAL, Return value:-1 or directory f.d. +
RETCODE, Return code +
RSNCODE), Reason code +
VL,MF=(E,PLIST) ----------------------------------
ICM R15,B'1111',RETVAL Test RETVAL
BL PSEUDO Branch if negative (-1 = failure)
ST R15,DIRECTDES Store the directory descriptor