View previous topic :: View next topic
|
Author |
Message |
Ganesh Kalam Warnings : 1 New User
Joined: 11 Aug 2005 Posts: 45 Location: India
|
|
|
|
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,
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Ganesh Kalam Warnings : 1 New User
Joined: 11 Aug 2005 Posts: 45 Location: India
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome - good luck |
|
Back to top |
|
|
Ganesh Kalam Warnings : 1 New User
Joined: 11 Aug 2005 Posts: 45 Location: India
|
|
|
|
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 |
|
|
|