Now that i know REPRO is not possible i will try SORT.
I also changed how the data in files will be. I noticed a typo from earlier
Where the first 4 bytes are the key of the KSDS
The o/p KSDS needs to have all data present in the 2nd KSDS and the records in KSDS1 which are not present in KSDS2. Basically i want to copy data from first KSDS into 2nd KSDS without overlaying any data
I was wondering why enrico said No. I guess he was looking at your data, which does not match your original description in the text.
If you have on your input file a mix of keys which are already present, and keys which are not already present, and you just want those records which have keys which are not already present, the look at the manual which describes IDCAMS, find the bit about REPRO and look at REPLACE within REPRO and see if that will do what you want.