Add Header in OUTFIL



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

Add Header in OUTFIL

Postby Kitz » Tue Jun 21, 2011 8:48 pm

Hello there,

OUTFIL REMOVECC,SECTIONS=(1,1,SKIP=L) - This code produces a blank record on every change in first character of the job name(1-8 position is the job name)!

Currently, the report is something like below:
PXXAB001 06/20 20.50.01
PCBAC005 06/21 22.55.11
PARAC012 06/21 23.05.16

UARAB004 06/20 20.20.21
UXXAC006 06/20 21.30.14
UAMAC001 06/21 22.15.06

The job names are for Production, UAT, SIT categorised with a prefrix by P,U,S etc at 1sth position.

Currently, when ever the change in prefix(of 1st position) appears a blank line is displayed. Is is possible to add a header along with it.

The report should appear something like below:
Prod
PXXAB001 06/20 20.50.01
PCBAC005 06/21 22.55.11
PARAC012 06/21 23.05.16

UAT
UARAB004 06/20 20.20.21
UXXAC006 06/20 21.30.14
UAMAC001 06/21 22.15.06

Please help.

Thanks & Regards,
Kitz
Kitz
 
Posts: 47
Joined: Thu Mar 17, 2011 3:46 am
Has thanked: 0 time
Been thanked: 1 time

Re: Add Header in OUTFIL

Postby Frank Yaeger » Tue Jun 21, 2011 9:19 pm

You can use a DFSORT job like the following to do what you asked for:

//S1 EXEC PGM=SORT                                                 
//SYSOUT DD SYSOUT=*                                               
//SORTIN DD *                                                       
PXXAB001  06/20  20.50.01                                           
PCBAC005  06/21  22.55.11                                           
PARAC012  06/21  23.05.16                                           
UARAB004  06/20  20.20.21                                           
UXXAC006  06/20  21.30.14                                           
UAMAC001  06/21  22.15.06                                           
SAMAC001  06/21  22.15.06                                           
SAMAC001  06/21  22.15.06                                           
//SORTOUT DD SYSOUT=*                                               
//SYSIN DD *                                                       
  OPTION COPY                                                       
  INREC IFTHEN=(WHEN=(1,1,CH,EQ,C'P'),OVERLAY=(81:C'Production')), 
        IFTHEN=(WHEN=(1,1,CH,EQ,C'U'),OVERLAY=(81:C'UAT')),         
        IFTHEN=(WHEN=(1,1,CH,EQ,C'S'),OVERLAY=(81:C'SIT'))         
  OUTFIL REMOVECC,                                                 
    BUILD=(1,80),                                                   
    SECTIONS=(1,1,HEADER3=(/,81,10))                               
