as usual ...
MAC BOOK PRO m3.
APPLE Sequoia 15.7.3
... rexx -v
Open Object Rexx Version 5.2.0 r13087
Build date: Jan 28 2026
Addressing mode: 64
Copyright (c) 1995, 2004 IBM Corporation. All rights reserved.
Copyright (c) 2005-2026 Rexx Language Association. All rights reserved.
... just rewriting the title of the ticket
when using a record count EXECIO returns error instead of returning the last block ( even if partial /incomplete )
to fix it it enough it enough to comment/delete
else {
ulRc = ERR_EXECIO_EOF; // EOF before specified number of lines were read
break;
}
the statement where the ulRc is set to error
( tso/vm rexx return CORRECTLY the last block even if incomplete )
anyway it is the USER/application that has to decide if an incomplete block is valid or not
my best regards
E.
Anonymous
Hi Enrico, this works for me.
Please provide a short piece of failing code, and the exact error you are receiving.
sorry to disagree Erich... ( rexx disagrees IMO )
stem.0 is always set to 0 .... and it hides the implementation error for an incomplete read
I added one staatement to your snippeto display the return code
do until rec.0 = 0
address hostemu 'execio 5 diskr t.t (stem rec.'
say "RC = " RC
say "rec.0 = " rec.0
end
::requires hostemu library
and I got as expected
[enrico@enrico-mbp xxSnippets]$rexx erich
RC = 2
rec.0 = 0
[enrico@enrico-mbp xxSnippets]$
Enrico
PS... if I do not test the RC everithing is hidden
here is my full snippet....
Trace 'O'
numeric digits 16
xiodata = 'execio.data'
parse arg blksize
if blksize = '' then ,
blksize = 1
if DATATYPE(blksize) \= 'NUM' then do
say 'ERROR, not numeric blksize'
exit
end
-- outer loop
do blknmbr = 1
address hostemu 'execio 'blksize'diskr 'xiodata' (stem xiobuff.'
if ( RC \= 0 ) then do
say 'EXECIO ERROR, RC='RC
address hostemu 'execio 0 diskr 'xiodata' (finis'
leave
end
if xiobuff.0 = 0 then do
address hostemu 'execio 0 diskr 'xiodata' (finis'
leave
end
-- inner loop
say
do recnmbr = 1 to xiobuff.0
say align(blknmbr) align(recnmbr) xiobuff.recnmbr
end
end
say "****" blknmbr-1
exit
align: procedure
arg n
return right(n, 3)
::requires 'hostemu' LIBRARY
That's the documented behaviour for ooRexx, and also for z/OS:
"Return code 2: End-of-file was reached before the specified number of lines were read"
This is also consistent with standard Rexx I/O like below:
but even with the ERROR return code the stem is filled with the remaining
number of records
[enrico@enrico-mbp xxSnippets]$rexx execio 10
-- RC = 0 << first full block
1 1 ++++
1 2 ++++
1 3 ++++
1 4 ++++
1 5 ++++
1 6 ++++
1 7 ++++
1 8 ++++
1 9 ++++
1 10 ++++
-- RC = 2 << partial block
2 1 ++++
2 2 ++++
-- RC = 2 <==== the true end of file ... for unix systems ( the line feed with an empty line )
E
Yes - correct bahaviour.
The Stem is filled and rc is set to 0 if the requested number of records could be read (or the requested number was set to "asterisk"); if only less than what was requested could be read, rc is set to 2.
Hi Erich ...
I can live with that...
/nitpicking on
why in heaven did they use ERR_EXECIO_EOF
when it is a normal behavior ???
/nipicking off
cheers
enrico