in ISPF it works against large and small datasets
in batch against small dataset, it works.
when you run it in batch against a large dataset “the loop is going abnormally here and there and ends.”
Does “the loop” refer to your REXX code?
So the REXX code is NOT following the prescribed logic path? But only sometimes.
On the surface it would seem that this should not be happening. If it works, then it should work. If it fails, it should always fail.
Did the REXX run correctly before your changes?
If so, then I think we know what is wrong.
Ensure no error messages from either batch or interactive.
Make sure you have not suppressed error messages.
Make sure you are checking return codes. ALWAYS. for example:
“ISPEXEC LMOPEN DATAID(“dsid”) OPTION(OUTPUT)”
IF rc /= 0 THEN DO
zedsmsg = ‘LMOPEN FAILED WITH RC’ rc
Run the REXX with some of the traces turned on.
REXX is a programming language. And like any language, it can have logic errors in it. Normal debugging applies.
Is the batch job allocating to the proper libraries?
Sure you are running the same REXX program in both places?