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
 

 

How to sum a comp feild using dfsort

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

New User


Joined: 04 Feb 2008
Posts: 2
Location: Pune

PostPosted: Mon Feb 04, 2008 2:19 pm    Post subject: How to sum a comp feild using dfsort
Reply with quote

I have to sum on a field which is a comp like

00086P
00524K
003856
001969
002846

I am using dfsort (sum fields) but giving SOC7, can anybody help in resolving it.........
Back to top
View user's profile Send private message

muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Chennai

PostPosted: Mon Feb 04, 2008 2:41 pm    Post subject: Reply to: How to sum a comp feild using dfsort
Reply with quote

Quote:
00086P
00524K

These two data seems to be alpha numeric.This will result in SOC7 when you try to sum.
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: Mon Feb 04, 2008 9:06 pm    Post subject:
Reply with quote

Hello,

Please post your jcl and control statements as well as the dcb info for the file.

The values posted are not comp - they look like zoned decimal. The first 2 values are negative (if these are actually zoned decimal). Coded properly, you will be able to sum these numbers with no 0c7.
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: Mon Feb 04, 2008 10:08 pm    Post subject:
Reply with quote

As Dick said, these look like ZD values, not comp (BI) values. If I use a DFSORT job like this:

Code:

//S1    EXEC  PGM=ICEMAN               
//SYSOUT    DD  SYSOUT=*               
//SORTIN DD *                         
00086P                                 
00524K                                 
003856                                 
001969                                 
002846                                 
//SORTOUT DD SYSOUT=*                 
//SYSIN    DD    *                     
  OPTION ZDPRINT                       
  SORT FIELDS=(10,1,CH,A)             
  SUM FIELDS=(1,6,ZD)                 
/*


I get a RC=0 and SORTOUT has:

002562

So you need to give more details about what exactly you're doing that gives you the 0C7.
Back to top
View user's profile Send private message
Amit V Kumar

New User


Joined: 04 Feb 2008
Posts: 2
Location: Pune

PostPosted: Wed Feb 06, 2008 10:17 am    Post subject: Reply to: How to sum a comp feild using dfsort
Reply with quote

Hi Frank/Dick,

You are right that is ZD only and the option you gave it worked for me

Thanks a lot
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 get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts DFSORT sorting only specific records akodakka DFSORT/ICETOOL 4 Thu Aug 04, 2016 11:24 am


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