Page 1 of 1

VSAM to VSAM copy.

Posted: Sat Jan 02, 2021 10:27 pm
by Prakash Jha
Hi,

I was trying to copy VSAM to another VSAM like in SORTIN and SORTOUT just 'same VSAMs' but different names. However the output came as flat file rather than as VSAM. Can this not be done?

Re: VSAM to VSAM copy.

Posted: Mon Jan 04, 2021 2:43 am
by Robert Sample
Yes, it is possible to use DFSORT to copy a VSAM data set to a VSAM data set, but you need to be aware of the requirements. Check the DFSORT manual for details. A quick search of the Internet indicates that using VSAM-to-VSAM copy has a requirement of using RECORD TYPE=V in your DFSORT control statements; the default is RECORD TYPE=F and that defaults to a sequential output data set. You also need to ensure that the output VSAM data set exists before running your DFSORT since IDCAMS is used to define VSAM data sets, not JCL statements.