need logic

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
pattemk
Participant
Posts: 84
Joined: Wed May 16, 2007 4:04 pm

need logic

Post by pattemk »

hi my input

Claim_id line_num adj_type
1 01 80
1 02 80
1 03 80
2 01 80
2 02 80
2 01 83
2 02 83
3 97 84
3 98 84
3 99 84
4 92 84
4 93 84
5 01 80
5 01 83
5 95 84
6 01 80
6 02 80
7 01 80
7 01 83
7 02 80
7 02 83
7 92 84
7 93 84
7 94 84

my output shuld be

claim_id lin_no adj_ty
1 01 80
1 02 80
1 03 80
3 97 84
3 98 84
3 99 84
4 92 84
4 93 84
6 01 80
6 02 80

plz help
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Is this a test of our ability to guess what your logic is?
sid19
Participant
Posts: 64
Joined: Mon Jun 18, 2007 12:17 am
Location: kolkata

pattemk

Post by sid19 »

Can u please expalin the question in detail, suppose if in ur input the claim_id's are 1 to n then what do u want in output resluts ,

please put the qiestion in a generic way
Sid
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Please generate (and post) a target-from-source mapping document, that describes in English the rules for generating the output based on the input.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pattemk
Participant
Posts: 84
Joined: Wed May 16, 2007 4:04 pm

Post by pattemk »

hi,
thanks for replying.

my input has three columns1)claim_id 2)line_nu 3)adj_type
all of them are varchar(10).
there are three types of adj_types1)80 2)83 3)84
in my input each particular claim_id has adj_type either 80 or 83 or 84 or combination of all of them(80,83,84) or combination of any two of them(80,83
and 80,84).

i need out put where a particular claim_id has no multiple adj_types, i.e if a particular claim_id has adj_type 80 and also if the same particular claim_id has adj_type 83 or 84, i do not want them in my output.

my out put should have claim_id's which have only one kind of adj_type either 80 or 83 or 84. out put claim_id should not have combination of these adj_types.

source-->sequential file
target--> sequential file

thank you
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

Use stages in the below order to get your result:

Src --> Sort --> Transformer --> Remove Duplicate --> Filter -->Target
Set the 'change keys' in sort stage and use them as flags/indicatrs in transformer. Keep appending similar records (Which you found with change key indicators) in stage variable and set another indicator in the transformer when ever your criteria are breached. Capture only the last duplicate record and then filter on indicator in the transformer in filter stage.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
Post Reply