Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

To sum binary datatype

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
shell100

New User


Joined: 14 Apr 2006
Posts: 25
Location: Banglore,India

PostPosted: Wed Jun 18, 2008 1:58 pm    Post subject: To sum binary datatype
Reply with quote

Need some help to do sum on binary datatype.
I am using file which need to be sort on 2 fields & sum on 1 field.

Sample :

SORT FIELDS=(1,25,CH,A,26,10,ZD,A)
SUM FIELDS=(35,4,BI)

X(PIC X(25)
Y (PIC 9(10))
Z (PIC S9(9) COMP)

I am not able to achieve sum with records having +positive & -negative value both for variable Z.

For ex : I have input file as
INDIA, 1234567891, -10
INDIA, 1234567891, 10
INDIA, 1234567891, -10
INDIA, 1234567891, 10

Required o/p should be as
INDIA, 1234567891, 0

But it is coming same as I/P file.

It would be great if you could give some pointer to resolve this ?

Shell
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Jun 18, 2008 8:35 pm    Post subject:
Reply with quote

Hello,

The data posted does not begin with an x(25) field?

The SUM FIelds begins in 35?

Please show a few records in hex (using the "Code" tab to preserve alignment).
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Jun 18, 2008 9:16 pm    Post subject:
Reply with quote

Shell,

BI is unsigned binary so you can't use it to sum + and - values. You can use FI to sum + and - values. Try:

Code:

   SUM FIELDS=(35,4,FI)
Back to top
View user's profile Send private message
shell100

New User


Joined: 14 Apr 2006
Posts: 25
Location: Banglore,India

PostPosted: Thu Jun 19, 2008 6:37 pm    Post subject: Reply to: To sum binary datatype
Reply with quote

Thanks!!

It worked with FI.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts resume binary ftp in z/os meykh2014 All Other Mainframe Topics 6 Sun Jan 22, 2017 10:01 am
No new posts Casting a Binary Number to Numeric in... Bob Steinkraus Java & MQSeries 6 Tue Aug 09, 2016 5:58 pm
No new posts MOVING COMP-3 into binary akodakka COBOL Programming 2 Tue Dec 01, 2015 5:02 pm
No new posts USS Shell script:Convert hex to binar... RSR2015 All Other Mainframe Topics 0 Fri Sep 18, 2015 2:00 am
No new posts extract records based on Binary field chockalingam_rsp SYNCSORT 34 Fri May 01, 2015 2:23 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us