Using XCOM to send non-mainframe files to AWS S3 cloud storage
search cancel

Using XCOM to send non-mainframe files to AWS S3 cloud storage

book

Article ID: 425424

calendar_today

Updated On:

Products

XCOM Data Transport - z/OS

Issue/Introduction

XCOM for Z/OS fix LU15786 introduces support to send and receive mainframe datasets, members or Z/OS Unix files between Z/OS and any cloud storage which is compatible with AWS S3 (Amazon Web Services Simple Storage Service).

Even though an AWS S3 object may be accessed directly from non-mainframe platforms, your site may prefer to use XCOM to store non-mainframe files to AWS S3.

This article provides considerations to achieve this goal.

Resolution

You need to perform the transfer in two steps. First step transfers the original file to MVS and the second transfers from MVS to AWS

You need to consider how the AWS S3 object needs to look like and how it has to be used. For example:

  • Does it need to be an exact copy of the original file?
  • Does it need to have a different character set?
  • How its record delimiters, if any, need to be?

Producing an exact copy

In this case, both transfers need to be in binary mode (CODE=BINARY) so that there is no character conversion and the record separators are transferred as part of the data.

The intermediate file in MVS may be a Z/OS Unix file or a dataset.

If a dataset is used, it must have RECFM=V or VB. If the dataset has RECFM=F or FB, the MVS I/O services will pad the last record with hex zeros up to the record length and the final AWS object will have extra bytes at the end

Changing to a different character set and dealing with delimiters

In this case, the best option is to change the character set in the transfer to MVS and use CODE=BINARY in the transfer from MVS to AWS. The reason is that, in the transfer to AWS, it is possible to request conversion but it is not possible to specify the exact character sets to be used.

The conversion in the transfer to MVS is requested by CODE=UTF8 plus LOCAL_CHARSET and REMOTE_CHARSET

It's important to note that, in this case, the transfer to MVS is a "text-type" one, meaning that XCOM interprets the record delimiters in the original file, does NOT transfer them and, if needed, creates delimiters in the MVS file.

For this reason, depending on whether the final AWS object needs delimiters, the options are:

  • If delimiters are not needed, use an intermediate MVS dataset (with RECFM=V or VB to prevent record padding)
  • If delimiters are needed, use an intermediate Z/OS Unix file and specify the delimiters using LOCAL_DELIM= and REMOTE_DELIM=