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
 

 

Adding the fields in a file: Getting overlapping error

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Adding the fields in a file: Getting overlapping error
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

Site Director


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

PostPosted: Fri Aug 10, 2007 1:30 am    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Fri Aug 10, 2007 1:48 am    Post subject:
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

Site Director


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

PostPosted: Fri Aug 10, 2007 1:53 am    Post subject:
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    Post subject:
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    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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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