affiliate marketing Interview Qns: IDCAMS

Thursday, November 4, 2010

IDCAMS

It is a special utility program available only both on VS and MVS system. The use of IDCAMS is currently limited within VSAM files, even though it can perform many of its functions also with non-VSAM files. Apart from its capabilities to perform file transfer, it can also define/delete VSAM files, allocate VSAM clusters, does record selects following special conditions etc

For VSAM Files

1. Define a VSAM Master or user catalog

2. Define a VSAM data space

3. Define a VSAM cluster

4. Delete a VSAM cluster

5. Load a VSAM file from a non-VSAM file

6. Copy a VSAM File

7. Print a VSAM File

8. List the entries for a VSAM Catalog

9. Scratch(delete) a VSAM File

For Non-VSAM Files

1. Copy a non-VSAM file

2. Print a non-VSAM File

3. Selectively copy a non-VSAM File

· Start at a certain record, stop at a certain record

· Stop at a certain record from the beginning of the file

· Perform the previous two operations at the same time in proper succession

4. Catalog a non-VSAM File in a VSAM Catalog

5. Scratch a non-VSAM file created in a VSAM Catalog

6. Create Index for Generation Data Group


The following is the sample of a JCL statement to execute this utility program.


//TSGBIDC1 JOB ($$$$$$,11,999,A,I59604,$$$$$$$$$$,9999,9999,SYSOUT),

// 'TSGBAXC - WEST',MSGCLASS=X,REGION=64M,CLASS=A,

// NOTIFY=TSGBAXC

//PRTLOG OUTPUT CLASS=*

//*********************************************************************

//* THIS STEP COPIES THE INPUT FILE TO THE OUTPUT FILE.

//* REPRO MEANS REPRODUCE THE FILE, WHICH IS REALLY A COPY.

//*********************************************************************

//STEP0001 EXEC PGM=IDCAMS

//SYSPRINT DD SYSOUT=*

//INPUT DD DSN=TSGBKXR.KANNAN.SOURCE,DISP=SHR

//OUTPUT DD DSN=TSGBAXC.BRANDNEW.SOURCE,DISP=SHR

//SYSIN DD *

REPRO INFILE(INPUT) OUTFILE(OUTPUT)

//*********************************************************************

//* THIS STEP COPIES THE INPUT FILE TO THE OUTPUT FILE.

//* REPRO MEANS REPORDUCE THE FILE, WHICH IS REALLY A COPY

//* STARTAT(1000) MEANS START COPYING FROM RECORD NUMBER 1000,

//* STOPAT(9000) MEANS STOP AT RECORD NUMBER 9000

//*********************************************************************

//STEP0002 EXEC PGM=IDCAMS

//SYSPRINT DD SYSOUT=*

//INPUT DD DSN=TSGBKXR.KANNAN.SOURCE,DISP=SHR

//OUTPUT DD DSN=TSGBAXC.BRANDNEW.SOURCE,DISP=SHR

//SYSIN DD *

REPRO INFILE(INPUT) OUTFILE(OUTPUT) -

STARTAT(1000) STOPAT(9000)

//*********************************************************************

//* THIS STEP COPIES THE INPUT FILE TO THE OUTPUT FILE. REPRO

//* MEANS REPORDUCE THE FILE, WHICH IS REALLY A COPY

//* STOPAT(9000) MEANS IT WILL COPY FROM RECORD NUMBER 0001 AND

//* STOPAT(9000).

//*********************************************************************

//STEP0003 EXEC PGM=IDCAMS

//SYSPRINT DD SYSOUT=*

//INPUT DD DSN=TSGBKXR.KANNAN.SOURCE,DISP=SHR

//OUTPUT DD DSN=TSGBAXC.BRANDNEW.SOURCE,DISP=SHR

//SYSIN DD *

REPRO INFILE(INPUT) OUTFILE(OUTPUT) -

STOPAT(9000)

//*********************************************************************************

//* THIS STEP CREATES INDEX FOR THE GDG OR IN OTHER WORDS, IT CREATES

//* A GDG BASE WHICH WILL BE POPULATED WHEN THE ACTUAL DATA IS BEING

//* BUILT.

//*********************************************************************************

//STEP0004 EXEC PGM=IDCAMS

//SYSPRINT DD SYSOUT=*

//SYSIN DD *

GDG(TSGBAXC.CUMULATIVE.SALES.DATA) -

ENTRIES(12) -

NOSCRATCH –

NOEMPTY

//******************************************************************************

//* THIS STEP DELETES AN OLD CLUSTER

//******************************************************************************

//STEP0005 EXEC PGM=IDCAMS

//SYSPRINT DD SYSOUT=*

//SYSIN DD *

DELETE(TSGBAXC.CUMULATIVE.SALES.DATA) -

CLUSTER


DELETE(TSGBAXC.CUMULATIVE.SALES.DATA) -

SCRATCH

//******************************************************************************

//* THIS STEP DEFINES A NEW CLUSTER

//******************************************************************************

//STEP0006 EXEC PGM=IDCAMS

//SYSPRINT DD SYSOUT=*

//SYSIN DD *

DEFINE CLUSTER –

NAME(TSGBAXC.CUMULATIVE.SALES.DATA) –

FILE(VSAMC1) -

VOLUMES(TVA11234) –

RECORDS(100 30) –

RECORDSIZE(2000 2000) –

UNIQUE -

CISIZE(1024) -

INDEXED –

KEYS(5 12) –

DATA –

NAME(TSGBAXC.CUMULATIVE.SALES.DATA) –

INDEX –

NAME(TSGBAXC.CUMULATIVE.SALES.INDEX)

NAME - The name assigned to the cluster itself or data component, or index

Component

FILE - Specifies the ddname of a DD statement that defines the volume

that will contain the data space

VOLUMES - The Volume Serial Number that will contain the cluster

RECORDS - The space allocation for the cluster. RECORDS, TRACKS, or

CYLINDERS specifies the unit of allocation. The first operand

within the parenthesis specifies the primary allocation and the

second operand specifies the secondary allocation, just as we do in

regular new data representation

RECORDSIZE - The average and the maximum record size

UNIQUE - Specifies that a data space needs to be created for this cluster

CISIZE - The unit of direct-access storage that VSAM transfers between disk

storage and virtual storage when an I-O request is made, is called a

CONTROL INTERVAL. It should always be a multiple of 512K

INDEXED - The file organization is key-sequenced

KEYS - The length and offset of the record key

DATA NAME - Specifies the actual VSAM dataset name


INDEX NAME - Specifies the index name about where the data can be found just like the

beginning of a book, where it says, which chapter can be found in what page.

MODEL - Specifies the name of a particular cluster from where the missing parameters

need to be copied, such as MODEL(TSGBAXC.EASTERN.SALES.DATA)




No comments:

Post a Comment