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 - Summing the Reports

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

Active User


Joined: 16 Apr 2009
Posts: 151
Location: India

PostPosted: Sat Oct 13, 2012 2:50 pm    Post subject: DFSORT - Summing the Reports
Reply with quote

Hi,
How do I achieve this?

Input
Code:
PARAMETER CARD: 0120120902NN                   
                                               
*----------------------------------------*     
ROW PROCESSED FROM TABLE01 TABLE      :    5598
ROW WRITTEN INTO FILE0001 FILE        :    4673
RELATION NOT FOUND ON TBALE004        :     924
RELATION NOT FOUND ON TABLE02         :      35
RELATION NOT FOUND ON TABLE03         :    1973
ROW DISCARDED ON TBALE004 / TABLE02   :       0
*----------------------------------------*     
                                               
                                               
******************************                 
---> COMMIT                                   
******************************                 
       END       PROGRAM1                     
******************************                 
PARAMETER CARD: 0120120902NN                   
                                               
*----------------------------------------*     
ROW PROCESSED FROM TABLE01 TABLE      :    5597
ROW WRITTEN INTO FILE0001 FILE        :    4672
RELATION NOT FOUND ON TBALE004        :     923
RELATION NOT FOUND ON TABLE02         :      34
RELATION NOT FOUND ON TABLE03         :    1972
ROW DISCARDED ON TBALE004 / TABLE02   :       0
*----------------------------------------*     
                                               
                                               
******************************                 
---> COMMIT                                   
******************************                 
       END       PROGRAM1                     
******************************                 
PARAMETER CARD: 0120120902NN                   
                                               
*----------------------------------------*     
ROW PROCESSED FROM TABLE01 TABLE      :    5596
ROW WRITTEN INTO FILE0001 FILE        :    4671
RELATION NOT FOUND ON TBALE004        :     922
RELATION NOT FOUND ON TABLE02         :      33
RELATION NOT FOUND ON TABLE03         :    1971
ROW DISCARDED ON TBALE004 / TABLE02   :       0
*----------------------------------------*     
                                               
                                               
******************************                 
---> COMMIT                                   
******************************                 
       END       PROGRAM1                     
******************************


Output
Code:
PARAMETER CARD: 0120120902NN                   
                                               
*----------------------------------------*     
ROW PROCESSED FROM TABLE01 TABLE      :   16791
ROW WRITTEN INTO FILE0001 FILE        :   14013
RELATION NOT FOUND ON TBALE004        :    2763
RELATION NOT FOUND ON TABLE02         :      96
RELATION NOT FOUND ON TABLE03         :    5910
ROW DISCARDED ON TBALE004 / TABLE02   :       0
*----------------------------------------*


This SYSIN helps in achieving the results like this.

Code:
//SYSIN     DD *                                             
  OMIT COND=(1,11,CH,EQ,C'---> COMMIT',OR,                   
             1,30,CH,EQ,C'******************************',OR,
             8,18,CH,EQ,C'END       PROGRAM1')               
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(41:41,9,SFF,PD,LENGTH=9, 
                                   81:SEQNUM,4,ZD))         
  SORT FIELDS=(1,40,CH,A)                                   
  SUM FIELDS=(41,9,PD)                                       
  OUTREC FIELDS=(1:1,40,                                     
                 41:41,9,PD,EDIT=(IIIIIIIIT),               
                 50:31X,                                     
                 81:81,4)                                   
