Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Multiple Sums in one File

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
Rick Ryan

New User


Joined: 29 Apr 2020
Posts: 14
Location: USA

PostPosted: Wed Jul 29, 2020 1:30 am    Post subject: Multiple Sums in one File
Reply with quote

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!
Back to top
View user's profile Send private message

Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2484
Location: NY,USA

PostPosted: Wed Jul 29, 2020 2:26 am    Post subject:
Reply with quote

http://ibmmainframes.com/about50456.html
http://ibmmainframes.com/about64515.html
http://www.ibmmainframeforum.com/dfsort-icetool-icegener/topic11195.html

There are many more links if you find it on this forum.
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 857
Location: Maryland

PostPosted: Thu Jul 30, 2020 1:13 am    Post subject:
Reply with quote

Why not to try running your code, and find out: what is wrong, or right???
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 -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Hex Value - vb file replace old date ... premnath DFSORT/ICETOOL 10 Sat Oct 17, 2020 3:15 am
No new posts Related to using a file in comparison Kumar Sandeep JCL & VSAM 4 Fri Oct 16, 2020 5:30 pm
No new posts Creating a single-record file with CO... Joerg.Findeisen DFSORT/ICETOOL 8 Tue Oct 06, 2020 8:19 pm
No new posts Altering output file attributes f8ful All Other Mainframe Topics 5 Tue Oct 06, 2020 4:07 pm
No new posts Read 4MB message and split into multi... myselfsk15 COBOL Programming 9 Fri Sep 25, 2020 7:24 am

Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us