Reports using SORT



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Reports using SORT

Postby jawaharsmg » Fri Apr 23, 2010 12:32 am

Hi,

I am writing a sort to create two reports which read different data files (all having same structure - so the sort outrec positions are same) and creates different reports . The only difference on the sort report outrec card will be the report header.

I will end up creating 2 members which are identically the same except for the header.

Was looking out for suggestion if we have any overrides to change header from sort JCL and keep reusing the same sort card.

thanks
Jawahar
jawaharsmg
 
Posts: 16
Joined: Tue Feb 16, 2010 8:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Reports using SORT

Postby skolusu » Fri Apr 23, 2010 12:52 am

show us a sample of the reports you are creating. You can create multiple reports in the same job with different headers
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Reports using SORT

Postby jawaharsmg » Fri Apr 23, 2010 1:52 am

//S001   EXEC PGM=SORT                                           
//SORTIN   DD DISP=SHR,DSN=XYZ
//SRT1OUT  DD DSN=ABC1,         
//            DISP=(,CATLG,DELETE),                                   
//            UNIT=SYSDA,SPACE=(CYL,(10,10),RLSE),                   
//            DCB=(RECFM=FBA,LRECL=45,BLKSIZE=0)                     
//SRT1CNTL DD *
SORT FIELDS=COPY                                       
INCLUDE COND=(1,3,CH,EQ,C'ID1 ') <<<<<<This condition
OUTFIL HEADER1=(1:'REPORT DT:',                         
               12:&DATE=(MD4/),                         
               45:'header title',/,     
                1:'REPORT ID: ',                       
               12:'123456',/,                         
      45:'XXXXXXXXXXX - ID1  ',2/, <<<<<<This heading
      1:'~col 1',13:'~',                         
     14:'col 2',25:'~',                           
     26:'col 3',39:'~',                         
     40:'col 4',54:'~'),
 TRAILER1=('~RECORDS WRITTEN : ',COUNT=(M10,LENGTH=8),//,
      1:'~--------------------------------------------',
     46:'---------------------------------------------',
     91:'-------------------'),                         
        LINES=250                                       
 OUTREC FIELDS=(C'~',1,08,C'~',                   
                09,08,C'~',                       
                17,05,C'~',                       
                22,80,C'~')                       
*                         
//S002   EXEC PGM=SORT                                           
//SORTIN   DD DISP=SHR,DSN=XYZ
//SRT2OUT  DD DSN=ABC2,       
//            DISP=(,CATLG,DELETE),                                   
//            UNIT=SYSDA,SPACE=(CYL,(10,10),RLSE),                   
//            DCB=(RECFM=FBA,LRECL=45,BLKSIZE=0)                     
//SRT2CNTL DD *
SORT FIELDS=COPY                                       
INCLUDE COND=(1,3,CH,EQ,C'ID2') <<<<<<This condition

OUTFIL HEADER1=(1:'REPORT DT:',                         
               12:&DATE=(MD4/),                         
               45:'header title',/,     
                1:'REPORT ID: ',                       
               12:'123456',/,                         
      45:'XXXXXXXXXXX - ID2  ',2/, <<<<<<This heading
      1:'~col 1',13:'~',                         
     14:'col 2',25:'~',                           
     26:'col 3',39:'~',                         
     40:'col 4',54:'~'),
 TRAILER1=('~RECORDS WRITTEN : ',COUNT=(M10,LENGTH=8),//,
      1:'~--------------------------------------------',
     46:'---------------------------------------------',
     91:'-------------------'),                         
        LINES=250                                       
 OUTREC FIELDS=(C'~',1,08,C'~',                   
                09,08,C'~',                       
                17,05,C'~',                       
                22,80,C'~')                                               
//*
jawaharsmg
 
Posts: 16
Joined: Tue Feb 16, 2010 8:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Reports using SORT

Postby skolusu » Fri Apr 23, 2010 4:12 am

jawahar,'

The following 1 step DFSORT jcl will create the 2 reports. You really don't need the DCB properties . Sort will automatically calculate it. Moreover you have coded them wrong. you are creating a 107 byte report , you had 45 as lrecl.

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*   
//SORTIN   DD DISP=SHR,DSN=XYZ
//SRT1OUT  DD DSN=SRT1.REPORT,         
//            DISP=(NEW,CATLG,DELETE),           
//            UNIT=SYSDA,                       
//            UNIT=SYSDA,SPACE=(CYL,(10,10),RLSE)
//*     
//SRT2OUT  DD DSN=SRT2.REPORT,         
//            DISP=(NEW,CATLG,DELETE),           
//            UNIT=SYSDA,                       
//            UNIT=SYSDA,SPACE=(CYL,(10,10),RLSE)
//*     
//SYSIN    DD *                                                       
  INCLUDE COND=(1,3,SS,EQ,C'ID1,ID2')                                 
  SORT FIELDS=COPY                                                     
  OUTREC FIELDS=(C'~',1,8,C'~',9,8,C'~',17,5,C'~',22,80,C'~')         
                                                                       
  OUTFIL FNAMES=SRT1OUT,LINES=250,INCLUDE=(2,3,CH,EQ,C'ID1'),         
  HEADER1=(1:'REPORT DT:',12:&DATE=(MD4/),45:'HEADER TITLE',/,         
           1:'REPORT ID: ',12:'123456',/,45:'XXXXXXXXXXX - ID1  ',2/, 
           1:'~COL 1',13:'~',14:'COL 2',25:'~',                       
           26:'COL 3',39:'~',40:'COL 4',54:'~'),                       
  TRAILER1=('~RECORDS WRITTEN : ',COUNT=(M10,LENGTH=8),//,             
            1:'~',105C'-')                                             
                                                                       
  OUTFIL FNAMES=SRT2OUT,LINES=250,INCLUDE=(2,3,CH,EQ,C'ID2'),         
  HEADER1=(1:'REPORT DT:',12:&DATE=(MD4/),45:'HEADER TITLE',/,         
           1:'REPORT ID: ',12:'123456',/,45:'XXXXXXXXXXX - ID2  ',2/, 
           1:'~COL 1',13:'~',14:'COL 2',25:'~',                       
           26:'COL 3',39:'~',40:'COL 4',54:'~'),                       
  TRAILER1=('~RECORDS WRITTEN : ',COUNT=(M10,LENGTH=8),//,             
            1:'~',105C'-')                                             
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post