kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
|
Posted: Fri Oct 15, 2004 2:20 pm Post subject: |
|
|
Ravi,
The following JCl will give you the desired results. We first copy contents of the vsam file to a BACKUP dataset and the records to be deleted to the DELETE dataset. Now we concatenate this 2 datasets and eliminate dups. So we use the SELECT operator with NODUPS option to eliminate all the records to be deleted. Note that the out vsam dataset is same as the input dataset. You can use the same input vsam file as output vsam file when it is defined with REUSE option.
Code: |
//******************************************************************
//* THIS STEP WILL DELETE RECORDS IN AN EXISTING VSAM CLUSTER *
//******************************************************************
//STEP0100 EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//VSAMIN DD DSN=YOUR INPUT VSAM FILE,
// DISP=SHR
//DELETE DD DSN=YOUR DELETE FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y),RLSE)
//BACKUP DD DSN=YOUR BACKUP FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y),RLSE)
//CON DD DSN=YOUR DELETE FILE,
// DISP=SHR,VOL=REF=*.DELETE
// DD DSN=YOUR BACKUP FILE,
// DISP=SHR,VOL=REF=*.BACKUP
//OUT DD DSN=YOUR INPUT VSAM FILE,
// DISP=OLD
//TOOLIN DD *
COPY FROM(VSAMIN) USING(CTL1)
SELECT FROM(CON) TO(OUT) ON(1,9,CH) NODUPS
//DFSPARM DD *
OPTION VSAMIO,RESET
//CTL1CNTL DD *
OUTFIL FNAMES=DELETE,INCLUDE=(1,7,CH,LE,C'2004150')
OUTFIL FNAMES=BACKUP
/*
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|