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
 

 

SYNCSORT Problem: SUM FIELDS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: SYNCSORT Problem: SUM FIELDS
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: 2150
Location: At my coffee table

PostPosted: Tue Apr 22, 2008 7:11 pm    Post subject: Re: SYNCSORT Problem: SUM FIELDS
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Tue Apr 22, 2008 8:00 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue Apr 22, 2008 8:15 pm    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Tue Apr 22, 2008 8:39 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts Sort two file having same field, one ... himanshu malik DFSORT/ICETOOL 7 Thu Feb 02, 2017 10:09 am
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am


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