I am trying to calculate the SUM of two fields from the Input file using the SUM FIELDS option of DFSORT. The reason i am looking for SUM FIELDS option only is because part of my application was transferred to Linux and i will run this sort card on Linux and there no other option works except SUM FIELDS.
The sum of first field is working fine but i am getting the issue while summing the second field which is having the decimal value with sign. Below is the file layout :
Code:
----+----1----+----2----+----3----+----4---
********************************* Top of Da
001,"ALAOO","ACTUALS",119986,-0000000167.59
001,"ALAOO","ACTUALS",119986,-0000000186.04
001,"ALAOO","ACTUALS",119986,-0000001380.46
001,"ALAOO","ACTUALS",119986,-0000003265.91
001,"ALAOO","ACTUALS",119986, 0000000009.07
001,"ALAOO","ACTUALS",119986, 0000000023.56
001,"ALAOO","ACTUALS",119986, 0000000047.12
001,"ALAOO","ACTUALS",119986,-0000000004.98
001,"ALAOO","ACTUALS",119986,-0000000004.77
I am trying to sum on the first 3 bytes of the Input file & 14 bytes starting from 30th byte of Input file but i am getting S0C7. Can anyone please able to help me on this as i am trying to resolve this from quite some time now. I believe i am not using the correct format for second field. Please let me know your thoughts.
Thanks for taking out the time to go through this. This is i have used
Code:
INREC OVERLAY=(30:30,14,SFF,TO=ZD,LENGTH=14)
SORT FIELDS=(6,5,CH,A)
SUM FIELDS=(1,3,ZD,30,14,ZD)
OUTREC FIELDS=(C'RECCOUNT',9:1,3,
C' TOTALAMOUNT ',25:30,14,ZD,EDIT=(STTTTTTTTTT.TT),SIGNS=(,-))
and this is working fine in Mainframe but when i am using this card in Linux, it is giving error on OVERLAY keyword. So wanted to ask if there is any way to achieve this without OVERYLAY and with SUM FIELDS ?
Part of our application was earlier transferred on Linux and that is why some of the SORT keywords do not work in that environment. One of such SORT keyword is 'OVERLAY' which i have used in above given sort card.
So In other words, i have a constraint here where i have to achieve the requirement by using 'SUM FIELDS' & not using 'OVERLAY' keywords. If there is any solution available with these constraints, then please let me know.
I have already given my code above. Below is the sample output which i am expecting.
Code:
----+----1----+----2----+----3----+---
***************************** Top of D
RECCOUNT100 TOTALAMOUNT -0000032429.27
**************************** Bottom of
The sum which is starting from 9th & 25th byte is not the sum of above given sample Input records. It is just for reference that how output should be displayed.