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
 

 

Need Help Regarding removing duplicate

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
itjagadesh

New User


Joined: 05 Dec 2006
Posts: 89
Location: chennai

PostPosted: Tue May 06, 2008 5:53 pm    Post subject: Need Help Regarding removing duplicate
Reply with quote

Hi All Consider a scenario below,
Input
1001 B 2008100
1001 O 2007100
1002 O 2008100
1002 B 2008101
1003 B 2008102
1003 B 2008103
1003 B 2008104

Output
1001 B 2008100
1002 B 2008101

Problem: Input contains employee,indicator and timestamp.
When an employee contains both 'B' and 'O' records we need to write only B records into output. If an employee doesn't contains 'O' records then no need write into output (1003 employee doesn't contains O record).
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: Tue May 06, 2008 9:12 pm    Post subject:
Reply with quote

What would you want for output for these input records?

Code:

1004 O 2008102
1004 O 2008103
1004 O 2008104
1005 B 2008102
1005 O 2008103
1005 B 2008104



What is the RECFM and LRECL of your input file?
Back to top
View user's profile Send private message
itjagadesh

New User


Joined: 05 Dec 2006
Posts: 89
Location: chennai

PostPosted: Wed May 07, 2008 11:14 am    Post subject: Reply to: Need Help Regarding removing duplicate
Reply with quote

Hi Frank,

I need the output in following format(only one record inthe output)

1005 B 2008104

ie) 1004 employee doesn't contains B type record. so no need to write into output.
ie)1005 conatins both 'B' and 'O' type record so we need to write into output (with latest time stamp).

Req : Need to write only 'B' type record into output only when employee contains both 'B' and 'O' type record.otherwise no need to write into output
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: Wed May 07, 2008 10:44 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file (FB/80)
//TOOLIN   DD    *
SORT FROM(IN) TO(T1) USING(CTL1)
SORT FROM(T1) USING(CTL2)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=(6,1,CH,EQ,C'B'),OVERLAY=(81:C'0000100000')),
        IFTHEN=(WHEN=(6,1,CH,EQ,C'O'),OVERLAY=(81:C'0000000001'))
  SORT FIELDS=(1,4,CH,A,6,1,CH,A,8,7,CH,D)
/*
//CTL2CNTL DD *
  OPTION EQUALS,ZDPRINT
  SORT FIELDS=(1,4,CH,A)
  SUM FIELDS=(81,5,ZD,86,5,ZD)
  OUTFIL FNAMES=OUT,OMIT=(81,5,ZD,EQ,0,OR,86,5,ZD,EQ,0),
    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 Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Sort Card to Remove Duplicate records... raj4neo SYNCSORT 2 Wed Jan 25, 2017 4:44 am
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Removing Extra Spaces in a comma sepa... Puspojit DFSORT/ICETOOL 3 Tue Sep 13, 2016 7:46 am


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