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 [email protected] with the message: INFO IBM-MAIN

Reply via email to