For those of you running XCOM on a mainframe, one file access method that is often used for files is VSAM. So the obvious question is "Does XCOM support VSAM files or do I have to export the file into a sequential flat file first?" Well the answer is that XCOM supports the key-sequenced dataset (KSDS), entry-sequenced dataset (ESDS), and relative record dataset (RRDS) file types which (if I remember correctly) are all of the basic types of VSAM file that you can have.
The first thing that we need to know when transmitting a VSAM file is to make sure that the file is pre-allocated on the destination system first as XCOM does not have the ability to actually create VSAM files. Also, when transmitting a file with keys across systems, the key length and relative key position must be the same on both the sending and receiving computers.
So we have a choice of replace or add for the File Option when transmitting a VSAM file, create is only used instead of replace if the destination file is to be replaced and has been defined with the reuse option. Using replace will empty out the destination VSAM file before writing the new data while using add will leave the existing data intact. VSAM files in fact are one reason why mainframe XCOM uses add rather than append. In the case of KSDS VSAM files the added records will not necessarily be appended to the end of the destination file but may (depending on the key) be inserted between existing records or even replace individual records within the file. ESDS VSAM files should use the add option to append the records to the end of the existing file. Relative record numbering of RRDS VSAM files is not preserved when transmitted with XCOM, instead the records are written out sequentially starting with a relative record number of one.
Note: Because of limitations with VSAM files, checkpoint/restart is not supported for ESDS files. For KSDS and RRDS files, checkpoint/restart is only supported for file transfers using replace as the specified File Option.
This article written by Stephen Chapman, Felgall Pty Ltd.