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

Need Help Regarding removing duplicate


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Tue May 06, 2008 9:12 pm
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
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 Developer


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

PostPosted: Wed May 07, 2008 10:44 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Duplicate transid's declared using CEDA CICS 3
No new posts Duplicate several members of/in one l... JCL & VSAM 7
No new posts Newbie Stuck on "Duplicate Datas... TSO/ISPF 5
No new posts Duplicate data in PUT CONTAINER using... CICS 4
No new posts Remove set of duplicate records from ... DFSORT/ICETOOL 10
Search our Forums:

Back to Top