Transformer constraints

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
sigma
Premium Member
Premium Member
Posts: 83
Joined: Thu Aug 07, 2008 1:22 pm

Transformer constraints

Post by sigma »

If I want to build a transformer contraint as below should I be using one transfomer for each of these contraint or can I throw all of them in one transfomer


Also how does one escape a double quote character ...for example if I want to check for existence of IMPERIAL COLLEGE - "ACTIVE ACCESS" how to escape the double quote

If I throw all of them in one transformer it does not seem to generate any filters


Index(CustomerLoad.NAME1, "DO NOT USE",1) = 0 or
Index(CustomerLoad.NAME1, "PFIZER",1) = 0 or
Index(CustomerLoad.NAME1, "IMPERIAL COLLEGE - "ACTIVE ACCESS"",1) = 0 or
Index(CustomerLoad.NAME1, "GLAXOSMITHKLINE",1) = 0 or
Index(CustomerLoad.NAME1, "ASTRAZENECA",1) = 0 or
Index(CustomerLoad.NAME1, "GE HEALTHCARE LTD",1) = 0 or
Index(CustomerLoad.NAME1, "STRAZENECA, EUROPEAN HIERARCHY",1) = 0 or
Index(CustomerLoad.NAME4, "PREPAID",1) = 0
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You can use either single or double quotes, so if you need to check for double-quotes in your string, surround it with singles:

Code: Select all

Index(CustomerLoad.NAME1, 'IMPERIAL COLLEGE - "ACTIVE ACCESS"',1) = 0
Make sure your logic is correct - if the expression equates to true the record will exit the transformer, so all values would have to be not found in order for a record to be blocked with that constraint.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kandyshandy
Participant
Posts: 597
Joined: Fri Apr 29, 2005 6:19 am
Location: Singapore

Post by kandyshandy »

Why not in one transformer? If all these conditions are to be met for a single record to be output, then it could be in one transformer.. i mean one output constraint.

I guess you want to use AND and not OR.
Kandy
_________________
Try and Try again…You will succeed atlast!!
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Either the logic is not right as Craig pointed out or the OP just needs to replace OR with AND as kandyshandy pointed out.
In an OR condition, as soon as one is true within the same level, none of the other conditions are evaluated as only one TRUE is required for the statement to be true.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply