It's not surprising that the C library is able to override the DD (JFCB) at open time. https://www.ibm.com/docs/en/zos/2.1.0?topic=processing-filling-in-dcb
I don't think that IBM documents this very well for DD:xxxx that reference PATH specifications. Kirk Wolf Dovetailed Technologies, LLC http://coztoolkit.com Note: Our website and domain name have changed from dovetail.com to coztoolkit.com On Tue, Dec 13, 2022, at 2:31 AM, Ian Worthington wrote: > Your suspicions were quite correct. After some futzing around the opening > logic finally does: > > > if ((pcapfd = fopen("DD:PCAPFN", "ab+,lrecl=1")) == NULL) { > > which looks like it must takes precedence over the OTRUNC. > Many thanks for pointing me in the right direction. > > > Best wishes / Mejores deseos / Meilleurs vœux > > Ian ... > > On Friday, December 9, 2022 at 05:37:54 PM GMT+1, Paul Gilmartin > <0000042bfe9c879d-dmarc-requ...@listserv.ua.edu> wrote: > > On Fri, 9 Dec 2022 08:54:03 +0000, Ian Worthington wrote: > > >When I run JCL with > >//PCAPFN DD PATHOPTS=(OCREAT,ORDWR,OTRUNC), > >// PATHMODE=..., PATH=... // FILEDATA='BINARY' > > > >any existing file gets extended. Yet > > > What program did you name on the EXEC PGM= statement? > It's possible that the program overrides PATHOPTS. (It shouldn't > matter if step initiation performs an open() with the coded PATHOPTS.) > > How do other programs behave?: > o IEBGENER SYSUT2? > o IEFBR14? (Is the truncation performed at open() or at the first write()?) > > >https://www.ibm.com/docs/en/zos/2.4.0?topic=definition-status-group > > clearly states that: > > > > - OTRUNC > > - Specifies that the system is to truncate the file length tozero if > > all the following are true: > > - The file specified on the PATH parameter exists. > > - The file is a regular file. > > - The file successfully opened with ORDWR or OWRONLY. > > -- > gil > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN > > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN