View previous topic :: View next topic
|
Author |
Message |
bhaskar_kanteti
Active User
Joined: 01 Feb 2007 Posts: 123 Location: Hyderabad
|
|
|
|
Hi,
My requirement is after copying the records to output file i need to delete all the records that were there in input file. Means after copying, out file should be empty.
How can i do this.
In the below code i am copying the records to output file. But how to delete the records in input file.
Code: |
//STEP010 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=C
//SYSPRINT DD SYSOUT=*
//*INPUT FILE
//INPUT DD DSN=MY.INPUT.FILE,DISP=SHR
//*OUTPUT FILE
//OUTPUT DD DSN=MY.OUTPUT.FILE,
// DISP=(,CATLG,DELETE),SPACE=(CYL,(500,500),RLSE),
// RECFM=FB,LRECL=72,
// BLKSIZE=0
//TOOLIN DD *
COPY FROM(INPUT) TO(OUTPUT) USING(CTL1)
/*
//CTL1CNTL DD *
SORT FIELDS=(1,4,CH,A)
OUTFIL FNAMES=OUTPUT,REMOVECC,
OUTREC=(1:1,72)
/*
|
|
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Bhaskar,
Quote: |
My requirement is after copying the records to output file i need to delete all the records that were there in input file. |
Quote: |
Means after copying, out file should be empty |
Its c nfusing. Could you tell your req? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Might be too simple to be true...
( or the question is badly posed )
why not delete the dataset itself ???
or run a second step to write an end of file... |
|
Back to top |
|
|
bhaskar_kanteti
Active User
Joined: 01 Feb 2007 Posts: 123 Location: Hyderabad
|
|
|
|
Sorry for confusing you all.
The requirement is after copying the records to output file, no records should be present in the input file.
Its something like records should be moved to output file.
Actually the input of this job is the output for the previous job. After taking the backup no recods whould be there in the input file. So that in next days run new records will be added to this input file.
Am i clear now. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
As Enrico suggested, delete the i/p file. Next day re-create it again. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Deleting and recreating the file is probably the safest thing to do.
But since you're doing a sort, you could delete all of the records in the input file with a second OUTFIL statement using a DFSORT/ICETOOL job like this:
Code: |
//STEP010 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYSUDUMP DD SYSOUT=C
//*INPUT FILE
//INPUT DD DSN=MY.INPUT.FILE,DISP=SHR
//*OUTPUT FILE
//OUTPUT DD DSN=MY.OUTPUT.FILE,
// DISP=(,CATLG,DELETE),SPACE=(CYL,(500,500),RLSE)
//TOOLIN DD *
COPY FROM(INPUT) USING(CTL1)
/*
//CTL1CNTL DD *
SORT FIELDS=(1,4,CH,A)
OUTFIL FNAMES=OUTPUT,REMOVECC,
OUTREC=(1:1,72)
OUTFIL FNAMES=INPUT,OMIT=ALL
/*
|
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
How is the "new" data put into the "input" file? Is this a qsam file or a vsam file?
Depending on how the data is put into the "input" file, your implementation may vary. |
|
Back to top |
|
|
bhaskar_kanteti
Active User
Joined: 01 Feb 2007 Posts: 123 Location: Hyderabad
|
|
|
|
Hi Frank,
You have provided me the exact solution.
This is my correct requirement.
Thanks for providing me the solution.
Thank You So Much. |
|
Back to top |
|
|
clickit
New User
Joined: 08 Jul 2005 Posts: 3 Location: Hellas
|
|
|
|
bhaskar_kanteti wrote: |
Hi Frank,
You have provided me the exact solution.
This is my correct requirement.
Thanks for providing me the solution.
Thank You So Much. |
many thanks from me too |
|
Back to top |
|
|
|