Transferring between data sets on z/OS
We can transfer between z/OSĀ® data sets using Managed File Transfer. Review the following behavior carefully to ensure your data sets are transferred correctly.
Managed File Transfer does not support uncataloged data sets either on disk or tape. Existing data sets must be cataloged and new data sets will be cataloged.
Consider the following cases:
- If you copy or move a data set between z/OS systems and the destination does not exist.
By default, the destination data set is created with the identical characteristics to the source. We can specify attributes for the destination data set to override the default characteristics. If we do this, a compatibility check is performed to ensure the transfer is possible.
- If you copy or move a data set between z/OS systems and the destination already exists.
If you specify attributes for the destination data set to override the default characteristics, a compatibility check is performed to ensure the destination data set can be accessed in the required way. However, we cannot override the following attributes:
- Base data set organization and type
- Logical record length (LRECL)
- Block size (BLKSIZE)
- If you are transferring a data set to tape.
When you transfer a data set to tape, any existing data set that is already on the tape is replaced. The attributes for the new data set are set from attributes passed in the transfer definition. If no attributes are specified, attributes are set to the same as those for the source data set or are set to the default values when the source is a file. The attributes of an existing tape data set are ignored.
In addition, the user identifier that the destination agent is running as needs to have the correct authority to mount tapes. Refer to the documentation for the external security manager being used by your enterprise for information on how to do this.
- If you are transferring from tape to a data set.
- In order to access a dataset on tape, the user identifier that the source agent is running as needs to have the appropriate authority to mount tapes. Refer to the documentation for the external security manager being used by your enterprise for information on how to do this.
Data set compatibility
Review the following behavior and restrictions for data set compatibility:
- Record format and length differences:
- Variable-format records use a 4 byte record length field in the record data. Therefore for a transfer from a fixed record to a variable record data set, the variable record length must be greater than or equal to the fixed record length plus 4. For a transfer from a variable format record data set to a fixed format record data set, the fixed format record data set record length must be greater than or equal to the variable record length minus 4.
- Block size differences:
- For fixed- and variable-format record data, block size differences makes the source and destination data set layout different.
- For undefined format records, provided the destination block size is greater or equal to the source data set block size, we can transfer a data set.
- For undefined format data sets, we cannot transfer if the source block size is greater than the destination block size.
- Partitioned data sets (PDS) and partitioned data set extended (PDSE) data sets
The following behavior and restrictions apply equally to PDS and PDSE:
- If you transfer a PDS or PDSE member to a destination PDS or PDSE, a member of the destination PDS or PDSE is created. If the destination PDS or PDSE member already exists, the member is overwritten. If you transfer a PDS or PDSE member to a non-PDS or non-PDSE destination data set, the destination data set is created to contain the member data. If the destination data set already exists, the data set is overwritten.
- If you attempt to transfer a PDS or PDSE to a non-PDS or non-PDSE destination, this results in all members of the PDS or PDSE being written to the non-PDSE destination. Each subsequent member transfer overwrites the previous contents of the non-PDSE destination or fails, depending on the transfer options.
- When you transfer a PDS or PDSE to a destination PDS or PDSE, a copy of the entire PDS or PDSE is created at the destination. If the destination PDS or PDSE already exists, members from the source are added. If a PDS or PDSE member already exists at the destination, the member is overwritten.
- The transfer of a non-PDS or non-PDSE to a destination PDS or PDSE, adds the contents of the non-PDS or non-PDSE as a new member of the PDS or PDSE. If the PDS member already exists, the member is overwritten. If we do not specify a name for a new member, a name is generated from the source data set or DD name.
- There is a known limitation with transfers to PDS and PDSE data sets on systems where disk space is limited. For more details, see the topic Troubleshooting Managed File Transfer.
- Note: When you transfer a PDS or PDSE to a destination PDS or PDSE, the member information and statistics are not preserved. For example, if you transfer a load library that is stored as a PDS, the destination PDS is not usable as a load library.
Binary and text transfers
Binary transfer for data sets is defined as the record data in its binary form, as read from the data set using the default record format (type=record). Data is read and written on a record by record basis. The system service performs the necessary record and block conversion (where the data sets have different record and block settings) and the necessary ASA and machine control code conversion. If one data set is defined for ASA format control characters and the other is not appropriate, conversion to normal control codes is performed using the C/C++ system library function behavior.
Generation data groups (GDGs)
Managed File Transfer supports generation data groups (GDGs) for source and destination data sets on z/OS. Absolute and relative GDG names are supported. When you write to a new generation, the base GDG must already exist.