DFSORT Reporting Issue :Detail Line Customization

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
User avatar
Collona
Member
Posts: 4
Joined: Thu Oct 25, 2007 7:47 pm

DFSORT Reporting Issue :Detail Line Customization

Post by Collona » Fri Oct 26, 2007 1:34 pm

Currently, using DFSORT, I am printing a Report.
Input File length = 55

Code: Select all

                  Starting Length Type    Heading
                  Position
Org                   1     2     A
grp           3     3     A      
filler1               6     2     A
ENBR            8     8     A      
NAME                 16     22    A      
date          38     8     A
filler2              46     2     A
Centre          48     5     A      
filler3              53     3     A
**************************************************
The SORT code using DFSORT is as follows:

Code: Select all

*********** Top of Data ***************
 SORT FIELDS=(3,3,CH,A,48,5,CH,A)
 OUTFIL FILES=1,
   OUTREC=(12:3,3,10X,25:48,5,10X,40:8,8,7X,55:16,22,3X,80:38,8,
          132:X),
   SECTIONS=(3,3,SKIP=0L,
   HEADER3=(50:'DISCOUNT CARD AUDIT REPORT',24X,&DATE=(DMY/),13X,
     'PAGE ',&PAGE,
     /,10:'PAYROLL',26:'COST',40:'EMPLOYEE',
      81:'EXPIRY',/,11:'GROUP',25:'CENTRE',41:'NUMBER',64:'NAME',
     82:'DATE'))
********** Bottom of Data *************
I want it to be printed using DFSORT
Can it be done?
Last edited by Collona on Tue Oct 30, 2007 2:17 pm, edited 1 time in total.
Life's biggest failures happened only because people left just before realizing that they were so close to success.

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Sat Oct 27, 2007 1:40 am

You can do that by changing your DFSORT control statements to the following:

Code: Select all

  SORT FIELDS=(3,3,CH,A,48,5,CH,A)                                   
  OUTFIL FILES=1,                                                    
   IFOUTLEN=132,                                                     
   IFTHEN=(WHEN=INIT,                                                
     BUILD=(12:3,3,25:48,5,40:8,8,55:16,22,80:38,8,                  
        133:SEQNUM,8,ZD,RESTART=(3,3))),                             
   IFTHEN=(WHEN=(133,8,ZD,GT,+1),OVERLAY=(12:3X)),                   
   SECTIONS=(3,3,SKIP=0L,                                            
   HEADER3=(50:'DISCOUNT CARD AUDIT REPORT',24X,&DATE=(DMY/),13X,    
     'PAGE ',&PAGE,                                                  
     /,10:'PAYROLL',26:'COST',40:'EMPLOYEE',                         
      81:'EXPIRY',/,11:'GROUP',25:'CENTRE',41:'NUMBER',64:'NAME',    
     82:'DATE'))                                                     
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

User avatar
Collona
Member
Posts: 4
Joined: Thu Oct 25, 2007 7:47 pm

Post by Collona » Mon Oct 29, 2007 2:33 pm

Thanks Frank,

This is working fine.
Actually,I had tried using SEQNUM but did not know of how to use RESTART.
Thanks again.

I had another query on the same Report.
The Page Numbers are changing only when 60 line are over and not whenever the Header is being printed.
My requirement is to incrment the page number whenever Header is printed.
Header should be printed whenever Payroll Group changes or Number of lines in Report exceed 60.

I tried using Trailer2 withsame code as Header outside the section and Header3 inside section but its not working.
Can you crack this as well?
Life's biggest failures happened only because people left just before realizing that they were so close to success.

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Mon Oct 29, 2007 8:08 pm

Please show me an example of your input records and what you want for output, including the page numbers you want.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

User avatar
Collona
Member
Posts: 4
Joined: Thu Oct 25, 2007 7:47 pm

Post by Collona » Mon Oct 29, 2007 9:05 pm

My requirement is to incrment the page number whenever Header is printed.
Header should be printed whenever:
1. Payroll Group changes or
2.Number of entries inside a particular Payroll Group exceeds 20.

Note that in Payroll Grp 'PAY', the header was printed again when Number of entries exceeded 20 in the grp 'PAY'.
Also note that for each new payroll grp, the page number is incremented in the Header.

Also the Page is being printed in the left side in the above Code. It is actually in the right side but is being printed in the left here as margin of this Site-page is not big enough.
Last edited by Collona on Tue Oct 30, 2007 2:11 pm, edited 1 time in total.
Life's biggest failures happened only because people left just before realizing that they were so close to success.

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Mon Oct 29, 2007 9:36 pm

You can use HEADER2 and SECTIONS with SKIP=P to get that. These DFSORT control statements should give you what you want:

Code: Select all

  SORT FIELDS=(3,3,CH,A,48,5,CH,A)
  OUTFIL FILES=1,
   IFOUTLEN=132,
   IFTHEN=(WHEN=INIT,
     BUILD=(12:3,3,25:48,5,40:8,8,55:16,22,80:38,8,
        133:SEQNUM,8,ZD,RESTART=(3,3))),
   IFTHEN=(WHEN=(133,8,ZD,GT,+1),OVERLAY=(12:3X)),
   HEADER2=(50:'DISCOUNT CARD AUDIT REPORT',24X,&DATE=(DMY/),13X,
     'PAGE ',&PAGE,
     /,10:'PAYROLL',26:'COST',40:'EMPLOYEE',
      81:'EXPIRY',/,11:'GROUP',25:'CENTRE',41:'NUMBER',64:'NAME',
     82:'DATE'),
   SECTIONS=(3,3,SKIP=P)
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

User avatar
Collona
Member
Posts: 4
Joined: Thu Oct 25, 2007 7:47 pm

Post by Collona » Tue Oct 30, 2007 1:33 pm

Thanks Frank,

This is working fine. :lol:

I guess I could have used DFSORT Reporting Features in a lot of Projects which I coded using COBOL... :? ..

But, going forward...DFSORT is my best bet for Reports..
Life's biggest failures happened only because people left just before realizing that they were so close to success.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others