MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Control break totals using SYNCSORT

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
satya_mn_99
Beginner


Joined: 26 Sep 2005
Posts: 17
Topics: 5

PostPosted: Tue Feb 14, 2006 3:05 pm    Post subject: Control break totals using SYNCSORT Reply with quote

Hi I have the data in the following format, using SORT is it possible to get the required o/p?

Code:
Platform1   Market-A   2005-01-01
Platform1   Market-A   2005-01-01
Platform1   Market-A   2005-01-01
Platform1   Market-A   2005-01-01
Platform1   Market-A   2005-02-01
Platform1   Market-A   2005-02-01
Platform1   Market-A   2005-02-01
Platform1   Market-A   2005-02-01
Platform1   Market-A   2005-05-01
Platform1   Market-A   2005-05-01
Platform1   Market-B   2005-01-01
Platform1   Market-B   2005-02-01
Platform1   Market-B   2005-02-01
Platform1   Market-C   2005-01-01
Platform2   Market-A   2005-01-01
Platform2   Market-A   2005-01-01
Platform2   Market-A   2005-01-01
Platform2   Market-A   2005-01-01
Platform2   Market-X   2005-11-01
Platform2   Market-X   2005-11-01
Platform2   Market-X   2005-11-01
Platform2   Market-X   2005-11-01
Platform2   Market-X   2005-11-01

Output should be like this :
============================

Platform1
      Market-A   
            Jan Count : 4
            Feb Count : 4
            May Count : 2
            
      Market-B         
            Jan Count : 1
            Feb Count : 2
      Market-C         
            Jan Count : 1
Platform2            
      Market-A         
            Jan Count : 4
            
      Market-X         
            Nov Count : 4
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Feb 14, 2006 4:14 pm    Post subject: Reply with quote

Try this

Code:
 
//STEP0100 EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                           
PLATFORM1   MARKET-A   2005-01-01                         
PLATFORM1   MARKET-A   2005-01-01                         
PLATFORM1   MARKET-A   2005-01-01                         
PLATFORM1   MARKET-A   2005-01-01                         
PLATFORM1   MARKET-A   2005-02-01                         
PLATFORM1   MARKET-A   2005-02-01                         
PLATFORM1   MARKET-A   2005-02-01                         
PLATFORM1   MARKET-A   2005-02-01                         
PLATFORM1   MARKET-A   2005-05-01                         
PLATFORM1   MARKET-A   2005-05-01                         
PLATFORM1   MARKET-B   2005-01-01                         
PLATFORM1   MARKET-B   2005-02-01                         
PLATFORM1   MARKET-B   2005-02-01                         
PLATFORM1   MARKET-C   2005-01-01                         
PLATFORM2   MARKET-A   2005-01-01                         
PLATFORM2   MARKET-A   2005-01-01                         
PLATFORM2   MARKET-A   2005-01-01                         
PLATFORM2   MARKET-A   2005-01-01                         
PLATFORM2   MARKET-X   2005-11-01                         
PLATFORM2   MARKET-X   2005-11-01                         
PLATFORM2   MARKET-X   2005-11-01                         
PLATFORM2   MARKET-X   2005-11-01                         
PLATFORM2   MARKET-X   2005-11-01                         
//SORTOUT  DD DSN=&T1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)
//SYSIN    DD *                                               
 SORT FIELDS=(01,10,CH,A,                                     
              13,08,CH,A)                                     
 OUTREC FIELDS=(1,20,                                         
                21:29,2,CHANGE=(12,C'01',C'100000000000',     
                                  C'02',C'010000000000',       
                                  C'03',C'001000000000',       
                                  C'04',C'000100000000',       
                                  C'05',C'000010000000',       
                                  C'06',C'000001000000',       
                                  C'07',C'000000100000',       
                                  C'08',C'000000010000',       
                                  C'09',C'000000001000',       
                                  C'10',C'000000000100',       
                                  C'11',C'000000000010',       
                                  C'12',C'000000000001'),     
                                  80:X)                       
 OUTFIL REMOVECC,NODETAIL,                                     
 SECTIONS=(01,20,SKIP=P,                                       
 TRAILER3=(2:01,10,/,                                         
          6:13,08,/,                                           
          10:C'JAN COUNT : ',TOTAL=(21,1,ZD,EDIT=(IIIIIIIT)),/,
          10:C'FEB COUNT : ',TOTAL=(22,1,ZD,EDIT=(IIIIIIIT)),/,
          10:C'MAR COUNT : ',TOTAL=(23,1,ZD,EDIT=(IIIIIIIT)),/,
          10:C'APR COUNT : ',TOTAL=(24,1,ZD,EDIT=(IIIIIIIT)),/,
          10:C'MAY COUNT : ',TOTAL=(25,1,ZD,EDIT=(IIIIIIIT)),/,
          10:C'JUN COUNT : ',TOTAL=(26,1,ZD,EDIT=(IIIIIIIT)),/,
          10:C'JUL COUNT : ',TOTAL=(27,1,ZD,EDIT=(IIIIIIIT)),/,
          10:C'AUG COUNT : ',TOTAL=(28,1,ZD,EDIT=(IIIIIIIT)),/,
          10:C'SEP COUNT : ',TOTAL=(29,1,ZD,EDIT=(IIIIIIIT)),/,
          10:C'OCT COUNT : ',TOTAL=(30,1,ZD,EDIT=(IIIIIIIT)),/,
          10:C'NOV COUNT : ',TOTAL=(31,1,ZD,EDIT=(IIIIIIIT)),/,
          10:C'DEC COUNT : ',TOTAL=(32,1,ZD,EDIT=(IIIIIIIT)),/,
          80:X))                                               
