Previously I have written a tip about submitting jobs from one SYSPLEX to another and also about how you can pack a dataset so it can be unpacked completely the same on another SYSPLEX. These two ideas can be combined into a single job able of transferring a dataset from one SYSPLEX to another. There are products out there on the market which can do the job smarter, however those products needs to be setup correctly in order to work. The good thing about this tip is it works as long as there is a JES connection between two SYSPLEX and the same TSO userid is created on both SYSPLEX and has the same password (I assume, I have not tried it with different passwords)
The following example can be used to transfer dataset MYUSER.DATASET from one SYSPLEX to another. User MYUSER must exist in both places. Again I have included a JOB card which you need to tailor to make it work on the JES-node represented by the name OTHERPLX in your installation. THISPLEX must be replaced with the name of the JES-node on the SYSPLEX where you submit the below job and where dataset MYUSER.DATASET exists.
//TRANSMIT EXEC PGM=IKJEFT01 //SYSTSPRT DD SYSOUT=* //SYSTSIN DD * DELETE 'MYUSER.DATASET.XMT' XMIT THISPLEX.MYUSER DA('MYUSER.DATASET') OUTDSN('MYUSER.DATASET.XMT') /* //SUBMIT EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSIN DD DUMMY //SYSUT2 DD SYSOUT=(,INTRDR) //SYSUT1 DD DATA,DLM='##',LRECL=80 //MYUSERX JOB ,,CLASS=A,MSGCLASS=X,COND=(4,LT) /*ROUTE XEQ OTHERPLX //RECEIVE EXEC PGM=IKJEFT01 //SYSTSPRT DD SYSOUT=* //SYSTSIN DD * DELETE 'MYUSER.DATASET' RECEIVE INFILE(MYDATA) DA('MYUSER.DATASET') //MYDATA DD DATA,DLM='?#' ## // DD DISP=SHR,DSN=MYUSER.DATASET.XMT
So what is going on? First step packs MYUSER.DATASET into XMIT-format in MYUSER.DATASET.XMT (and by the way deletes this dataset first). Second step submits a job to OTHERPLX. This job is inline in DD name SYSUT1 and starts in the line holding the JOB card and ends in the line ##. Hold on, there is still a DD card in the last line, what is that? Here your original dataset (MYUSER.DATASET) becomes an inline dataset in XMIT-format on the DD card MYDATA in the job to be executed on OTHERPLX. The XMIT-format has the fantastic feature of always being in FB 80 format which makes it ideal as inline input in JCL.
The job to be executed on OTHERPLX starts by deleting MYUSER.DATASET and then it does a RECEIVE of the inline data found on DD name MYDATA. These inline data are unpacked and MYUSER.DATASET is recreated using exactly the same DCB information and data as the original dataset on THISPLEX. Now you will probably argue that it is much easier to do a TSO XMIT of MYUSER.DATASET to OTHERPLX and then do a TSO RECEIVE on OTHERPLX. And you are right about this, but it requires you to logon to OTHERPLX besides logging on to THISPLEX. And XMIT/RECEIVE has the disadvantage of requiring the commands to fit in pairs. If you forget to receive something you have transmitted you may end up in serious trouble. You avoid those kind of problems using the above technique.
Unfortunately all transfer problems are not solved using the above method. You cannot transfer a limitless amount of data. The MVS systems programmer can limit the number of lines transmitted using ROUTE XEQ. And you might have noticed, the DLM='?#' on DD name MYDATA. If this combination of characters occurs as the first two characters in a line in XMIT-format then MYUSER.DATASET on OTHERPLX will only contain data until these two characters occured. You may think of other combinations of two characters being even more unlikely to occur. In my experience it is not a good idea to transfer SMF data or LOAD modules using the above trick because there is a huge probability not to get all data transmitted. However the trick works fine for common text based datasets.
Using this tip I have implemented CUT and PASTE across all the different SYSPLEX at my installation. It is one of my wildest ideas ever. It is close to pure magic!! You are very welcome to contact me if you want to do something similar.