Rick Ryan
New User
Joined: 29 Apr 2020 Posts: 14 Location: USA
|
|
|
|
I am trying to sum up 2 groups of fields. One consists of 9 fields formatted ZD9, the other consists of 10 fields formatted ZD 11.2. I need to SUM these fields and output a summary table. Here is what I have:
Input:
Code: |
Command ===> Scroll ===> PAGE
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
AF1JA 1130 AA1ZA CWW0001NT00000002B00000000A00000000{00000000{00000000{000
AF1JA 14547 AA1ZA LEM0001NT00000002{00000000{00000000{00000000{00000000{000
AF1JA 14547 AA1ZB LEM0001NT00000002B00000000{00000000{00000000{00000000{000
AF1JA 12A697 AA5ZA LED0001NT00000002D00000000{00000000{00000000{00000000{000
AF1JA 13C105 AA5ZB LEO0001NT00000001E00000000{00000000{00000000{00000000{000
AF1JA 14A464 AA5ZB LEW0001NT00000000A00000000D00000000{00000000{00000000{000
AF1JA 14277 AA5ZA MBP0001NT00000008{00000000{00000000{00000000{00000000{000
AF1JA 14529 AA5ZAA LEE0001NT00000000I00000000{00000000{00000000{00000000{000
AF1JA 15K602 AA5ZF CDL0001NT00000001H00000000{00000000{00000000{00000000{000
AF1JA 15K867 AA5ZB LEW0001NT00000001E00000000{00000000{00000000{00000000{000
AF1JA 16916 AA5ZB CCH0001NT00000006F00000000{00000000A00000000{00000000{000
AF1JA 17K707 AA5ZB CIM0001NT00000000H00000000{00000000{00000000{00000000{000
AF1JA 17526 AA5ZA MWB0001NT00000002{00000000{00000000{00000000{00000000{000
AF1JA 17527 AA5ZA MWB0001NT00000000D00000000{00000000{00000000{00000000{000
AF1JA 3A713 AA5ZC LSO0001NT00000002F00000000{00000000{00000000{00000000{000
AF1JA 3C716 AA5ZA LSO0001NT00000001I00000000{00000000{00000000{00000000{000
AF1JA 3C716 AA5ZB LSO0001NT00000015A00000000{00000000{00000000{00000000{000
AF1JA 5A205 AA5ZA LXP0001NT00000001A00000000{00000000{00000000{00000000{000
AF1JA 5A205 AA5ZB LXP0001NT00000001{00000000{00000000{00000000{00000000{000
AF1JA54406A10 AA5ZA CCR0001NT00000003A00000000{00000000{00000000{00000000{000
----+----9----+----0----+----1----+----2----+----3----+----4----+----5----+----6
********************************* Top of Data **********************************
00000{00000000{00000000{00000000{0000001174H0000000053D0000000000{0000000000{000
00000{00000000{00000000{00000000{0000004820{0000000000{0000000000{0000000000{000
00000{00000000{00000000{00000000{0000004815H0000000000{0000000000{0000000000{000
00000{00000000{00000000{00000000{0000000331B0000000000{0000000000{0000000000{000
00000{00000000{00000000{00000000{0000011202{0000000000{0000000000{0000000000{000
00000{00000000{00000000{00000000{0000000174{0000000696{0000000000{0000000000{000
00000{00000000{00000000B00000000{0000000664{0000000000{0000000000{0000000000{000
00000{00000000{00000000{00000000{0000001205A0000000000{0000000000{0000000000{000
00000{00000000{00000000{00000000{0000007774B0000000000{0000000000{0000000000{000
00000{00000000{00000000{00000000{0000001248{0000000000{0000000000{0000000000{000
00000{00000000{00000000{00000000{0000002171D0000000000{0000000032I0000000000{000
00000{00000000{00000000{00000000{0000003059B0000000000{0000000000{0000000000{000
00000{00000000{00000000B00000000{0000000970{0000000000{0000000000{0000000000{000
00000{00000000{00000000{00000000{0000000200D0000000000{0000000000{0000000000{000
00000{00000000{00000000{00000000{0000001560{0000000000{0000000000{0000000000{000
00000{00000000{00000001{00000000{0000000640C0000000000{0000000000{0000000000{000
00000{00000000{00000000{00000000{0000004892D0000000000{0000000000{0000000000{000
00000{00000000{00000000{00000000{0000000198{0000000000{0000000000{0000000000{000
00000{00000000{00000000{00000000{0000000179{0000000000{0000000000{0000000000{000
00000{00000000{00000000{00000000{0000001041F0000000000{0000000000{0000000000{000
----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+----3
********************************* Top of Data **********************************
000000{0000000000{0000000000{0000000000{0000000000{0000000000{0000000000{201812
000000{0000000000{0000000000{0000000000{0000000000{0000000000{0000000000{201812
000000{0000000000{0000000000{0000000000{0000000000{0000000000{0000000000{201812
000000{0000000000{0000000000{0000000000{0000000000{0000000000{0000000000{201812
000000{0000000000{0000000000{0000000000{0000000000{0000000000{0000000000{201812
000000{0000000000{0000000000{0000000000{0000000000{0000000000{0000000000{201812
000000{0000000000{0000000000{0000000000{0000000016F0000000000{0000000000{201812
000000{0000000000{0000000000{0000000000{0000000000{0000000000{0000000000{201812
000000{0000000000{0000000000{0000000000{0000000000{0000000000{0000000000{201812
000000{0000000000{0000000000{0000000000{0000000000{0000000000{0000000000{201812
000000{0000000000{0000000000{0000000000{0000000000{0000000000{0000000000{201812
000000{0000000000{0000000000{0000000000{0000000000{0000000000{0000000000{201812
000000{0000000000{0000000000{0000000000{0000000097{0000000000{0000000000{201812
000000{0000000000{0000000000{0000000000{0000000000{0000000000{0000000000{201812
000000{0000000000{0000000000{0000000000{0000000000{0000000000{0000000000{201812
000000{0000000000{0000000000{0000000000{0000000337{0000000000{0000000000{201812
000000{0000000000{0000000000{0000000000{0000000000{0000000000{0000000000{201812 |
Sum Code:
Code: |
//SORTOUT DD DSN=PAGAT98.TEST.SRT.AP011729.PREVCST.T1,
// DISP=(NEW,CATLG,CATLG),
// DCB=(LRECL=80,RECFM=FB),
// SPACE=(100,(247,24),RLSE),AVGREC=K
//*OUTCUR DD DSN=BPCDA24.TEST.SAS.AP011729.CURRCST.T1,
//* DISP=(NEW,CATLG,CATLG),
//* DCB=(LRECL=80,RECFM=FB),
//* SPACE=(100,(247,24),RLSE),AVGREC=K
//*PINVBAL DD DSN=BPCDA24.TEST.SAS.NEW.INV.BALANCE.PREV,
//* DISP=SHR
//SORTIN DD DSN=BPCDA24.TEST.SAS.NEW.INV.BALANCE.PREV,
// DISP=SHR
//*CINVBAL DD DSN=BPCDA24.TEST.SAS.NEW.INV.BALANCE.CURR,
//* DISP=SHR
//SYSUDUMP DD SYSOUT=*
//*SYSIN DD DSN=BPCDA24.TEST.SAS(APS11730),
//* DISP=SHR
//*
INREC FIELDS=(33,81,114,110)
SORT FIELDS=(14,5,CH,A,6,8,CH,A,19,5,CH,A)
SUM FIELDS=(33,9,42,9,51,9,60,9,69,9,78,9,87,9,96,9,105,9),
* 114,11,125,11,136,11,147,11,158,11,169,11,
* 180,11,191,11,202,11,213,11),
FORMAT=ZD
OUTFIL OUTREC=(2:14,5, PARTPREF
7:1X, FILLER
8:6,8, PARTBASE
16:1X, FILLER
17:19,5, PARTSUFF
22:2X, FILLER
24:24,3, MPL
27:5X, FILLER
32:32,12, TOTQTY
44:2X, FILLER
46:46,15, TOTCST
61:1X, FILLER
62:62,15, GTOTCST
77:4X) FILLER |
Here is my desired output:
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
3 ONN 00000000000B 00000000000000H 00000000000000H
4 ONN 00000005797D 00000000034784D 00000000034785B
26 ONN 00000001297D 00000000005189F 00000000039974H
29 ONN 00000002799H 00000000019598F 00000000059573D
43 ONN 00000002151B 00000000027965F 00000000087539{
74 ONN 00000001062A 00000000011683A 00000000099222A
84 ONN 00000000175G 00000000001932G 00000000101154H
91 ONN 00000001140B 00000000004560H 00000000105715F
119 ONN 00000002064C 00000000014450A 00000000120165G
122 ONN 00000000000D 00000000000004H 00000000120170E
123 ONN 00000000626G 00000000007520D 00000000127690I
125 ONN 00000002064H 00000000016518D 00000000144209C
132 ONN 00000000040{ 00000000000440{ 00000000144649C
143 ONN 00000000306G 00000000003987A 00000000148636D
146 ONN 00000000000E 00000000000008{ 00000000148644D
206 ONN 00000001072{ 00000000008576{ 00000000157220D
250 ONN 00000000011I 00000000002570D 00000000159790H
301 ONN 00000000176I 00000000003184B 00000000162975{
400 ONN 00000012881A 00000000064405E 00000000227380E
401 ONN 00000000000D 00000000000001F 00000000227382A
402 ONN 00000000872A 00000000005232F 00000000232614G
1344 ONN 00000003420{ 00000000003420{ 00000000236034G
1344 B ONN 00000000085{ 00000000002890{ 00000000238924G
1344 E ONN 00000007433D 00000000074334{ 00000000313258G |
Is this even possible in one sort? What would be the best way to do this? I cannot find anywhere in the manual where multiple groups of fields are summed and output. Thanks! |
|