Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Remove duplicate record by using two type of flag

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Remove duplicate record by using two type of flag
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 Moderator


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

PostPosted: Thu Nov 13, 2008 11:21 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts query to fetch record which has only ... maxsubrat DB2 2 Mon Dec 11, 2017 5:03 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts Squeeze record left so that zeroes ar... Vignesh Sid SYNCSORT 5 Fri Nov 10, 2017 1:40 pm
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us