The current situation is that we are generating the trailer in the sort control card and it is apended to the file at the bottom, but the trailer TOT parameter will have the count upto the previous record read only i.e the trailer record is not added to the count.
We need to include this trailer record also in the total count..can we have it done in the same control card .
Currently we have coded the control card as:
But now we need to include the trailer record as well , how can we do that in the same control card.
You don't need to use TOT to total up 1's to get the count. DFSORT has a COUNT parameter for that. And you can even use COUNT+1 to get the count of the data records + 1 for the trailer record. You can do it like this:
INREC FIELDS=(1,500) <---- if needed
I have one more query on this. Can the record count be a variable field. In the example given above, the count will be written to a field of length 7 so if the rec count is 1600 it will come as 0001600. I dont leading zeros, is it possible using Sort ?