/*


SORTOUT would have:

********************************* TOP OF DATA **
                                               
Production                                     
PXXAB001  06/20  20.50.01                       
PCBAC005  06/21  22.55.11                       
PARAC012  06/21  23.05.16                       
                                               
UAT                                             
UARAB004  06/20  20.20.21                       
UXXAC006  06/20  21.30.14                       
UAMAC001  06/21  22.15.06                       
                                               
SIT                                             
SAMAC001  06/21  22.15.06                       
SAMAC001  06/21  22.15.06                       
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
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Add Header in OUTFIL

Postby Kitz » Wed Jun 22, 2011 6:08 pm

It worked. Thanks a lot Frank.

Sorry to bother you again. I am asked to re-work on the report now with little more details. First three positions would have around 3 applications under each environment.
Prod - Common
PXX
PZZ

UAT- Common
UXX
UZZ

SIT - COMMON
SXX
SZZ

Prod - Products
PAR
PBR

UAT - Products
UAR
UBR

SIT - Products
SAR
SBR

Based on 1-3 positions I want the header to appear with the application name something like below:

Prod - Common
PXXAB001 06/20 20.50.01
PXXCD001 06/20 15.22.15
PZZDH005 06/20 12.12.03

Prod - Products
PARAC012 06/21 23.05.16
PARBG005 06/21 20.35.41
PBRCBN15 06/21 04.33.46

UAT - Products
UARAB004 06/20 20.20.21
UARAC006 06/20 21.30.14

SIT - COMMON
SXXAC001 06/21 22.15.06
SZZAC001 06/21 22.15.06


I tried to modify your code to include OR in the WHEN condition,
INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'PAR',AND,1,3,CH,EQ,C'PBR'),
OVERLAY=(81:C'PROD - PRODUCTS))
But, the HEADER 'PROD - PRODUCTS' appears in every change of PAR and PBR; but when PAR and PBR are available 'PROD - PRODUCTS' should appear as only as one HEADER.

I then tried with GROUP, I think I cannot use OVERLAY with GROUP and so its giving errors as DUPLICATE or CONFLICTING or MISSING INREC or OUTREC.

Please help.

Thanks & Regards,
Kitz
Kitz
 
Posts: 47
Joined: Thu Mar 17, 2011 3:46 am
Has thanked: 0 time
Been thanked: 1 time

Re: Add Header in OUTFIL

Postby Frank Yaeger » Wed Jun 22, 2011 10:26 pm

WHEN=(1,3,CH,EQ,C'PAR',AND,1,3,CH,EQ,C'PBR')


This says that 1,3 must have PAR AND PBR, which is impossible. You need OR, not AND. However, you can do this more easily with SS.

If I understand correctly what you want to do, you can use DFSORT control statements like this:

  OPTION COPY                                         
  INREC IFTHEN=(WHEN=(1,3,SS,EQ,C'PXX,PZZ'),           
     OVERLAY=(81:C'1',82:C'Prod - Common')),           
   IFTHEN=(WHEN=(1,3,SS,EQ,C'UXX,UZZ'),               
     OVERLAY=(81:C'2',82:C'UAT - Common')),           
   IFTHEN=(WHEN=(1,3,SS,EQ,C'SXX,SZZ'),               
     OVERLAY=(81:C'3',82:C'SIT - Common')),           
   IFTHEN=(WHEN=(1,3,SS,EQ,C'PAR,PBR'),               
     OVERLAY=(81:C'4',82:C'Prod - Products')),         
   IFTHEN=(WHEN=(1,3,SS,EQ,C'UAR,UBR'),               
     OVERLAY=(81:C'5',82:C'UAT - Products')),         
   IFTHEN=(WHEN=(1,3,SS,EQ,C'SAR,SBR'),               
     OVERLAY=(81:C'6',82:C'SIT - Products'))           
  OUTFIL REMOVECC,                                     
    BUILD=(1,80),                                     
    SECTIONS=(81,3,HEADER3=(/,82,15))                 
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
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Add Header in OUTFIL

Postby Kitz » Thu Jun 23, 2011 8:34 pm

Frank,

Fantastic! It worked.Thanks a lot for your help.

Thanks & Regards,
Kitz
Kitz
 
Posts: 47
Joined: Thu Mar 17, 2011 3:46 am
Has thanked: 0 time
Been thanked: 1 time

Re: Add Header in OUTFIL

Postby Kitz » Fri Jul 15, 2011 6:46 pm

Frank,

Sorry to bother you again.

I was using the INREC - OVERLAY option that you have sepecified and it was all working okay.
But, there are some strange house keeping jobs, for instance in Prod it is PXYAB001, PXYCD015 - these XY jobs should appear in 'Prod - Products'. When these jobs run, the report has repeated occurance of Prod - Products and Prod - Common along with its relavent jobs, since they are sorted in Ascending order.

Prod - Products
PARAC012 06/21 23.05.16
PARBG005 06/21 20.35.41
PBRCBN15 06/21 04.33.46

Prod - Common
PXXAB001 06/20 20.50.01

Prod - Products
PXYAB001 07/14 20.21.05
PXYCD011 07/14 03.14.18

Prod - Common
PZZDH005 06/20 12.12.03

Could you please advise if this be grouped together something like below:
Prod - Products
PARAC012 06/21 23.05.16
PARBG005 06/21 20.35.41
PBRCBN15 06/21 04.33.46
PXYAB001 07/14 20.21.05
PXYCD011 07/14 03.14.18

Prod - Common
PXXAB001 06/20 20.50.01
PZZDH005 06/20 12.12.03

Could you please help? Also, please advise what is the significance of SS in WHEN=(1,3,SS,EQ,C'PXX,PZZ')?

Thanks & Regards,
Kitz
Kitz
 
Posts: 47
Joined: Thu Mar 17, 2011 3:46 am
Has thanked: 0 time
Been thanked: 1 time

Re: Add Header in OUTFIL

Postby NicC » Fri Jul 15, 2011 11:04 pm

what is the significance of SS in WHEN=(1,3,SS,EQ,C'PXX,PZZ'

Is it that hard to look at the manual?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Add Header in OUTFIL

Postby Frank Yaeger » Sat Jul 16, 2011 1:28 am

Just add 'PXY' as appropriate and SORT on the id code:

  INREC IFTHEN=(WHEN=(1,3,SS,EQ,C'PXX,PZZ'),             
     OVERLAY=(81:C'1',82:C'Prod - Common')),             
   IFTHEN=(WHEN=(1,3,SS,EQ,C'UXX,UZZ'),                 
     OVERLAY=(81:C'2',82:C'UAT - Common')),             
   IFTHEN=(WHEN=(1,3,SS,EQ,C'SXX,SZZ'),                 
     OVERLAY=(81:C'3',82:C'SIT - Common')),             
   IFTHEN=(WHEN=(1,3,SS,EQ,C'PXY,PAR,PBR'),             
     OVERLAY=(81:C'4',82:C'Prod - Products')),           
   IFTHEN=(WHEN=(1,3,SS,EQ,C'UAR,UBR'),                 
     OVERLAY=(81:C'5',82:C'UAT - Products')),           
   IFTHEN=(WHEN=(1,3,SS,EQ,C'SAR,SBR'),                 
     OVERLAY=(81:C'6',82:C'SIT - Products'))             
   SORT FIELDS=(81,1,CH,A),EQUALS
   OUTFIL REMOVECC,                         
    BUILD=(1,80),                           
    SECTIONS=(81,1,HEADER3=(/,82,15))       


SS is a substring comparison - see the following for details:

http://publibz.boulder.ibm.com/cgi-bin/ ... 0630155256
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
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Add Header in OUTFIL

Postby Kitz » Mon Jul 18, 2011 2:11 pm

Frank,

Thanks.
I tried to sort using SORT FIELDS=(81,1,CH,A),EQUALS, but it did not work. Alternatively, I tried with different sort fields here but it gives the same result; it does not group together.

Please advise?

Thanks & Regards,
Kitz
Kitz
 
Posts: 47
Joined: Thu Mar 17, 2011 3:46 am
Has thanked: 0 time
Been thanked: 1 time

Re: Add Header in OUTFIL

Postby Frank Yaeger » Mon Jul 18, 2011 9:08 pm

If you just added the SORT statement without removing the OPTION COPY statement, that would do a COPY, not a SORT. Remove the OPTION COPY statement (guess I shouldn't have assumed you'd know to do that).

If that's not it, then post your complete JES log.
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
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Next

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post