I have one file which contains lets say 100 records. the structure of the record is
Here 123456789012 is one fileld lets say CBAID now i want to select all the records having this Key as a part and the Record type as F1E1.
After selecting these records i want to delete these records.
in above records i want to delete the records which are in bold because theay are of same type and having same CBAID
Can anyone send me the solution for this as soon as possible.
If your "key" is in the same location in all the records that you want to select, that is simple.
Omitting records might be a little more work, I don't understand how the selected records from your sample differ form the deleted records, do they?
Would more records in the example show that some selected records do not get deleted?
Would more records in the example show that some un-selected records do also get deleted?
Based on your example, it appears that you want to delete records which have 'F1E1' in positions 1-4 and '123456789012' anywhere from position 5 to the end of the record. Here's a DFSORT job that will do that. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.
As my file is consist of thousands of records,in this case i want to search all F1E1 type of record which has duplicate CBA id (which is mentioned above)
which is a key to search. But here i cant Hard code CBA Id value as i may have thousands of duplicate records in a file.
That means first I have to search the entire file based on CBA id. If this CBA id found in 2 F1E1 type of records then delete those records or move them to different file.