IBM Mainframe Forum Index
Log In
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register

Summation of Hexadecimal value using sort

IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message

New User

Joined: 08 Sep 2015
Posts: 1
Location: USA

PostPosted: Wed Sep 09, 2015 12:48 am
Reply with quote

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.


sort card


SORT FIELDS=COPY                                 
OUTFIL REMOVECC,                                 

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.

Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus

Joined: 09 Mar 2011
Posts: 7310
Location: Inside the Matrix

PostPosted: Wed Sep 09, 2015 2:38 am
Reply with quote

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.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT


Similar Topics
Topic Forum Replies
No new posts Installing sort utilities on hercules... DFSORT/ICETOOL 4
This topic is locked: you cannot edit posts or make replies. Sort card help to prepare status report DFSORT/ICETOOL 13
No new posts Building a sort key DFSORT/ICETOOL 3
No new posts Very Large Sort failed - Seeking reco... DFSORT/ICETOOL 7
Search our Forums:

Back to Top