Module 3: Access Method Services (AMS)
Loading a RRDS
- RRDS can be loaded in two ways:-
- In JCL, using REPRO command of IDCAMS
- Using COBOL program to read records from input file and write them to output dataset
- Here, we will focus on loading of RRDS using REPRO
- REPRO command is explained in ‘IDCAM REPRO command’ article
- While loading RRDS, records can be sorted on the field that correlates to the relative record number. During RRDS load, the records are loaded in relative record sequence starting with 1.
Use of REPRO to copy PS file to RRDS file
Use of REPRO to copy KSDS file to RRDS file
Note:- We will use REPLACE parameter here since we do not want Job failure in case if REPRO tries to copy records with duplicate key. REPLACE command will replace the existing record with new record in case of duplicate key
Use of REPRO to selectively copy records from one RRDS file to another RRDS file
Note: FROMNUMBER and TONUMBER parameter can be coded to selectively copy records. Using REPLACE keyword, one can overwrite duplicate records which will avoid job failure too.