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
 
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 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
No new posts Formatting using DFsort Guru Nandu DFSORT/ICETOOL 5 Thu Nov 30, 2017 7:33 am
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Compare and COPY using DFSORT pshongal DFSORT/ICETOOL 3 Fri Nov 17, 2017 9:49 am

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