/*



Output of above SYSIN
Code:
                                                0
                                                0
*---------------------------------------        0
PARAMETER CARD: 0120120902NN                    0
RELATION NOT FOUND ON TABLE03         :      5910
RELATION NOT FOUND ON TABLE02         :        96
RELATION NOT FOUND ON TBALE004        :      2763
ROW DISCARDED ON TBALE004 / TABLE02   :         0
ROW PROCESSED FROM TABLE01 TABLE      :     16791
ROW WRITTEN INTO FILE0001 FILE        :     14013
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sun Oct 14, 2012 2:25 am    Post subject: Reply to: DFSORT - Summing the Reports
Reply with quote

Hello,

If you cannot be considerate enough to post in the correct part of the forum, we should delete these posts. . .

For whatever reason you post in both parts of the forum . . . icon_sad.gif

d
Back to top
View user's profile Send private message
HameedAli

Active User


Joined: 16 Apr 2009
Posts: 151
Location: India

PostPosted: Sun Oct 14, 2012 11:44 am    Post subject: Reply to: DFSORT - Summing the Reports
Reply with quote

Excuse for that.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Oct 15, 2012 4:19 am    Post subject: Reply to: DFSORT - Summing the Reports
Reply with quote

I'd get rid of everything with blank, asterisk or hyphen in column 1.

Define a GROUP with "PARAMETER CARD" indicating the start, and PUSH a SEQNO to all records in the group.

Sort on that Seqno first, then on the description.

In your OUTFIL, don't print the count for "PARAMETER CARD", but do use the '/' (slash operator) in IFTHEN=(WHEN with BUILD to output such blank lines that you want and your first delimiting line, after your "PARAMETER CARD".

Use "ROW DISCARDED" in IFTHEN=(WHEN with BUILD and '/' to output your 2nd delimiting line.
Back to top
View user's profile Send private message
HameedAli

Active User


Joined: 16 Apr 2009
Posts: 151
Location: India

PostPosted: Mon Oct 15, 2012 12:16 pm    Post subject: Reply to: DFSORT - Summing the Reports
Reply with quote

Thanks for the suggestion.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Oct 15, 2012 1:59 pm    Post subject: Reply to: DFSORT - Summing the Reports
Reply with quote

Since you are producing a report, you could also consider the "reporting functions" on OUTFIL. In addition to the seqno, PUSH the "PARAMETER CARD". Remove the SUM.

On OUTFIL, OMIT the "PARAMETER CARD" (not needed) and use HEADER1 to print the "headings" of the "PARAMETER CARD", blank lines and delimiter line, use SECTIONS to do the totals and TRAILER1 to do your closing delimiter line.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Oct 15, 2012 10:40 pm    Post subject: Reply to: DFSORT - Summing the Reports
Reply with quote

HameedAli,

You can simplify your extract logic using INCLUDE condition instead of OMIT condition. Looking at your data , all you want is to include records that begin with P or an R. Assuming that you just have Unique Parameter card , the following DFSORT JCL will give you the desired results.

Code:

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=* 
//SORTIN   DD DISP=SHR,DSN=Your Input Fb 80 Byte file
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                     
  INCLUDE COND=(1,1,SS,EQ,C'P,R')
  INREC OVERLAY=(81:41,9,UFF,PD,LENGTH=5)
  SORT FIELDS=(1,40,CH,A)
  SUM FIELDS=(81,5,PD)

  OUTFIL IFOUTLEN=80,REMOVECC,TRAILER1=('*',43'-','*'),             
  IFTHEN(WHEN=INIT,BUILD=(1,40,81,5,PD,M10,LENGTH=9,81:SEQNUM,8,ZD)),
  IFTHEN(WHEN=(1,15,CH,EQ,C'PARAMETER CARD:'),                       
  BUILD=(1,40,/,/,C'*',43C'-',C'*'))                                 
//*


The output from the above Sample data is
Code:

PARAMETER CARD: 0120120902NN                     
                                                 
*-------------------------------------------*     
RELATION NOT FOUND ON TABLE02         :       102
RELATION NOT FOUND ON TABLE03         :      5916
RELATION NOT FOUND ON TBALE004        :      2769
ROW DISCARDED ON TBALE004 / TABLE02   :         0
ROW PROCESSED FROM TABLE01 TABLE      :     16791
ROW WRITTEN INTO FILE0001 FILE        :     14016
*-------------------------------------------*     
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 How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts DFSORT sorting only specific records akodakka DFSORT/ICETOOL 4 Thu Aug 04, 2016 11:24 am
No new posts Symbolic Parameters in SYSIN DD state... madishpa DFSORT/ICETOOL 3 Mon Jun 27, 2016 6:23 pm
No new posts Consolidating and summing file contents Kevin Lindsley SYNCSORT 14 Thu Jun 09, 2016 5:24 am


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