Remove block of detail record with COND on one row



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

Remove block of detail record with COND on one row

Postby saurabh72516 » Mon Mar 07, 2011 5:34 pm

Hi Frank/Borad Members,
Pls could you provide me an ICETOOL card to suffice the following:
LRECL 72, Format FB

File contains set of 17 rows from 001 to 017 per customer_Id level. Customer_id at 001.. rows 42 to 60.
................
---+----1----+----2----+----3----+----4----+----5----+----6----+----7
03560P00000000            001123456789124Customer_Id_19bytes
03560P00000000            002EMPLOYER_Name
03560P00000000            003Address_Details
03560P00000000            004DEFAULT
06560P00000000            01000000000000012341002000000195019  51  <--Check & remove zeroes
06560P00000000            011Customer_Name
06560P00000000            012Address XXXX
06560P00000000            013 Address XXXX
06560P00000000            014 Address XXXX
06560P00000000            015
06560P00000000            016REFUND
06560P00000000            017Product_Name Case_Id
..................


Requirement is to remove these set of 17 rows whenever the detail record at 010 is succeeded by 000000000000 (12 bytes) , ie, when COND (26,3, CH, EQ'010') and when (29,12,CH,EQ'000000000000') then build a new file excluding these and allowing all other sets of 17 rows in the new file.

Regards,
Saurabh
saurabh72516
 
Posts: 4
Joined: Mon Mar 07, 2011 4:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Remove block of detail record with COND on one row

Postby saurabh72516 » Mon Mar 07, 2011 7:21 pm

Pls read the block of data as :
    ................
    ---+----1----+----2----+----3----+----4----+----5----+----6----+----7
    06560P00000000            01000000000000012341002000000195019  51  <--Check & remove zeroes
    06560P00000000            011Customer_Name
    06560P00000000            012Address XXXX
    06560P00000000            013 Address XXXX
    06560P00000000            014 Address XXXX
    06560P00000000            015
    06560P00000000            016REFUND
    06560P00000000            017Product_Name Case_Id
    ..................

And the unique field per block is Customer_Name
saurabh72516
 
Posts: 4
Joined: Mon Mar 07, 2011 4:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Remove block of detail record with COND on one row

Postby Frank Yaeger » Tue Mar 08, 2011 12:08 am

Your description and example are not very clear, but if I understand what you want, then the following DFSORT job should do it:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (FB/72)
//SORTOUT DD DSN=...  output file (FB/72)
//SYSIN DD *
  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,
    BEGIN=(26,3,CH,EQ,C'010',AND,29,12,CH,EQ,C'000000000000'),
    END=(26,3,CH,EQ,C'017'),
    PUSH=(73:ID=1))
  OUTFIL OMIT=(73,1,CH,NE,C' '),BUILD=(1,72)
/*
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: Remove block of detail record with COND on one row

Postby saurabh72516 » Tue Mar 08, 2011 5:28 pm

Thanks Frank, the sort card extracts what I intend to.

But, apart from group (26,3,CH,EQ,C'010') to (26,3,CH,EQ,C'017') there two other recurring group which appear two or 3 times in the file, they are

BEGIN=(26,3,CH,EQ,C' '), END=(26,3,CH,EQ,C'004') &
BEGIN=(26,3,CH,EQ,C'001'), END=(26,3,CH,EQ,C'004')

These two groups are required to be INCLUDED in the SORTOUT result. The current sort card excludes them.
saurabh72516
 
Posts: 4
Joined: Mon Mar 07, 2011 4:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Remove block of detail record with COND on one row

Postby saurabh72516 » Tue Mar 08, 2011 5:46 pm

Frank, pls ignore my request. I have used additional IFTHEN clause to achieve my need.
I appreciate your time and help
saurabh72516
 
Posts: 4
Joined: Mon Mar 07, 2011 4:56 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post