/*                                                             
//STEP0200 EXEC PGM=SORT             
//SYSOUT   DD SYSOUT=*               
//SORTIN   DD DSN=&T1,DISP=OLD       
//SORTOUT  DD SYSOUT=*               
//SYSIN    DD *                       
  SORT FIELDS=COPY                   
  OMIT COND=(22,08,CH,EQ,C'       0')
/*                                   

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
satya_mn_99
Beginner


Joined: 26 Sep 2005
Posts: 17
Topics: 5

PostPosted: Wed Feb 15, 2006 4:54 pm    Post subject: Reply with quote

Hi Kolusu,

this is really wonderful solution. But we have the final Data like this and there is a small change in output.


Code:

The Data finally looks like this :

PLATFORM -C 40906      2006-01-25
PLATFORM -C 40906      2006-01-25
PLATFORM -C 40906      2006-01-25
PLATFORM -C 40906      2006-01-26
PLATFORM -C 40906      2006-01-26
PLATFORM -C 40906      2006-01-26
PLATFORM -C 40906      2006-01-26
PLATFORM -C 40906      2006-01-26
PLATFORM -C 40906      2006-01-26
PLATFORM -C 40906      2006-01-26
PLATFORM -C 40906      2006-02-02
PLATFORM -C 40906      2006-02-03
PLATFORM -C 40906      2006-02-06
PLATFORM -C 40906      2006-02-06
PLATFORM -C 40906      2006-02-07
PLATFORM -C 40906      2006-02-08
PLATFORM -C 40906      2006-02-13
PLATFORM -C 40906      2006-02-13
PLATFORM -C 40906      2006-02-13
PLATFORM -C 40990      2006-01-10
PLATFORM -C 40992      2005-11-03
PLATFORM -C 40992      2005-11-03
PLATFORM -C 40992      2005-11-03
PLATFORM -C 40992      2005-11-03
PLATFORM -C 40992      2005-11-03
PLATFORM -C 40992      2005-11-03
PLATFORM -C 40992      2005-11-03
PLATFORM -C 40992      2005-11-03
PLATFORM -C 40992      2005-11-03


The out put should be now :
It should also need Year infront of the month.
If it is 2005 then 2005 should come.
Please help us on this .....


Code:

                           
PLATFORM -C                 
    40906                   
        2006'JAN COUNT :        0
        2006' FEB COUNT :        0
       
Back to top
View user's profile Send private message
satya_mn_99
Beginner


Joined: 26 Sep 2005
Posts: 17
Topics: 5

PostPosted: Thu Feb 16, 2006 9:28 am    Post subject: Reply with quote

Hi Kolusu,

Could you please help on this.


Thanks in advance.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Feb 16, 2006 9:49 am    Post subject: Reply with quote

Quote:

Hi Kolusu,

Could you please help on this.


satya_mn_99,

Please try to define your requirements upfront rather than changing them. Remember that we here work for someone else and I cannot be spending my time working on solutions every time you change the requirement. I already mentioned once about you being clear on requirements.

Try these control cards. I haven't tested them

Step0100 sysin cards:

Code:

//SYSIN    DD *                                                 
 SORT FIELDS=(01,10,CH,A,                                       
              13,08,CH,A)                                       
 OUTREC FIELDS=(01,20,                                           
                24,04,                                           
                25:29,2,CHANGE=(12,C'01',C'100000000000',       
                                   C'02',C'010000000000',       
                                   C'03',C'001000000000',       
                                   C'04',C'000100000000',       
                                   C'05',C'000010000000',       
                                   C'06',C'000001000000',       
                                   C'07',C'000000100000',       
                                   C'08',C'000000010000',       
                                   C'09',C'000000001000',       
                                   C'10',C'000000000100',       
                                   C'11',C'000000000010',       
                                   C'12',C'000000000001'),       
                                   80:X)                         
 OUTFIL REMOVECC,NODETAIL,                                       
 SECTIONS=(01,24,SKIP=P,                                         
 TRAILER3=(2:01,12,/,                                           
          6:13,08,/,                                             
  10:21,4,X,15:C'JAN COUNT : ',TOTAL=(25,1,ZD,EDIT=(IIIIIIIT)),/,
  10:21,4,X,15:C'FEB COUNT : ',TOTAL=(26,1,ZD,EDIT=(IIIIIIIT)),/,
  10:21,4,X,15:C'MAR COUNT : ',TOTAL=(27,1,ZD,EDIT=(IIIIIIIT)),/,
  10:21,4,X,15:C'APR COUNT : ',TOTAL=(28,1,ZD,EDIT=(IIIIIIIT)),/,
  10:21,4,X,15:C'MAY COUNT : ',TOTAL=(29,1,ZD,EDIT=(IIIIIIIT)),/,
  10:21,4,X,15:C'JUN COUNT : ',TOTAL=(30,1,ZD,EDIT=(IIIIIIIT)),/,
  10:21,4,X,15:C'JUL COUNT : ',TOTAL=(31,1,ZD,EDIT=(IIIIIIIT)),/,
  10:21,4,X,15:C'AUG COUNT : ',TOTAL=(32,1,ZD,EDIT=(IIIIIIIT)),/,
  10:21,4,X,15:C'SEP COUNT : ',TOTAL=(33,1,ZD,EDIT=(IIIIIIIT)),/,
  10:21,4,X,15:C'OCT COUNT : ',TOTAL=(34,1,ZD,EDIT=(IIIIIIIT)),/,
  10:21,4,X,15:C'NOV COUNT : ',TOTAL=(35,1,ZD,EDIT=(IIIIIIIT)),/,
  10:21,4,X,15:C'DEC COUNT : ',TOTAL=(36,1,ZD,EDIT=(IIIIIIIT)),/,
          80:X))                                                 
/*                                                               


Step0200 sysin cards:

Code:

//SYSIN    DD *                       
  SORT FIELDS=COPY                   
  OMIT COND=(27,08,CH,EQ,C'       0')
/*                                   


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group