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

Adding the fields in a file: Getting overlapping error


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ganesh Kalam
Warnings : 1

New User


Joined: 11 Aug 2005
Posts: 45
Location: India

PostPosted: Fri Aug 10, 2007 12:58 am
Reply with quote

Hi,

My Input file contains the following data,

Code:

----+----1--
12345 11223
67853 23456


The fields in the positions 1 to 5 and the fields in the position 7 to 11 should be summed up and my output should contain the following data,

Code:

80198 34679



I am using the following JCL but i am getting fields overlapping error. (Note : Record length of input and output files is 12)

Code:
//TSTSTEP  EXEC PGM=SORT,REGION=0M   
//SYSOUT   DD SYSOUT=*               
//SYSUDUMP DD SYSOUT=*               
//SORTIN   DD DSN=CEC.SUMINP,DISP=SHR
//SORTOUT  DD DSN=CEC.SUMOUT,DISP=SHR
//SYSIN    DD *                       
   SORT FIELDS=(1,12,CH,A)           
   SUM FIELDS=(1,5,7,5),FORMAT=BI     
/*       


Can anyone please help me in solving 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: Fri Aug 10, 2007 1:30 am
Reply with quote

Hello,

Please post all of the diagnostic info from your job. Use copy/paste rather than entering selected info.

When posting code, jcl, or control statements, it is helpful to use the "Code" tab near the top of the reply panel. Note how your original post has been "code"ed.
Back to top
View user's profile Send private message
Ganesh Kalam
Warnings : 1

New User


Joined: 11 Aug 2005
Posts: 45
Location: India

PostPosted: Fri Aug 10, 2007 1:45 am
Reply with quote

I am not aware of this thing dick.From the next time i will do what you have recommended. Thanks very much,.
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: Fri Aug 10, 2007 1:48 am
Reply with quote

If you were doing SORT and SUM, you would SORT on position 6 and SUM on ZD fields, not BI fields. But you don't want to do a SORT and SUM here since you're totalling the values in all of the records. What you want is this DFSORT job:

Code:

//TSTSTEP  EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=CEC.SUMINP,DISP=SHR
//SORTOUT  DD DSN=CEC.SUMOUT,DISP=SHR
//SYSIN    DD *
   OPTION COPY
   OUTFIL REMOVECC,NODETAIL,
     TRAILER1=(TOT=(1,5,ZD,TO=ZD,LENGTH=5),
             7:TOT=(7,5,ZD,TO=ZD,LENGTH=5))
/*
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: Fri Aug 10, 2007 1:53 am
Reply with quote

Quote:
Thanks very much

You're welcome - good luck icon_smile.gif
Back to top
View user's profile Send private message
Ganesh Kalam
Warnings : 1

New User


Joined: 11 Aug 2005
Posts: 45
Location: India

PostPosted: Fri Aug 10, 2007 2:24 am
Reply with quote

Yes Frank, As you mentioned no need to sort. Just need to sum the values in all records.

Your JCL helped. Thanks a lot.
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 FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top