One of the subjects I frequently revisit is dataset copying. I really miss a simple command like the DOS-prompt COPY or XCOPY. There has to be a similar command which is easy to use and understand on the mainframe. And there is such a command, well almost.
The IDCAMS command REPRO copies both VSAM datasets, sequential datasets and members in PO datasets. The nice thing about REPRO (and all other IDCAMS commands) is that it works as a TSO command. You are therefore able to execute a TSO REPRO IDS(MY.SOURCE) ODS(MY.TARGET) in order to copy dataset <userid>.MY.SOURCE to dataset <userid>.MY.TARGET if both datasets already exists. You are also able to copy members and the target member does not have to exist. Like all other TSO commands REPRO follows the rules of dataset prefixing.
Unfortunately there are other limitations when using REPRO for copying. You cannot copy PO datasets as a whole and you cannot copy LOAD modules to a PO-E (PDS-E) dataset. Apart from these limitations REPRO is the closest thing to a COPY command I have been yet on the mainframe which is just as easy to use and understand as the DOS-prompt COPY/XCOPY. On some installations a TSO COPY command is available, but this is because those installations have installed a special product. I do not know how this product works and which limitations it has.
By the way REPRO requires an OLD allocation of the target dataset. You can circumvent this requirement by pre-allocating the target dataset with a TSO ALLOC or specify a DD name in the job step performing the copy where you allocate the target dataset with a DISP=SHR. Then you must use OUTFILE(<DD name>) instead of ODS(...).
Please remember my tip week 21/2007 about executing TSO commands from COBOL or PL/I if you need to perform dataset copying using an application program. The program ADRDSSU which I normally recommend for dataset copying is unfortunately an authorized program and therefore you are not able to execute it from a normal application program. REPRO may be a good replacement except that you need to create the target dataset yourself.