How to get roll up count?



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

How to get roll up count?

Postby pjagathis » Fri Feb 24, 2012 11:44 am

Hi,

I have to get the rollup count in the output file

Input File:

10|AAAAAA    |12345|000002
10|AAAAAA    |12345|000002
10|AAAAAA    |12345|000003
11|BBBBBB    |67890|000003
11|BBBBBB    |67890|000003
11|BBBBBB    |67890|000003


The records are rolled on 4 th field based on first three fields.. So after rollup based on above input only 2 records will come to output.

Code Used to rollup alone

//SYSIN    DD *           
**                         
  SORT FIELDS=(01,02,CH,A,
               03,10,CH,A,
               15,05,CH,A)
**                         
   SUM FIELDS=(21,06,ZD)   
**                         
/*                         


Output File:


The last field should have the number of records rolled into single record. How can we get the count in output file?

10|AAAAAA    |12345|000007|3|
11|BBBBBB    |67890|000006|2|


Please help me to get the last field in the output file(ie, How many number of records rolled into a single record..!
Thanks and Regards,
Jagathis P
pjagathis
 
Posts: 67
Joined: Wed May 04, 2011 5:04 pm
Location: Chennai
Has thanked: 0 time
Been thanked: 0 time

Re: How to get roll up count?

Postby BillyBoyo » Fri Feb 24, 2012 2:04 pm

Are you saying you want the SUM plus the count of records which make up that sum? Can you check your output, and correct or better explain please.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: How to get roll up count?

Postby enrico-sorichetti » Fri Feb 24, 2012 2:10 pm

here is something to start with

the jcl
 000004 //ICE     EXEC PGM=SORT                                                 
 000005 //SYSOUT    DD SYSOUT=*                                                 
 000006 //SYSPRINT  DD SYSOUT=*                                                 
 000007 //SORTIN    DD *                                                       
 000008 1239      0010                                                         
 000009 1239      0020                                                         
 000010 1239      0030                                                         
 000011 1239      0040                                                         
 000012 1232      0010                                                         
 000013 1232      0020                                                         
 000014 1232      0030                                                         
 000015 1231      0010                                                         
 000016 1231      0020                                                         
 000017 1231      0030                                                         
 000018 1231      0040                                                         
 000019 1238      0010                                                         
 000020 1238      0020                                                         
 000021 1238      0030                                                         
 000022 1237      0010                                                         
 000023 1237      0020                                                         
 000024 1236      0010                                                         
 000025 1235      0010                                                         
 000026 //SORTOUT   DD SYSOUT=*                                                 
 000027 //SYSIN     DD *                                                       
 000028   SORT  FIELDS(01,4,CH,A)                                               
 000029   INREC OVERLAY=(21:C'0001')                                           
 000030   SUM   FIELDS(11,4,ZD,21,4,ZD)                                         
 000031 //                                                                     

the result
********************************* TOP OF DATA **********************************
1231      0100      0004                                                       
1232      0060      0003                                                       
1235      0010      0001                                                       
1236      0010      0001                                                       
1237      0030      0002                                                       
1238      0060      0003                                                       
1239      0100      0004                                                       
******************************** BOTTOM OF DATA ********************************
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: How to get roll up count?

Postby pjagathis » Fri Feb 24, 2012 5:04 pm

Hi enrico-sorichetti,

Thanks this was i expected.. Thanks.

Hi BillyBoyo,

I think you are clear now.
Thanks and Regards,
Jagathis P
pjagathis
 
Posts: 67
Joined: Wed May 04, 2011 5:04 pm
Location: Chennai
Has thanked: 0 time
Been thanked: 0 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post