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
 

 

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 SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am
No new posts 2 byte YEAR from Y'DATE2' field tecnokrat DFSORT/ICETOOL 2 Tue Feb 07, 2017 12:05 pm
No new posts Sort two file having same field, one ... himanshu malik DFSORT/ICETOOL 7 Thu Feb 02, 2017 10:09 am


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