Hello,
I have modified a program, which means that an output file (PF) can now be empty at the end of processing. Before this change there were always records in this file.
The CL that calls this program then executes CPYTOIMPF to copy this PF to a stream file.
I wanted to be sure that trying to copy an empty file would still work, in the sense that the stream file would be empty too. What I don?t understand is the IBM help for MBROPT which states
Applying this logic, if my stream file (the ?to-file?) is empty and I try to copy (with MBROPT *REPLACE) from a PF (which contains records) the operation should end abnormally?
But when I test this scenario it works absolutely fine. What am I missing? Does the MBROPT parameter only apply when copying using TOFILE and not TOSTMF? Or should the IBM help say ?from-file? instead of ?to-file? ?
The OS is V7R1
I have modified a program, which means that an output file (PF) can now be empty at the end of processing. Before this change there were always records in this file.
The CL that calls this program then executes CPYTOIMPF to copy this PF to a stream file.
Code:
CPYTOIMPF FROMFILE(MyPF) + TOSTMF(&FICDES) + MBROPT(*REPLACE) STMFCODPAG(*PCASCII) + RCDDLM(*CRLF) STRDLM(*NONE) + RMVBLANK(*TRAILING) FLDDLM(';') + DECPNT(*COMMA)
Note: If *ADD is specified and the to-file contains no records, the copy operation completes normally. If *REPLACE is specified and the to-file contains no records, the copy operation ends abnormally.
But when I test this scenario it works absolutely fine. What am I missing? Does the MBROPT parameter only apply when copying using TOFILE and not TOSTMF? Or should the IBM help say ?from-file? instead of ?to-file? ?
The OS is V7R1
Comment