> I am not aware of any language construct that allows for a DD name to be 
> randomly selected in a program

Do you mean in COBOL?

I am not sure what you mean by "randomly selected" but if you mean 
"dynamically-constructed" and you are not limiting it to COBOL, then it is 
certainly trivial and common in assembler to move a dynamically constructed 
name into DCBDDNAM before the OPEN.

COBOL 6 has an interesting thing in that for SELECT local-name ASSIGN 
external-name that external-name can be the name of an environment variable 
that contains DSN(dataset.name) disp SPACE(space) etc. I do not know if it is 
possible to set an environment variable directly from COBOL, but you could 
certainly call out to a routine that did so. That would pretty much qualify as 
dynamic allocation from a COBOL program (without calling out to BPXWDYN or 
similar).

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Lizette Koehler
Sent: Wednesday, December 30, 2020 12:56 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Using symbolic DD names

So the question becomes, can your Program handle a constantly changing DD Name?

What would be the benefit from doing this?

In Cobol you predefine (If I am allowed to use this word) the IO Section.  
Which specifies the DD name - consider that hard coded.

I am not aware of any language construct that allows for a DD name to be 
randomly selected in a program. On z/OS

I would be interested if anyone has an example.

And yes Scheduling products can supply symbolics where native z/OS might now.

Could you provide an example where your program when it executes would use a 
random DD name in JCL?

Lizette



-----Original Message-----
From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of 
Billy Ashton
Sent: Wednesday, December 30, 2020 12:22 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Using symbolic DD names

Hey folks! I have a vendor product program that looks for different DDnames 
depending on the control statements passed into the program. Is there any way 
to define a dynamic DD statement using JCL symbols? For example, I would love 
to have //TB&tno.DAT to correspond to TB01DAT, TB14DAT, or TB67DAT if I use SET 
TNO=01 or 14 or 67.

Is such a thing possible? I tried using an instream proc definition and INCLUDE 
MEMBER= that proc name, but that failed, and of course, I tried the straight up 
JCL as above, and it failed.

What do you all think?

Billy


----------------------------------------------------------------------
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

Reply via email to