Constrainst in Transformer Stage Not Working

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
nbdbzv4
Participant
Posts: 4
Joined: Thu Oct 26, 2006 11:38 pm
Location: Concord, Ca

Constrainst in Transformer Stage Not Working

Post by nbdbzv4 »

I have a transformer stage with five output links. The vqrious contstrainst coded do not give the expected results. I have tried deleloping them in notepad and copying and pasting them in the constrainst editor and also entering them directly into the constrainst editor. One of teh problem constrainst follows:

acctlvl = ' ' and srvtype <> 'S' and
caasrvnbr <>132 and
(srvstatus <> 'X' or 'W' or 'F') and
acctlvl_1 = ' ' and
(acctchg_1 <> 'A' or 'C')

Please help as I have tried for 3 days to get this to work..

Thanks
senthilt1
Participant
Posts: 134
Joined: Mon Nov 19, 2007 2:17 am

Re: Constrainst in Transformer Stage Not Working

Post by senthilt1 »

Hi Nbdbzv4.

Please try the below one, hope it will work,

acctlvl = ' ' and srvtype <> 'S' and
caasrvnbr <>132 and
(srvstatus <> 'X' or srvstatus<>'W' or srvstatus<>'F') and
acctlvl_1 = ' ' and
(acctchg_1 <> 'A' or acctchg_1<>'C')

Find the changes in Bold.

Thanks,

Senthil P
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

what is actually you are expecting in the output, give some example of input and expected output records

i think the logic you are trying is wrong
if srvstatus <> 'X' or 'W' or 'F' is wrong even (srvstatus <> 'X' or srvstatus<>'W' or srvstatus<>'F' ) is wrong
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Right. You've got the corrected syntax now but as keshav0307 points out having multiple 'not equal' checks with 'or' makes no sense. They needs to be 'and', otherwise it will always return true.
-craig

"You can never have too many knives" -- Logan Nine Fingers
nbdbzv4
Participant
Posts: 4
Joined: Thu Oct 26, 2006 11:38 pm
Location: Concord, Ca

Post by nbdbzv4 »

Hi Everyone:

Thanks for taking the time to review my issue and offering suggestions and corrections. I did get it to work by using this format as was suggested:

acctlvl = ' ' and srvtype <> 'S' and
caasrvnbr <>132 and
(srvstatus <> 'X' and srvstatus<>'W' and srvstatus<>'F' ) and
acctlvl_1 = ' ' and
(acctchg_1 <> 'A' and acctchg_1<>'C' ) .

The other issue and confusion which I had was relying upon a verification script developed by the testing group.

Thanks
nbdbzv4
Participant
Posts: 4
Joined: Thu Oct 26, 2006 11:38 pm
Location: Concord, Ca

Post by nbdbzv4 »

Hi Everyone:

Thanks for taking the time to review my issue and offering suggestions and corrections. I did get it to work by using this format as was suggested:

acctlvl = ' ' and srvtype <> 'S' and
caasrvnbr <>132 and
(srvstatus <> 'X' and srvstatus<>'W' and srvstatus<>'F' ) and
acctlvl_1 = ' ' and
(acctchg_1 <> 'A' and acctchg_1<>'C' ) .

The other issue and confusion which I had was relying upon a verification script developed by the testing group.

Thanks
Post Reply