IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DFSORT - Summing the Reports


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Sun Oct 14, 2012 2:25 am
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
Reply with quote

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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Oct 15, 2012 4:19 am
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
Reply with quote

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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Oct 15, 2012 1:59 pm
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
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 All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts DFSORT Join Keys Controlcard DFSORT/ICETOOL 4
No new posts Date format correction using dfsort DFSORT/ICETOOL 3
No new posts DFSORT GUID DFSORT/ICETOOL 5
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:


Back to Top