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 Need urgent suggestion on DFSORT subratarec DFSORT/ICETOOL 6 Wed Mar 21, 2018 8:46 pm COMP Variables Mismatch gayu7 COBOL Programming 5 Wed Dec 20, 2017 5:06 pm Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm Formatting using DFsort Guru Nandu DFSORT/ICETOOL 5 Thu Nov 30, 2017 7:33 am Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am

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