View previous topic :: View next topic
|
Author |
Message |
hyuzen
New User
Joined: 10 Jul 2005 Posts: 58
|
|
|
|
Hi all,
How can I delete particular records in a ksds file whose RECFB=FB and LRECL=80 ? All keys of those records are 999 and begin at 20th positions.
Can I do that using DFSORT utility and same ksds file.
Thanks in advance,
hyuzen |
|
Back to top |
|
|
vijayamadhuri
Active User
Joined: 06 Apr 2005 Posts: 180
|
|
|
|
I think DFSORT works only for flat files.One thing u could do is copy it into a flat file and use the omit option.The other way is to use FILEAID. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
I think DFSORT works only for flat files |
Not true. DFSORT works for VSAM files too.
Quote: |
How can I delete particular records in a ksds file whose RECFB=FB and LRECL=80 ? All keys of those records are 999 and begin at 20th positions.
Can I do that using DFSORT utility and same ksds file. |
If the KSDS is defined with REUSE, you can use DFSORT's VSAMIO and RESET options along with the OMIT and SORT statements to delete specific records from the KSDS. The VSAMIO option allows a VSAM file defined with REUSE to be sorted in-place (that is, the same VSAM file can be used for input and output).
Note that this kind of "suicide sort" is not recommended unless you can afford to lose the VSAM file if something goes wrong. It's safer to go from the VSAM file to a temporary file and then from the temporary file back to the VSAM file. |
|
Back to top |
|
|
hyuzen
New User
Joined: 10 Jul 2005 Posts: 58
|
|
|
|
Dear Frank,
Thank you very much again & again as. You are always very helpful. I would like to try that kind of 'suicide sort' . In the light of your suggest, I will make a copy of Vsam file at earlier steps in the jcl...
Thank you again.
Hyuzen |
|
Back to top |
|
|
|