Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am
No new posts Ccompar BLOB (images of type jpg) on ... nihad DB2 0 Sun Feb 05, 2017 3:13 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us