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 Setting Font Type for XMIT satish.ms10 All Other Mainframe Topics 3 Fri Sep 15, 2017 10:01 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm

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