>> The data I'm trying to write is mixed up in an input file, so I don't know >> which DDs I need to write to until I get there.
You Code for ALL the ddnames possible and open them and write to them based on the file indicator. >> I know that I could change the program to do an internal sort, but what I'm >> trying to do is an *interim* solution for testing using the *PC* version of >> the program, which *can* write to dynamic DD names. Not sure as to why you need to sort, but you don't have to. Assuming the data looks like this file-header-01 data rec-01 data rec02 data rec03 ... file-header-02 data rec-01 data rec02 data rec03 ... again file-header-01 file-header-01 data rec-01 data rec02 data rec03 ... If that is the case, you just read the header and write it that file if it is a data record and as soon as you hit the next header record you switch to writing to the new file. If the header record is not needed you turn on a switch to say s-hdr-record-written = 'y' and you check to write the next time you encounter the header that you have already written to Thanks, Kolusu ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN