z/OS Using REXX and z/OS UNIX System Services
SA23-2283-00
/* rexx */
call syscalls 'ON'
address syscall
path='/u/schoen/my.file'
'open (path)',
O_rdonly,
000
if retval=-1 then
do
say 'file not opened, error codes' errno errnojr
return
end
fd=retval
'read' fd 'bytes 80'
if retval=-1 then
say 'bytes not read, error codes' errno errnojr
else
say bytes
'close' fd