View previous topic :: View next topic
|
Author |
Message |
avaneendra_linga
New User
Joined: 13 Dec 2006 Posts: 73 Location: Hyderabad
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
avaneendra_linga
New User
Joined: 13 Dec 2006 Posts: 73 Location: Hyderabad
|
|
|
|
thx a lot FRANK.....the above one will do my work............... |
|
Back to top |
|
|
|