reject records.

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
adams06
Participant
Posts: 92
Joined: Sun Mar 12, 2006 3:00 pm

reject records.

Post by adams06 »

Hi

TYPE NAME

C 300
A 100
A 100
B 100
A 200
B 200
D 500
B 600
E 700

I HAVE TO ERROR OUT THEM WHEN THE SAME NAME HAS DIFFERENT TYPES

A 100
A 100
B 100

I HAVE TO ERROR OUT THEM WHEN THE SAME NAME HAS DIFFERENT TYPES

A 200
B 200

How to solve this, i have tried using RowProcCompareWithPrevious value.

Any idea !

Thanks.
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post by I_Server_Whale »

Hi Adams,

I'm thinking if you sort by NAME, TYPE and then using "RowProcCompareWithPrevious value" would help.


Because, when you sort you can get the records in the form:



Code: Select all


NAME   TYPE

100        A
100        A
100        B
200        A
200        B
500        D
600        B
700        E

Let me know your feedback.

Thanks,
Whale.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If they're sorted by NAME you can do it in a Transformer stage using stage variables, and avoid the overhead of calling a Routine. One pair of variables can detect the change in values in NAME, while another can keep track of the TYPE most recently seen for that NAME. Constraint expressions direct output rows accordingly.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply