if NOT(LINK_LOOKUP.NOTFOUND) and
(
trimb(LINK_ROLLUP.ORGTG_IBT_N) = 2610 or
trimb(LINK_ROLLUP.ORGTG_IBT_N) = 2710 or
trimb(LINK_ROLLUP.ORGTG_IBT_N) = 5810 or
trimb(LINK_ROLLUP.ORGTG_IBT_N) = 1409 or
trimb(LINK_ROLLUP.ORGTG_IBT_N) = 7526 or
trimb(LINK_ROLLUP.ORGTG_IBT_N) = 1426 or
trimb(LINK_ROLLUP.ORGTG_IBT_N) = 5837 or
trimb(LINK_ROLLUP.ORGTG_IBT_N) = 9405 or
trimb(LINK_ROLLUP.ORGTG_IBT_N) = 5745 or
trimb(LINK_ROLLUP.ORGTG_IBT_N) = 3145
) then
LINK_ROLLUP.CASH_A + LINK_LOOKUP.CASH_DEP_R100_CC_A else
LINK_ROLLUP.CASH_A
if NOT(LINK_LOOKUP.NOTFOUND) and trimb(LINK_ROLLUP.ORGTG_IBT_N) = 2610 then
LINK_ROLLUP.CASH_A + LINK_LOOKUP.CASH_DEP_R100_CC_A else if
NOT(LINK_LOOKUP.NOTFOUND) and trimb(LINK_ROLLUP.ORGTG_IBT_N) = 2710 then
LINK_ROLLUP.CASH_A + LINK_LOOKUP.CASH_DEP_R100_CC_A else if
NOT(LINK_LOOKUP.NOTFOUND) and trimb(LINK_ROLLUP.ORGTG_IBT_N) = 5810 then
LINK_ROLLUP.CASH_A + LINK_LOOKUP.CASH_DEP_R100_CC_A else if
NOT(LINK_LOOKUP.NOTFOUND) and trimb(LINK_ROLLUP.ORGTG_IBT_N) = 1409 then
LINK_ROLLUP.CASH_A + LINK_LOOKUP.CASH_DEP_R100_CC_A else if
NOT(LINK_LOOKUP.NOTFOUND) and trimb(LINK_ROLLUP.ORGTG_IBT_N) = 7526 then
LINK_ROLLUP.CASH_A + LINK_LOOKUP.CASH_DEP_R100_CC_A else if
NOT(LINK_LOOKUP.NOTFOUND) and trimb(LINK_ROLLUP.ORGTG_IBT_N) = 1426 then
LINK_ROLLUP.CASH_A + LINK_LOOKUP.CASH_DEP_R100_CC_A else if
NOT(LINK_LOOKUP.NOTFOUND) and trimb(LINK_ROLLUP.ORGTG_IBT_N) = 5837 then
LINK_ROLLUP.CASH_A + LINK_LOOKUP.CASH_DEP_R100_CC_A else if
NOT(LINK_LOOKUP.NOTFOUND) and trimb(LINK_ROLLUP.ORGTG_IBT_N) = 9405 then
LINK_ROLLUP.CASH_A + LINK_LOOKUP.CASH_DEP_R100_CC_A else if
NOT(LINK_LOOKUP.NOTFOUND) and trimb(LINK_ROLLUP.ORGTG_IBT_N) = 5745 then
LINK_ROLLUP.CASH_A + LINK_LOOKUP.CASH_DEP_R100_CC_A else if
NOT(LINK_LOOKUP.NOTFOUND) and trimb(LINK_ROLLUP.ORGTG_IBT_N) = 3145 then
LINK_ROLLUP.CASH_A + LINK_LOOKUP.CASH_DEP_R100_CC_A else
LINK_ROLLUP.CASH_A
Which will bring back the correct results?
If they return different values different.. why?
Which is faster to interpret by DS? Is the second piec of code resulting in 11 reads (maximum) and the first set only resulting in 2 reads (maximum)?
dnzl
"what the thinker thinks, the prover proves" - Robert Anton Wilson
Hi
Its not the question that which will run fast.. Its a question of which one is more effiecient way..
As my knowedge first one is easy to debug and easy to understand.
When ever you are building some logic .. keep it more simple... and more effective.. easy to understand by some others and easy to make some changes if there is any.
If you see ascential tips and tricks they clearly mentioned that "keep everthing simple" If you have a very complex situation .. devide that into number of pieces of work and work it.. This way you will have control where that is going wrong...
svAddItPrep = If
svTrimbOrgtgIbtN = 2610 Then @TRUE Else If
svTrimbOrgtgIbtN = 2710 Then @TRUE Else If
svTrimbOrgtgIbtN = 5810 Then @TRUE Else If
svTrimbOrgtgIbtN = 1409 Then @TRUE Else If
svTrimbOrgtgIbtN = 7526 Then @TRUE Else If
svTrimbOrgtgIbtN = 1426 Then @TRUE Else If
svTrimbOrgtgIbtN = 5837 Then @TRUE Else If
svTrimbOrgtgIbtN = 9405 Then @TRUE Else If
svTrimbOrgtgIbtN = 5745 Then @TRUE Else If
svTrimbOrgtgIbtN = 3145 Then @TRUE Else @FALSE
You could change the derivation of the stage variable to make it a little easier - or at least what I think is a little easier on the eyes and brain. You don't need to explicitly set svAddItPrep to @TRUE or @FALSE:
svTrimbOrgtgIbtN = 2610 or svTrimbOrgtgIbtN = 2710 or svTrimbOrgtgIbtN = 5810 or svTrimbOrgtgIbtN = 1409 or svTrimbOrgtgIbtN = 7526 or svTrimbOrgtgIbtN = 1426 or svTrimbOrgtgIbtN = 5837 or svTrimbOrgtgIbtN = 9405 or svTrimbOrgtgIbtN = 5745 or svTrimbOrgtgIbtN = 3145
This expression will evaluate to true or false and set the stage variable accordingly.
-craig
"You can never have too many knives" -- Logan Nine Fingers
if NOT(LINK_LOOKUP.NOTFOUND) and INLIST(trimb(LINK_ROLLUP.ORGTG_IBT_N), 2610,2710,5810,1409,7526,1426,5837,9405,5745,3145) then LINK_ROLLUP.CASH_A + LINK_LOOKUP.CASH_DEP_R100_CC_A else
LINK_ROLLUP.CASH_A
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Consider putting this into a reference table and use it as a hash lookup. This is maintenance free solution. Also not hard coded in your job. Anytime you need to add or change in the reference table. Worth considering it.
I agree you should avoid hard coding these values in a transformer in case they need to be modified at regular intervals. A lookup table or even a routine would be easier. With a routine you just need to change the inlist and recompile the routine and the job will pick up the new values.