2 Top ideas to Copy a dataset in Mainframe

You must load a VSAM data set sequentially. Entry-sequenced and linear- space data sets are by using sequence whatever you want. Key-sequenced and relative- record data sets must be ordered on the record keys.

How to crack Technical Interview

Tips to crack an IT interview

1.Using Load..

You can load the data set with your own application program. I mean to say using COBOL program. This is one way of copying one dataset to other.

2. Using REPRO..

You can load with the REPRO command. The REPRO command copies data sets as follows:

  • Copies or loads non-VSAM sequential data sets to VSAM
  • Copies or loads VSAM data sets to VSAM data sets
  • Copies VSAM data sets to non-VSAM sequential data sets

Copy or load data sets as follows..

//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=A
//in-ddname DD DSN=...
[Describes the input data set.]
//out-ddname DD DSN=...
[Describes the output data set.]
//SYSIN DD *
REPRO -
INFILE(in-ddname) -
OUTFILE(out-ddname)
/*

How the INFILE..

Names the DD statement describing the data set to copy. For VSAM data sets, you can instead code INDATASET(data-set-name) without a DD statement.

How the OUTFILE..

Names the DD statement describing the output data set. For VSAM data sets, you can instead code OUTDATASET(data-set-name) without a DD statement.

Quick Tips..

Code the in-ddname and out-ddname DD statement parameters as necessary for the input and output data sets.

The following example copies the data set named A1000.TEST.DATA to A1000.RUN.DATA.

//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=A
//SYSIN DD *
REPRO INDATASET(A1000.TEST.DATA) OUTDATASET(A1000.RUN.DATA)
/*
REPRO also has extensive facilities for encrypting data that it copies .
Advertisements

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.