View previous topic :: View next topic
|
Author |
Message |
itjagadesh
New User
Joined: 05 Dec 2006 Posts: 89 Location: chennai
|
|
|
|
Team,
I have requirement to delete 2 records from VSAM (KSDS) file. I know the key(first 10 bytes) of the records needs to be deleted from file and position of the File.
LRECL of VSAM file - 80
Key - > 1 to 10
i don't want to do this thru IDCAMS delete,define,copy from another file.
I want to do this thru SORT jcl.
Please share me your idea.
Regards
Jagadesh |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Are you saying you want to delete in place from the KSDS?
Or you want a copy of the input excluding certain records?
Or what? Please be exact in the description of your requirement. Write it as though we have no idea of what you want, as we don't. |
|
Back to top |
|
|
itjagadesh
New User
Joined: 05 Dec 2006 Posts: 89 Location: chennai
|
|
|
|
Sorry Bill for incorrect data.
I have to Omit 2 records from the File and copy into same file.
Say i have VSAM FILEA having 100 records and i want to delete only 2 particular records from FILEA and update. So output will be same FILEA with 98 records.(i know the key of the 2 records also)
Regards
Jagadesh |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
It is not a good idea to use the same dataset name for SORTIN and SORTOUT in the same step. I think that leave DFSORT out of the equation.
It narrows you down to ICETOOL. Check the documentation. If you find nothing, don't worry, you'll have picked-up a general overview of what ICETOOL is capable of.
For your task I'd go for "something else" to take in keys and delete the keys. Do all the proper stuff with it, of course. |
|
Back to top |
|
|
itjagadesh
New User
Joined: 05 Dec 2006 Posts: 89 Location: chennai
|
|
|
|
Thanks Bill .
Sure then i will go by any other utility also.
Regards
Jagadesh |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
No matter how you do this or what utility you choose, you should not write over the input file . . .
A safe alternative (using sort) would be to copy the data to a work file getting rid of the 2 records you want to discard. If these are the records to be added, write them into a work file also.
You still want to delete/define the target file to clean it up.
Sort the concatenation of the majority of the file and the 2 "special" records and reload (sort will do this also). |
|
Back to top |
|
|
itjagadesh
New User
Joined: 05 Dec 2006 Posts: 89 Location: chennai
|
|
|
|
Thanks for your Help Dick and Team
Regards
Jagadesh |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
itjagadesh wrote: |
i don't want to do this thru IDCAMS delete,define,copy from another file. I want to do this thru SORT jcl. |
itjagadesh,
Unless the VSAM cluster is defined as REUSE , You cannot use the same cluster as input and output for DFSORT. And there is always an issue of using the same cluster for input and output in a copy operation.
IDCAMS is an excellent utility to delete records from a VSAM cluster and I am not sure as to why you don't want to use it. |
|
Back to top |
|
|
|