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_rdwr+O_creat+O_trunc,
660
if retval=-1 then
do
say 'file not opened, error codes' errno errnojr
return
end
fd=retval
rec='hello world' || esc_n
'write' fd 'rec' length(rec)
if retval=-1 then
say 'record not written, error codes' errno errnojr
'close' fd