Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
Amit V Kumar

New User

Joined: 04 Feb 2008
Posts: 2
Location: Pune

 Posted: Mon Feb 04, 2008 2:19 pm    Post subject: How to sum a comp feild using dfsort 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.........

muthuvel

Active User

Joined: 29 Nov 2005
Posts: 217
Location: Chennai

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

 Quote: 00086P 00524K

These two data seems to be alpha numeric.This will result in SOC7 when you try to sum.
dick scherrer

Site Director

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

 Posted: Mon Feb 04, 2008 9:06 pm    Post subject: 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.
Frank Yaeger

DFSORT Moderator

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

Posted: Mon Feb 04, 2008 10:08 pm    Post subject:

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.
Amit V Kumar

New User

Joined: 04 Feb 2008
Posts: 2
Location: Pune

 Posted: Wed Feb 06, 2008 10:17 am    Post subject: Reply to: How to sum a comp feild using dfsort Hi Frank/Dick, You are right that is ZD only and the option you gave it worked for me Thanks a lot
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us