View previous topic :: View next topic
|
Author |
Message |
adushkin
New User
Joined: 02 Jun 2006 Posts: 6
|
|
|
|
The following Jcl is working when not count sing, what should I do to get output below
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=A
//SORTIN DD DSN=Input file FB-1000,
// DISP=SHR
//SORTOUT DD SYSOUT=A
//SYSIN DD *
SORT FIELDS=COPY
OMIT COND=(1,4,CH,EQ,C'HEAD')
OUTFIL FNAMES=SORTOUT,
OUTREC=(3:160,14,
19:174,9,
35:349,19,
55:368,19,
133:X),
TRAILER1=(2:'TOTAL AMOUNT : ',
TOTAL=(350,18,ZD,EDIT=(IIIIIIIIIT),SIGNS=(+,-)),
TOTAL=(369,18,ZD,EDIT=(IIIIIIIIIT),SIGNS=(+,-)),
3/,2:'TOTAL RECORDS: ',COUNT)
/*
Input
pos 349 368
-5----+----6----+----7----+----8----+----9
+000000000000000000+000000000000053860
+000000000000053860+000000000000000000
+000000000000000000-000000000000000020
-000000000000000020+000000000000000000
expected output :
---+----1----+----2----+----3----+----4----+----5----+----6----+----7----
YYY YYYYYYYYYY AAAAAA +000000000000000000 +000000000000053860
YYY YYYYYYYYYY AAAAAA +000000000000053860 +000000000000000000
YYY YYYYYYYYYY AAAAAA +000000000000000000 -000000000000000020
YYY YYYYYYYYYY AAAAAA -000000000000000020 +000000000000000000
-------------------------------------------------------------------------
TOTAL AMOUNT : DEBIT : 53840 CREDIT : 53840
TOTAL RECORDS: 4
|
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
adushkin,
These DFSORT control statements will give you what you asked for. Note the use of FS, and S in EDIT, to handle the signs.
Code: |
SORT FIELDS=COPY
OMIT COND=(1,4,CH,EQ,C'HEAD')
OUTFIL FNAMES=SORTOUT,
OUTREC=(3:160,14,
19:174,9,
35:349,19,
55:368,19,
133:X),
TRAILER1=(2:'TOTAL AMOUNT : ',
35:'DEBIT:',
TOTAL=(349,19,FS,EDIT=(SIIIIIIIIIT),SIGNS=(,-)),
55:'DEBIT:',
TOTAL=(368,19,FS,EDIT=(SIIIIIIIIIT),SIGNS=(,-)),
3/,2:'TOTAL RECORDS: ',COUNT)
|
|
|
Back to top |
|
|
|
|