Requirement is for COBOL.

-----Original Message-----
From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of 
Seymour J Metz
Sent: Friday, April 28, 2023 5:49 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: COBOL to dynamic DD name

How many different files does he have? An equivalent to the PL/I FILE keyword 
would be more flexible than hard-wiring the ddnames at compile time.

________________________________________
From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> on behalf of Sri 
h Kolusu <skol...@us.ibm.com>
Sent: Friday, April 28, 2023 4:59 PM
To: IBM-MAIN@LISTSERV.UA.EDU
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 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