pvkmainframes
New User
Joined: 08 Sep 2015 Posts: 1 Location: USA
|
|
|
|
Hi Team,
I am new to this forum. I have one requirement to sum the Hexadecimal value and dispaly in Trailer record. I am trying different options in syncsort, but result is not expected one. can you plese help on this.
Input data:: we are getting this file from cobol program in cobol this varibale is declared as a comp-2.
Data appers in below format when we use copybook.
-8.005000000000000E+02
-8.005000000000000E+02
-8.005000000000000E+02
-8.005000000000000E+02
-8.005000000000000E+02
sort card
Code: |
SORT FIELDS=COPY
OUTFIL REMOVECC,
TRAILER1=(1:C'TOTAL',6:TOT=(1,8,FL,SIGNS=(+,-)))
|
actual output should be:: -4002.50
sot JCL giving the output :: 4000-
i tried using EDIT parm in the sort like EDIT=(SIIIIIIIIIIIIIIT.TT), but if input changes it is not giving correct value.
Can you please suggest how to solve this issue. Plese let me know if you need any other details and also correct me if anything wrong in this post.
Thanks,PV |
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
If your data contains a floating-point value (in COBOL, COMP-1 or COMP-2, or even longer than those) then FL is only going to get you the integer part of that.
If you need it in SORT, you'll have to arrange an EXIT program to do a conversion which would have a defined number of decimal places. Or just do it in a general-purpose programming language if you don't need other parts of SORT's capabilities for the task.
The code you show is behaving exactly as it should. It cannot behave as you want. If you want to moan about it, take it up with SyncSORT, not here. |
|