Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
summing s9(8)v99 COMP field

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

Active User


Joined: 25 Apr 2007
Posts: 205
Location: Bangalore

PostPosted: Thu Apr 17, 2008 5:46 pm    Post subject: summing s9(8)v99 COMP field
Reply with quote

Hi,

I have a field defined as S9(8)V99 Comp defined in copybook (starting pos 30, ending at 37. It is occupying 8 bytes. I want to sum this field for each document no which is stored in pos 1 to 21 char.

When i view the fields in fileaid, it shows it has both positive and negative values. When i gave SUM FIELDS=(30,8,ZD), it sums positive values but leaves negative ones.

Thanks,
Ajay
Back to top
View user's profile Send private message

Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 788
Location: Chennai, India

PostPosted: Thu Apr 17, 2008 5:52 pm    Post subject:
Reply with quote

Is this okay?
Code:
SUM FIELDS=(30,8,BI)
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu Apr 17, 2008 6:39 pm    Post subject: Re: summing s9(8)v99 COMP field
Reply with quote

Ajay Baghel wrote:
I have a field defined as S9(8)V99 Comp defined in copybook (starting pos 30, ending at 37. It is occupying 8 bytes. I want to sum this field for each document no which is stored in pos 1 to 21 char.

When i view the fields in fileaid, it shows it has both positive and negative values. When i gave SUM FIELDS=(30,8,ZD), it sums positive values but leaves negative ones.
Using sort to sum?
I'm suprised that the whole thing didn't just abend. ZD is zoned decimal, COMP is binary.
Please post your JCL, sysouts and an example of your input and expected output.

gnanas,
BI is unsigned binary, FI is signed binary and would be a better choice... take a look at Appendix C and DFSORT Data Formats
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 205
Location: Bangalore

PostPosted: Fri Apr 18, 2008 5:57 am    Post subject: Reply to: summing s9(8)v99 COMP field
Reply with quote

My mistake, sorry in typing...

My sort card has belwo SUM statement

SORT FIELDS=(1,21,CH)
SUM FIELDS=(30,8,BI)

it sums positive values but leaves negative ones.




I tried
-Ajay
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Apr 18, 2008 6:08 am    Post subject: Re: Reply to: summing s9(8)v99 COMP field
Reply with quote

Ajay Baghel wrote:
SORT FIELDS=(1,21,CH)
SUM FIELDS=(30,8,BI)
it sums positive values but leaves negative ones.
Simple, if you would look at the DFSORT Data Formats you would have found that BI is binary unsigned and what you need is FI, basically binary signed....
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 How to include a particular field val... sakrat DFSORT/ICETOOL 8 Fri Apr 06, 2018 8:27 pm
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Searching a table for the field name? socker_dad COBOL Programming 8 Sat Mar 31, 2018 2:57 am
No new posts COMP Variables Mismatch gayu7 COBOL Programming 5 Wed Dec 20, 2017 5:06 pm
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us