I have a question as i want to delete the records in an existing KSDS cluster , the solution provided by you for deletion i am not quite clear as want u mean for //CON DD DSN=YOUR VSAM DELETE REC FILE, can you help me i want to delete the records from an existing dataset and lod the records from one more new dataset as initially went i loaded the records i missed out to keep one field blanks.
Code:
DELETE solution:
We first copy contents of the vsam file to a temp dataset. Now we concatenate this temp dataset along with the records to be deleted and load back to the original file.when we concate the records to be deleted file with the temp dataset, all the keys which we want to delete will be duplicates. 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.
The first file here (YOUR VSAM DELETE REC FILE) refers to the "seq file having record keys". The second file here (&T1) refers to the temporary file created by the COPY operator.
Quote:
can you help me i want to delete the records from an existing dataset and lod the records from one more new dataset as initially went i loaded the records i missed out to keep one field blanks.
It's not clear what you want to do. Do you want to remove all of the records from a VSAM data set, and then load new records from a sequential data set, or what?
What is the starting position and length of the KSDS key? Are all of the records in the KSDS the same length or does the length vary?
What is the RECFM and LRECL of the sequential data set you want to load the records from? Are the records to be loaded already in the correct key order for the KSDS file?
You need to explain more clearly what you're trying to do. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
It's not clear what you want to do. Do you want to remove all of the records from a VSAM data set, and then load new records from a sequential data set, or what?
Ans: exactly yes
What is the starting position and length of the KSDS key? Are all of the records in the KSDS the same length or does the length vary?
Ans: starting pos is 1 and the length is 3 bytes
What is the RECFM and LRECL of the sequential data set you want to load the records from? Are the records to be loaded already in the correct key order for the KSDS file?
Ans: RECFM = FB LRECL = 50 , yes the records to be loaded are already in the correct key for the KSDS file.
You need to explain more clearly what you're trying to do.
Ans: I have already records in a ksds in sorted order , now i dot not have tools to delete the records , so i would like to delete the records by using Kolusu method and i would like to load the records once again from a sequential file.Hope i am clear.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Mon Sep 24, 2007 1:12 pm Post subject:
This is actually a much simpler case than those in the the post Kolusu responded to. In your case, you just want to delete all of the records from the VSAM KSDS and load new records from a sequential data set that has the records in the correct order, and all of the records are the same length (50 bytes). As long as the VSAM KSDS was defined with REUSE, you can use DFSORT's RESET option and just COPY the records into the VSAM KSDS directly. Here's the DFSORT job:
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Tue Sep 25, 2007 11:22 am Post subject:
a) I'm not a VSAM expert, but I suspect you need REUSE in order to keep the VSAM data set and reload it. Without REUSE, I'd guess you'd need to DELETE the KSDS and DEFINE it again before you load it. I'm sure somebody who knows VSAM better will correct me if I'm wrong (which I well might be).
b) Kolusu's post was in response to a request to only delete certain records based on a list of keys. Your request is to delete all of the records and then reload the file. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum