Joined: 15 Feb 2005 Posts: 4684 Location: San Jose, CA
Are you asking if you can use the same data set for SORTIN and SORTOUT? Is the data set VSAM or non-VSAM? Are you trying to do a sort, a merge or a copy?
If that's not what you're asking, please explain more clearly what it is you want to do.
Doing a merge. One of input is dsn.g0030v00, output is dsn.g0030v00. I can create a temporary file with the merge, delete the file and then copy the temporary file to the old file name. Is there a way of doing the three steps in one step.
Joined: 15 Feb 2005 Posts: 4684 Location: San Jose, CA
If you change the MERGE to a SORT then you can use the same data set for SORTIN and SORTOUT. But ... (1) if anything goes wrong (e.g. I/O) error, you may lose your data set so be sure you have a backup or can recreate it. (2) MERGE is more efficient then sort. So a SORT may actually be less efficient then the MERGE and COPY. Note also that SORT requires workspace whereas MERGE and COPY don't.