I'm not trying to allocate the files. The JCL for the step has all the DDs. I just need to be able open, extend, and close the select/assign to different DDs where which ones I use and which order is not known until I'm working through an input file.
I can do it on other platforms, and obviously in assembler, just not in IBM COBOL for z/OS. The problem is the assignment name is compiled in to the program, not a variable, and using an environment variable doesn't allow for DD(ddname). -----Original Message----- From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of Steve Thompson Sent: Friday, April 28, 2023 3:08 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: COBOL to dynamic DD name You may want to use BPXWDY2. It dow not require the setting of R0. And it does almost everything that BPXWDYN does. Steve Thompson. PS. Speaking of RCFS, this is one I did an RCF about and I understand there are some updates being done to/with the DOC for examples. On 4/28/2023 3:52 PM, Paul Gilmartin wrote: > 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? >> >> I can't find a way, and in the manual the syntax for the environment >> variable method requires a DSN or PATH, no option for a DD name. >> > Do you know the DSN or PATH? > > Do you want to specify the DD name or let Dynalloc choose one? > > Do BPXWDYN keys RTDDN and INFO help you? BPXWDYN can be called with OS > standard linkage. > <https://www.ibm.com/docs/en/zos/2.5.0?topic=services-bpxwdyn-text-interface-dynamic-allocation-dynamic-output> > -- Regards, Steve Thompson VS Strategies LLC Westfield IN 972-983-9430 cell ---------------------------------------------------------------------- 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