IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

ERROR in SORT: SUM FIELD OVERLAPS CONTROL FIELD


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
avaneendra_linga

New User


Joined: 13 Dec 2006
Posts: 73
Location: Hyderabad

PostPosted: Mon Apr 30, 2007 7:39 pm
Reply with quote

HI IN MY INPUT FILES I HAVE TWO VALUES STATING FROM 1 LEGTH IS 10.
I AM GETTING THE FOLLOWING ERROR WHILE DOING SUM ..CAN ANYBODY HELP ON THIS....

ICE112I EQUALS NOT USED WITH SUM
ICE119A SUM FIELD OVERLAPS CONTROL FIELD

Code:

INPUT:
//TOTI      DD  *   
0000000006         
0000000002         
/*                 

CARD:
//TOOLIN   DD   *                                 
  SORT FROM(TOTI) TO(TOTO) USING(CTL2)   
/*                                       

//CTL2CNTL  DD   *               
  SORT FIELDS=(1,10,CH,A),EQUALS   
  SUM FIELDS=(1,10,ZD)             
/*
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Apr 30, 2007 8:44 pm
Reply with quote

For DFSORT: "Summary fields must not be control fields. They must not overlap control fields, or each other, and must not overlap the RDW."
The simplest thing to do would inrec duplicate the one field into two and sort on one and sum on the other.
You do realize that your input:
0000000006
0000000002
would become:
00000000060000000006
00000000020000000002
and your output would be:
00000000060000000006
00000000020000000002
because if the key is different, they won't sum together.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Mon Apr 30, 2007 9:06 pm
Reply with quote

avaneendra_linga,

As William pointed out, you can't overlap sort and sum fields, but it usually doesn't make any sense to do that. SUM is used to sum fields with the same key. In your case, you just show two numeric fields with no key, so I suspect what you really want to do is just get an overall total for your numeric fields. You wouldn't do that with SUM. Instead, you'd do it like this:

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//TOTI      DD  *   
0000000006         
0000000002         
/*                 
//TOTO DD DSN=...  output file
//TOOLIN   DD   *                                 
COPY FROM(TOTI) USING(CTL2)   
/*                                       
//CTL2CNTL  DD   *               
  OUTFIL FNAMES=TOTO,REMOVECC,NODETAIL,
     TRAILER1=(TOT=(1,10,ZD,TO=ZD,LENGTH=10))   
/*


If that's not what you want to do, then please explain exactly what it is you're trying to do.
Back to top
View user's profile Send private message
avaneendra_linga

New User


Joined: 13 Dec 2006
Posts: 73
Location: Hyderabad

PostPosted: Tue May 01, 2007 10:49 am
Reply with quote

thx a lot FRANK.....the above one will do my work...............
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top