View previous topic :: View next topic
|
Author |
Message |
bhaskar_kanteti
Active User
Joined: 01 Feb 2007 Posts: 123 Location: Hyderabad
|
|
|
|
Hi,
I want to copy all the records from input VSAM file to ouput PS file. After copying i want to delete all the records in input VSAM file.
I tried the below job. But afer copying the records to output PS file, records are still present in input VSAM file.
Code: |
//STEP010 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//INPUT DD DSN=INPUT.VSAM.FILE,DISP=SHR
//OUTPUT DD DSN=MY.PS.OUTPUT.FILE,
// DISP=(,CATLG,DELETE),SPACE=(CYL,(500,500),RLSE)
// RECFM=FB,LRECL=200
//TOOLIN DD *
COPY FROM(INPUT) USING(CTL1)
/*
//CTL1CNTL DD *
OUTFIL FNAMES=OUTPUT,REMOVECC,
OUTREC=(1:1,200)
OUTFIL FNAMES=INPUT,OMIT=ALL
/*
|
Please provide me the solution. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
You either need to delete the records programatically or to delete / define the cluster |
|
Back to top |
|
|
bhaskar_kanteti
Active User
Joined: 01 Feb 2007 Posts: 123 Location: Hyderabad
|
|
|
|
Is there any other way to achieve my requirement other than going to program. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
IDCAMS? |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
bhaskar_kanteti,
Your VSAM cluster must be defined with REUSE inorder to use it as input as well as output. here is a job which will give you the desired results assuming that your vsam cluster is defined with REUSE
Code: |
//**********************************************************
//* THIS STEP MAKES A BACKUP COPY OF THE VSAM FILE *
//**********************************************************
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=INPUT.VSAM.FILE,
// DISP=SHR
//SORTOUT DD DSN=MY.PS.OUTPUT.FILE,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(500,500),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
//*
//**********************************************************
//* THIS STEP EMPTIES THE INPUT VSAM FILE *
//**********************************************************
//STEP0200 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//DFSPARM DD *
OPTION VSAMIO,RESET
//SORTIN DD DSN=INPUT.VSAM.FILE,
// DISP=SHR
//SORTOUT DD DSN=INPUT.VSAM.FILE,
// DISP=SHR
//SYSIN DD *
SORT FIELDS=(1,1,CH,A)
OMIT COND=ALL
/* |
|
|
Back to top |
|
|
|