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

SYNCSORT Problem: SUM FIELDS


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gaurao

New User


Joined: 27 Mar 2006
Posts: 6

PostPosted: Tue Apr 22, 2008 5:44 pm
Reply with quote

Please correct what I am missing on SUM FIELDS part of control card.

The error message says ILLEGAL OVERLAPPING OF SUM FIELDS

Code:

//STEP0100 EXEC PGM=SYNCTOOL 
//TOOLMSG  DD SYSOUT=*       
//DFSMSG   DD SYSOUT=*       
//IN1      DD *             
111                         
111                         
222                         
/*                           
//OUT      DD SYSOUT=*       
//TOOLIN   DD *             
  SORT FROM(IN1) USING(CTL3)
//CTL3CNTL DD *             
  INREC FIELDS=(1:1,3,ZD)   
  SORT FIELDS=(1,3,ZD,A)     
  SUM FIELDS=(1,3,ZD)       
  OUTFIL FNAMES=OUT         
//*                         


The error messages:
CALLER-PROVIDED IDENTIFIER IS "0001"
SYSDIAG= 73439, 367449, 367449, 1818448
16,740K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
0 BYTES RESERVE REQUESTED, 1,004K BYTES USED
20K BYTES OF EMERGENCY SPACE ALLOCATED
ILLEGAL OVERLAPPING OF SUM FIELDS
IN1 : RECFM=FB ; LRECL= 80; BLKSIZE= 80
SYNCSMF CALLED BY SYNCSORT; RC=0000
SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Apr 22, 2008 7:11 pm
Reply with quote

gaurao wrote:
The error message says ILLEGAL OVERLAPPING OF SUM FIELDS

Quote:
WER220A ILLEGAL OVERLAPPING OF SUM FIELDS
EXPLANATION: A SUM field overlaps another SUM field, a SORT/MERGE control field or the Record Descriptor Word of a variable-length record. All of these are illegal.

INREC FIELDS=(1:1,3,ZD) Why reformat the input to exactlly what it already is?
SORT FIELDS=(1,3,ZD,A) Why sort on the field you are disappearing with the SUM?
SUM FIELDS=(1,3,ZD) Why don't you just do a COPY and SUM?
Back to top
View user's profile Send private message
gaurao

New User


Joined: 27 Mar 2006
Posts: 6

PostPosted: Tue Apr 22, 2008 7:51 pm
Reply with quote

Thanks for the attention.

However I could not succeed
with any of what you suggested.

By the way for SUM FIELDS to operate, we do require the
SORT FIELDS.

I guess I am missing out on position and tyep of data while SUMMING.

Would you mind trying this JCL??
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Apr 22, 2008 8:00 pm
Reply with quote

Quote:
The SUM control statement cannot be used when FIELDS=COPY is specified on the SORT or MERGE control statement or for a Tape Sort.
Right you are, why not just sort on a blank column, like 4?
Back to top
View user's profile Send private message
gaurao

New User


Joined: 27 Mar 2006
Posts: 6

PostPosted: Tue Apr 22, 2008 8:08 pm
Reply with quote

Thank you..
So I learnt my lesson..
It executed with
//CTL3CNTL DD *
SORT FIELDS=(4,1,CH,A)
SUM FIELDS=(1,3,ZD)
OUTFIL FNAMES=OUT
//*


However I am shocked why it does not sort with (1,3,ZD,A)
or (1,3,CH,A).

Any reason for this??
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Apr 22, 2008 8:15 pm
Reply with quote

Hello,

Because it is a rule.

You sort on some field(s) and sum on some other(s).
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Apr 22, 2008 8:39 pm
Reply with quote

gaurao wrote:
However I am shocked why it does not sort with (1,3,ZD,A)
or (1,3,CH,A).
If you really wanted it, uou could try something like:
Code:
  INREC FIELDS=(1:1,3,ZD,4:1,3,ZD)   
  SORT FIELDS=(4,3,ZD,A)     
  SUM FIELDS=(1,3,ZD)       
Back to top
View user's profile Send private message
gaurao

New User


Joined: 27 Mar 2006
Posts: 6

PostPosted: Wed Apr 23, 2008 9:01 am
Reply with quote

Thank you for all your time.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts z/vm installation problem All Other Mainframe Topics 0
No new posts Job scheduling problem. JCL & VSAM 9
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
Search our Forums:

Back to Top