Joined: 28 Sep 2005 Posts: 210 Location: St Katherine's Dock London
you can do that in a number of ways. find out which file operation utility ur shop has and u can just get into the file and delete whatever records u want.
you might have Ditto or MasterCat or FileAid...
you can do it using JCL. u can use something like SELCOPY.
really depends on what ur requirement is. is it just to delete the records once and forget ? or is it some job which will be reusable ?
If I could put forward the case for SELCOPY... (I do work for Compute (Bridgend) Ltd on the SELCOPY help desk, so what would you expect ?)
SELCOPY VSAM input (sequentially or direct by KEY/Record number/RBA)supports READ for update. This is achieved by specifying parameter UPDATE (or UPD) on the VSAM data set READ statement.
Once a VSAM data set is opened for update, the SELCOPY DELETE, INSERT and UPDATE operations may be used to delete the last record read, insert a record out of key sequence and update the last record read respectively.
e.g. To conditionally delete a record from a VSAM data set being read sequentially...
READ INDD UPD
IF POS ... * Test conditions...
THEN DELETE INDD
For more specific code, you would need to provide us with a more detailed spec.