I don't code DISP=MOD, if I want to append data to an existing dataset;
instead I use fopen with an "a" in the mode parameter.
My files have RECFM=FB, not FBS.
I'm not aware of any restrictions; IMO, the C runtime handles all this.
IIRC, I always use DISP=SHR (this, maybe, is not true for the situation
where a file does not exist, and I open it first with fopen ("DD:xxx",
"w") ...
but this is probably the only exception).
See: if I don't use the DD:xxx method the fopen the files,
that is, if I specify DS-names on the fopen, the C runtime even does the
allocation for me
(SVC 99, IIRC), so that I even don't need a JCL allocation for the file.
...
IMO, the C runtime completes partial blocks, when a file is opened
with fopen (..., "wa"). This should be true for MVS classic files, as well.
fopen (..., "wa")
BTW
should be functional the same as a sequence of
fopen (..., "r");
then positioning to the end of the file using fseek and ftell
then fwrite ...
I understand why this cannot work with PDS members,
but with OS files, there is no problem, because ftell and fseek will
work there, too.
Kind regards
Bernd
Am 19.06.2022 um 20:29 schrieb Paul Gilmartin:
On Sun, 19 Jun 2022 20:04:47 +0200, Bernd Oppolzer wrote:
... That is, if you do fopen ("dd:outfile","wa"),
a file allocated to OUTFILE which has some records already (in a block which
is not filled up completely) will be filled before the next empty block is
allocated.
At least, this is my understanding, and everything else would be a shock for me.
I'm astonished. Why then the restriction:
<https://www.ibm.com/docs/en/zos/2.5.0?topic=parameter-disposition-qsam-data-sets>
Do not code DISP=MOD if the data control block (DCB) specifies RECFM=FBS and
the data set is processed by QSAM. If you do and a block is shorter than the
specified block size, QSAM assumes that the short block is the last block and
starts end-of-file processing. By this action, QSAM can embed short blocks in
your data set and so affect the number of records per track.
(Sounds like non-anglophone usage.)
There should be no difference in behaviour (in principle), no matter if you
are writing to a classic MVS dataset or to a USS file.
In UNIX, the kernel completes the partial block. Classic access methods don't.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN