I'm trying to avoid that because the end-state program won't be doing that, if I'm not in z/OS COBOL I can just have one file and dynamically switch the DD name.
At least I think I can; I haven't tested that exact syntax yet. -----Original Message----- From: IBM Mainframe Discussion List <[email protected]> On Behalf Of Sri h Kolusu Sent: Friday, April 28, 2023 4:00 PM To: [email protected] Subject: Re: COBOL to dynamic DD name >> The OP isn't trying to retrieve the information; he's trying to open a file >> using a dynamic ddname. Put another way, he wants to open the same DCB >> multiple times, with a different DCBDDNAM each time. SeyMour >From the limited information that OP provided, IMHO he was planning on having >multiple open and close of files. However, he doesn't really need to do that. >He can open all the files and then have the logic to write to specific file Sample pseudo code OPEN INPUT file-input OUTPUT fileout1 fileout2 fileout3 fileout4 ...... fileoutn MAIN-LOGIC EVALUATE TRUE WHEN WS-FILE-IND = 'f01' PERFORM WRITE-TO-FILE01 PERFORM READ-INPUT-FILE WHEN WS-FILE-IND = 'f02' PERFORM WRITE-TO-FILE02 PERFORM READ-INPUT-FILE WHEN WS-FILE-IND = 'f03' PERFORM WRITE-TO-FILE03 PERFORM READ-INPUT-FILE n... files END-EVALUATE CLOSE file-input fileout1 .. Thanks, Kolusu DFSORT Development IBM Corporation ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
