On Fri, 28 Apr 2023 19:37:39 +0000, Schmitt, Michael wrote:

>I know how to have a COBOL program on z/OS use a data set name that isn't 
>determined until runtime, via an environment variable. My question is can you 
>use one file (i.e. one select/assign and one FD) to write to different DD 
>names, that were already allocated in the JCL?
>
When I wear my ill-fitting MVS hat, I find it bizarre that any HLL is
DDNAME-ignorant.  It's what most of them require.  Think EXECIO.
But COBOL ...

A DDNAME is a component of I/O abstraction, a handle for a data set,
analogous to the way in UNIX that a descriptor is a handle for a
pathname.  And some UNIX utilities accept only pathnames, not
descriptors.  But UNIX-like systems that I nave used, Solaris, Linux,
MacOS, OMVS, provide a pseudo-mountpoint, "/dev/fd/" to treat a
descriptor as a pathname.  This is not required by POSIX.
For example:
    exec 42</etc/services
    wc /dev/fd/42
... just works.

A modest proposal: Wouldn't it be nice if z/OS provided a pseudo-HLQ 
such as "DDHLQ.<ddname>" to meet the requirements of languages
such as COBOL which demand a DSN, not a DDNAME, so given
SYSUT42 a program could form "DSN=DDHLQ.SYSUT42", look it up
in the catalog, OPEN, and read it.

RFE, anyone?

-- 
gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to