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

Remove duplicate record by using two type of flag


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bbharathiraj
Warnings : 1

New User


Joined: 26 Oct 2006
Posts: 50
Location: Chennai

PostPosted: Thu Nov 13, 2008 9:59 pm
Reply with quote

Hi Everybody,

Good Day!
I have 80 byte input file (FB) like below.

Code:
11122233333333333333333XQQ444444444
11122233333333333333333AQQ444444444
11122233333333333333333XQQ555555555
11122233333333333333333NQQ555555555
11122233333333333333333XQQ666666666
11122233333333333333333RQQ666666666
11122233333333333333333XQQ777777777



Flag: X(1) Position: 24
Quiz Number: x(11) pos: 25 to 35

I need to exclude the records only if the two records having the same Quiz number with the flag X and A.

If the two records having the same Quiz number with flags other than X and A combination, then those records should be written into output file.

If the input file having only one Quiz number (with out duplicate and with any flag) then it should not be eliminated.

So the output file should be like below

Code:

11122233333333333333333]XQQ555555555
11122233333333333333333NQQ555555555
11122233333333333333333XQQ666666666
11122233333333333333333RQQ666666666
11122233333333333333333XQQ777777777


Appreciate if some one provide me the solution for this.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Nov 13, 2008 11:21 pm
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for. As shown in your example, I assumed that the 'X' record is always the first record of the pair and that the records are already in order by the Quiz number.

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD *
11122233333333333333333XQQ444444444
11122233333333333333333AQQ444444444
11122233333333333333333XQQ555555555
11122233333333333333333NQQ555555555
11122233333333333333333XQQ666666666
11122233333333333333333RQQ666666666
11122233333333333333333XQQ777777777
/*
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(25,11,CH) ON(81,1,CH) NODUPS -
  USING(CTL1)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=INIT,
    OVERLAY=(81:24,1,82:SEQNUM,1,ZD,RESTART=(25,11))),
  IFTHEN=(WHEN=(24,1,CH,EQ,C'X',AND,82,1,CH,EQ,C'1'),
    OVERLAY=(81:C'1')),
  IFTHEN=(WHEN=(24,1,CH,EQ,C'A',AND,82,1,CH,EQ,C'2'),
    OVERLAY=(81:C'1'))
  OUTFIL FNAMES=OUT,BUILD=(1,80)
/*
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Duplicate transid's declared using CEDA CICS 3
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top