Home > Development Tools, Mainframe > XMITing multiple files

XMITing multiple files

One of the things I sometimes need to do is transfer multiple sequential or PDS data sets between machines, or create a ‘package’ of data sets that can easily be downloaded from the web and restored on a host z/OS machine.

Typically on z/OS you might use the XMIT command to export a data set such as a PDS into a sequential form that can then be transferred between systems as a binary file. However to transfer multiple files you need to unload and transfer each one in turn and then restore it on the target host system. Even if you package all the files into a single zip file (on a Windows machine for example) you must still transfer each  file to the host individually and receive it there.

In order to reduce the number of files I have to transfer from and to the host system I came up with the following packaging technique that basically ‘nests’ xmited files inside a PDS that itself is then xmited to make it into a sequential file.

1. XMIT each file to be transferred into a sequential XMIT dataset using a command like this:

XMIT IBM.SOMEID DATASET(‘sourcedsn’) OUTDSN(‘targetdsn’)

2. Create a PDS.

2. Copy each XMITed dataset from step 1 as a member to a new PDS, give each member a unique name.

3. XMIT the PDS to a sequential data set.

You can then transfer the final xmit file to a windows or other non z/OS machine, zip it up and move it around quite happily. The zip file of course only contains ONE file, the final xmited dataset from the host.

To restore it, pre allocate a sequential file on the host (FB, LRECL 80, BLKSIZE 3120) and transfer the file as binary to it from the off platform system using FTP or something similar.

Then receive the file using:

RECEIVE INDATASET(‘your dataset name’)

That restores the PDS containing the original xmited files.

Then receive each member in turn from that PDS to restore the dataset:

RECEIVE INDATASET(‘restoredPDS(member)’)

Some JCL and a little REXX makes it pretty easy to automate this whole process. I’ll post the JCL and REXX code that I use in a future article.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: