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
 

 

ERROR in SORT: SUM FIELD OVERLAPS CONTROL FIELD

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: ERROR in SORT: SUM FIELD OVERLAPS CONTROL FIELD
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: 3158
Location: Tucson AZ

PostPosted: Mon Apr 30, 2007 8:44 pm    Post subject:
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 Moderator


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

PostPosted: Mon Apr 30, 2007 9:06 pm    Post subject:
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    Post subject:
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    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 change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am


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