View previous topic :: View next topic
Author
Message
danylele74 New User Joined: 03 Jul 2014Posts: 28 Location: Italy
Hello, i must to sum an alphabetic fiels.
The lenght of the input file is 10000. Same for the putput file.
The fields is at position 3674 (alphanumeric)
The key is at position 13,9.
Input file:
Code:
FROM 1 to 22 FROM 3674 to 3693
----+----1----+----2-- -+----8----+----9---
30/06/2014; 000002288; +000000000097298,28;
30/06/2014; 000002288; +000000000097298,28;
30/06/2014; 000002288; +000000000006517,63;
Here my jcl.
Code:
//STEP060 EXEC PGM=SORT,REGION=0M,COND=(0,NE)
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=XSE005.IMP000.IM1IM71.DATAPLUS.SORT3
//SORTOUT DD DISP=OLD,DSN=XSE005.IMP000.IM1IM71.DATAPLUS.SORT4
//SYSIN DD *
SORT FIELDS=(13,9,CH,A),FORMAT=BI
OUTFIL REMOVECC,NODETAIL,
SECTIONS=(13,9,
TRAILER3=(1,3673,X,
TOT=(3674,19,SFF,EDIT=(STTTTTTTTTTTTTTT.TT),SIGNS=(+,-))))
I need the rest of the file starting at position 3693 to 10000.
Can you help me?
Back to top
Bill Woodger Moderator Emeritus Joined: 09 Mar 2011Posts: 7309 Location: Inside the Matrix
Did you even thank Magesh23586 for the code?
So, now make lots more TOTs. Either rexx, SORT or the ISPF editor, or whatever your are comfortable with. You may run out of control cards, but you'll only know that if/when it happens.
Back to top
danylele74 New User Joined: 03 Jul 2014Posts: 28 Location: Italy
I don't know who is Magesh23586.
Back to top
enrico-sorichetti Superior Member Joined: 14 Mar 2007Posts: 10873 Location: italy
Back to top
danylele74 New User Joined: 03 Jul 2014Posts: 28 Location: Italy
this is my jcl (modified):
Code:
//STEP060 EXEC PGM=SORT,REGION=0M,COND=(0,NE)
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=XSE005.IMP000.IM1IM71.DATAPLUS.SORT3
//SORTOUT DD DISP=OLD,DSN=XSE005.IMP000.IM1IM71.DATAPLUS.SORT4
//SYSIN DD *
SORT FIELDS=(13,9,CH,A),FORMAT=BI
OUTFIL REMOVECC,NODETAIL,
SECTIONS=(13,9,SKIP=P,
TRAILER3=(1:13,9,X,
TOT=(3674,19,SFF,EDIT=(STTTTTTTTTTTTTTT.TT),SIGNS=(+,-))))
but the output file is wrong. It is not what i need:
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7
000002288 +000000000201114.19
all the rest of the data is lost.
Back to top
danylele74 New User Joined: 03 Jul 2014Posts: 28 Location: Italy
Hello, I think I found the solution.
Unfortunately in the output file (at the bottom right of the record) I find the range containing the calculated sum.
Is it possible to remove it without losing the data contained in the input file ?
This is my JCL
Code:
//STEP060 EXEC PGM=SORT,REGION=0M,COND=(0,NE)
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=FILE.INPUT
//SORTOUT DD DISP=OLD,DSN=FILE.OUTPUT
//SYSIN DD *
SORT FIELDS=(13,9,CH,A),FORMAT=BI
OUTFIL REMOVECC,NODETAIL,
SECTIONS=(13,9,
TRAILER3=(1:1,9980,X,
TOT=(3674,19,SFF,EDIT=(STTTTTTTTTTTTTTT.TT),SIGNS=(+,-))))
Thank you
p.s.
Input and output files have lenght 10000.
Back to top
Bill Woodger Moderator Emeritus Joined: 09 Mar 2011Posts: 7309 Location: Inside the Matrix
If you found that yourself, I'm sure you can fix your problem, as you understand what you are saying.
If you can't fix your problem, please continue the topic in the forum you started it in. This has been locked.
Back to top
Please enable JavaScript!