Posted: Wed Jun 22, 2005 11:07 am Post subject: Deleting consecutive records using Sort/Fileaid
Hello,
Just trying my luck in this forum for a sort/fileaid solution.
I have Syncsort, Fileaid. Unfortunately I dont have DFSORT. I prefer not to use SAS, EZtrieve,rexx etc.
I have a dataset (VBM format) with some records. I want to delete a record satisfying a particular condition (say value of ABC in position n). Apart from deleting that record it must delete the next record also. This scenario happens when there are two records as header in the file (always in pairs).
The first header record can be identified by a condition, but there is no identifier for the second header record except that it will be the next
record to the first header record. I want to delete the headers satisfying particular condition.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed Jun 22, 2005 11:20 am Post subject:
Newuser,
The following JCL will give you the desired results. A brief explanation of the job.
The first steps takes in the input file and adds a constant of '1' or '0' to all the records depending on the search string. If string ABC is found on the record then the indicator will be '1' else it would be 0. we also will add seqnum which serves as a record no.
using outrec fields we add the constant to the record-no , so that the header records to be deleted will have the same record-no. Now doing sumsort on the record-no , we can eliminate the dups(same record-no is a dup) and use an omit cond to eliminate the first header record.
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