This card is doing summation of the records depending on the field (whcih is starting at 101 and having length 6 byte). If more than one record will have same value then there will be summation which is coming in the o/p file as 6 bytes.
The problem is that, if sum of such records is more than 6 byte then it is getting truncated. Can we increase the length here in sort card so that sum should not truncate?
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Code:
SECTIONS=(101,6,TRAILER3=(101,6,COUNT)),REMOVECC
Quote:
This card is doing summation of the records depending on the field (whcih is starting at 101 and having length 6 byte). If more than one record will have same value then there will be summation which is coming in the o/p file as 6 bytes.
No, that's NOT what this card is doing. What it's actually doing is creating a section trailer with positions 101-106 from the last record in the section followed by the COUNT of records in the section. If you want to sum the field at 101-106, you would use something like this:
i.e Name11 as of 6 bytes and count(i.e total01) as of 8 bytes. I ran the job with the above suggested solution. The length of Total01 is increased but not displaying Name11 in o/p file. I want both the fields in o/p file with increased length of Total01 to 9 bytes instead of 8 bytes.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You really should try harder to get your terminology right.
You apparently want a count of the number of records with each key. That is NOT the same as saying you are "doing summation of the records depending on the field (whcih is starting at 101 and having length 6 byte)". The latter would imply using TOTAL, not COUNT.
In the future, please try harder to explain clearly what you want to do and include an example of input and expected output. That will save everyone (including you) time.