Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

DFSORT ICETOOL Question Summing and Totaling

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
nickciancio

New User


Joined: 03 May 2010
Posts: 13
Location: Malvern PA

PostPosted: Mon May 03, 2010 8:14 pm    Post subject: DFSORT ICETOOL Question Summing and Totaling
Reply with quote

My input dsn is a FBA report that contains data that I wish to summarize and produce just a total of the number of occurances and a SUM of the number of lines. My input records look like....


Code:
 CICSRJE1 J026976 G5897    SMSSYHT        105  D  R102
 CICSRJE1 J713840 G7011    SMSSYHT      62125  D  R102
 ARMWP50  J756526 G1       SMSPROD        171  F  R102
 ARMWP50  J756550 G1       SMSPROD        164  F  R102
 PAMWF50  J828641 G1       SMSPROD         18  F  R102
 PAMWF50  J725056 G1       SMSPROD      20802  F  R102
 CICSRJE1 J617658 G3386    SMSSYHT         43  D  R147
 CICSRJE1 J184491 G1384    SMSSYHT         57  D  R165
 CICSRJE1 J323451 G703     SMSSYHT         57  D  R165
 CICSRJE1 J462147 G1095    SMSSYHT         57  D  R165
 CICSRJE1 J594882 G946     SMSSYHT         57  D  R165
 CICSRJE1 J594882 G6592    SMSSYHT         15  D  R165
 CICSRJE1 J594882 G10600   SMSSYHT         12  D  R165
0CICSRJE1 J713840 G6987    SMSSYHT         71  D  R165
 CICSRJE1 J713840 G1698    SMSSYHT       6132  D  R165


Each line displays a sysout and the number of lines and the destination.

Columns 51 for a length of 8 contain the JES2 destid and columns 39 for a length of 9 contain the number of lines of the report.

I would like to generate an output file that breaks by the data in column 51 (destination) and produces a line that summarizes by destination and totals the number of lines by destination.

For example I would like an output file like

Code:
DEST           Tot LINES       Num Rpts
R102              1232345           6
R147                   43           1
R165              1234567           8


Nick
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon May 03, 2010 11:00 pm    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for. I assumed your input records were already sorted by the dest field as shown in your example. (The output totals you show don't correspond to the input amounts, but I ignored that.)

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN DD *
  OPTION COPY
  OUTFIL REMOVECC,NODETAIL,
    HEADER2=('Dest           Tot Lines       Num Rpts'),
    SECTIONS=(51,8,
      TRAILER3=(51,8,17:TOT=(39,9,UFF,M10,LENGTH=9),
          33:COUNT=(M10,LENGTH=5)))
/*
Back to top
View user's profile Send private message
nickciancio

New User


Joined: 03 May 2010
Posts: 13
Location: Malvern PA

PostPosted: Mon May 03, 2010 11:50 pm    Post subject: Reply to: DFSORT ICETOOL Question Summing and Totaling
Reply with quote

Thank you so much for the accurate and quick response. The sample you supplied worked perfectly!


I really need to sit down and spend some time reading the Sort and tool documentation.

With that said, how can I (if it can be done) only print records that exceed a limiting value (for example if the count exceeds 200 or TOT exceeds 100K ) ?

Thanks in advance...

Nick
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue May 04, 2010 1:08 am    Post subject:
Reply with quote

Quote:
how can I only print records that exceed a limiting value (for example if the count exceeds 200 or TOT exceeds 100K ) ?


You can use a DFSORT/ICETOOL job like the following:

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...  input file
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
COPY FROM(T1) TO(OUT) USING(CTL2)
//CTL1CNTL DD *
  OUTFIL FNAMES=T1,REMOVECC,NODETAIL,
    HEADER2=('Dest           Tot Lines       Num Rpts'),
    SECTIONS=(51,8,
      TRAILER3=(51,8,17:TOT=(39,9,UFF,M10,LENGTH=9),
          33:COUNT=(M10,LENGTH=5)))
/*
//CTL2CNTL DD *
  INCLUDE COND=(1,4,CH,EQ,C'Dest',OR,
    33,5,UFF,GT,200,OR,17,9,UFF,GT,100000)
/*
Back to top
View user's profile Send private message
nickciancio

New User


Joined: 03 May 2010
Posts: 13
Location: Malvern PA

PostPosted: Tue May 04, 2010 5:02 pm    Post subject: Reply to: DFSORT ICETOOL Question Summing and Totaling
Reply with quote

Thank You very much!!!

....This has saved me an enormous amount of time and effort, which I plan to use to educate myself on all the neat tricks that this product can perform.

Thank !

Nick
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue May 04, 2010 11:04 pm    Post subject:
Reply with quote

Glad to help.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Asynchronous CICS Processing Question moezbud CICS 0 Mon Mar 06, 2017 6:13 pm
No new posts CICS Question RE: Browse, Readnext an... moezbud CICS 7 Sun Mar 05, 2017 5:45 am
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
No new posts Summing on Mixed Case Literals Roy Ware SYNCSORT 3 Tue Jan 03, 2017 10:18 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us