On Fri, 30 Jun 2017 17:39:49 +0000, Frank Swarbrick wrote:
>One MVS behavior that has annoyed me since we migrated to z/OS from VSE is the
>fact that MVS has no DISP option that will both create a data set if it does
>not already exist and simply allow its use if it does already exist. One has
>to "emulate" this behavior using a two step process, where step 1 specifies
>DISP=(MOD,DELETE) and step two specifies DISP=NEW.
>
Doesn't take two steps; it can be done within one step with some Byzantine DD
statements:
//HANDLE DD DISP=MOD,CATLG,UNIT=SYSALLDA,SPACE=(...),DSN=...
//SYSUT2 DD DISP-SHR,DSN=*.HANDLE,VOL=REF=*.HANDLE.
>Since this use case exists so often (in my environment, anyway!), shouldn't
>there be direct JCL support, probably a new DISP option, to perform this
>behavior without the need for an additional step to first delete the file (if
>it exists) so that the DISP=NEW in the later step will always succeed?
>
Good luck; I'm not betting on it. But I hear you.
>MVS *does* have such a feature for Unix system files. The following assume
>the default PATHDISP=(KEEP,DELETE).
>
>PATHOPTS=(ORDWR,OCREAT,OEXCL)
>This creates the Unix file if it does not already exist, and gives a JCL error
>if the file does already exist.
>This behavior is similar to DISP=(NEW,CATLG) for an MVS data set.
>
True. Very similar.
>PATHOPTS=(ORDWR,OCREAT)
>This creates the Unix file if it does not already exist, and allows the
>program to use the existing file when it already exists.
>There currently is no equivalent behavior for an MVS data set.
>
>PATHOPTS=(ORDWR,OCREAT,OTRUNC)
>This creates the Unix file if it does not already exist, and allows the
>program to use the existing file when it already exists. Additionally, when
>the program opens the file its file length is truncated to zero.
>There currently is no equivalent behavior for an MVS data set.
>
True. That's what you're asking for.
>PATHOPTS=(ORDWR,OCREAT,OAPPEND)
>This creates the Unix file if it does not already exist, and allows the
>program to use the existing file when it already exists. Additionally, the
>file offset is set to the end of the file after earch write, so that data is
>written at the end of the file.
>This behavior is similar to DISP=(MOD,CATLG) for an MVS data set.
>
>I would like to see two new PATH options that behave in a manner similar to
>the two options above that are not currently supported for MVS data sets. I
>suggest the following:
>
ITYM "DISP", not "PATH".
>DISP=CREAT: Similar in behavior to PATHOPTS=(ORDWR,OCREAT).
>DISP=TRUNC: Similar in behavior to PATHOPTS=(ORDWR,OCREAT,OTRUNC)
>
>If I make an RFE for this will you vote for it?
>
I suspect it's a waste of time. And JES3 setup would need to accommodate it.
-- gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN