Then how about the calling program passing the communications file name [DSN or whatever] and then have the COBOL program allocate, and open that for output, then CLOSE and "free" it.

The caller, upon return of the COBOL program should now have access to the string. I recall doing things like this with W/NT 40 and Fujitsu COBOL. I had three different COBOL compilers back then, and the one that seemed to be the best implemented was FJ COBOL.

Steve Thompson




On 8/15/2023 4:21 PM, Schmitt, Michael wrote:
I can do dynamic DD names in z/OS COBOL using a trick*, but that trick doesn't 
work in MF COBOL. There's no documented way to do a dynamic DD name**. Dynamic 
*file names* yes, but not DD names.

But dynamic file names are native files (e.g. C:\Data\Catalog\File.DAT) not 
catalogged MVS data set names. And a REXX exec can determine allocated MVS data 
set names, but not the associated native file name!


(I think the real question is why doesn't the COBOL language allow for logical 
files names (what you ASSIGN to) that aren't known at compile time?)


* passing the FD name to a nested program that zaps the DD name in the DCB

** A MF COBOL program can get access to its version of a DCB but that structure 
doesn't include the DD name




----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to