There is no restriction in using INCLUDE/INREC. i had wrongly mentioned it.
I want to sort only those 2 records because it could be duplicate. and if it is duplicate i would like to sum = none.
I would like to sort on Position 25. which has value PEOPLE. and this sorting should happen only for 2 and 9th record which has Unique value 'LINE' in position 4.
If I Sort on Position 4 and then 25.. and SUM=NONE, then these 2 rows will become single row.
I would like to write this record in the same file along with other records.
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
If the position within the file of the records with 'LINE' in them is not important, then I would suggest splitting the file into two, those with LINE in them and those without.
Performing your SORT SUM on the LINE records and then concatenating the two files back together again.
If the record position within the file is important then I will leave this one to someone who knows and uses the sort product far better than I do. Although if you read the document for smart tricks with DFSORT I recall an example that puts seq numbers on the records and these could then be used to place the LINE record(s) back in their original places.