Examples of loading an IAM data set
Below are a couple of examples using IDCAMS to load an IAM data set. As stated above, IAM data sets can be loaded by any program that can load a VSAM cluster. For conversions from VSAM clusters to IAM data sets, there rarely will be any need to change the JCL, except to add an IAMINFO DD for SYSOUT to get the detailed report of the file load.
Example A: Loading an IAM file
In the example below, an IAM data set is loaded with IDCAMS. An IAMINFO DD statement has been added to obtain the run time file load report from IAM. The OUTFILE parameter is used to specify the output IAM file.
Example of loading an IAM data set (EX1030A)
//SYSPRINT DD SYSOUT=*
//IAMINFO DD SYSOUT=*
//INFILE DD DSN=my.seqfile,DISP=SHR
//IAMFILE DD DSN=my.iamfile,DISP=OLD
//SYSIN DD *
REPRO INFILE(INFILE) OUTFILE(IAMFILE) REUSE
/*
Example B: Loading compressed data into an IAM data set
In this example, the OUTDATASET (ODS) is used instead of OUTFILE on the IDCAMS REPRO. This will cause IDCAMS to dynamically allocate the IAM data set. Because the ddname is not known in advance, the CREATE override specifies the data set name (DSN=). In this example, the sequential input data set was previously created by copying an IAM software compressed data set with the BACKUPCOMPRESSED override, so it must be reloaded with that same override specified on the CREATE override. A large BUFNO value is specified on the DCB for the input file to provide for faster processing.
Example of loading an IAM data set with compressed data (EX1030B)
//SYSPRINT DD SYSOUT=*
//IAMINFO DD SYSOUT=*
//SEQFILE DD DSN=my.compresd.seqfile,DISP=SHR,
DCB=BUFNO=60
//IAMOVRID DD *
CREATE DSN=my.iamfile,BACKUPCOMPRESSED
/*
//SYSIN DD *
REPRO INFILE(SEQFILE) ODS(my.iamfile) REUSE
/*