I asked a question about setting defaults when joining two tables (HASH and DB2) and some codes aren't found.
I coded the transform as this and keep getting an error.
Two questions:
Can I set two variables in the Then and else statements
Can I remove the else and end and the code will pass through to the function call with the new values. Thanks
If IsNull(DSLink15.Wloc_Cd)
Then DSLink15.Sav_Strt_tm = '02:00:00.000000'
DSLink15.Sav_End_tm = '02:00:00.000000'
Else
DSLink15.Sav_Strt_tm
DSLink15.Sav_End_tm
End
ConvertToTimeZone(DSLink2.PSG_ACTVT_SDTTM,DSLink15.Sav_Strt_tm,DSLink15.Sav_End_tm,"PST")
Transformer Logic Error
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 385
- Joined: Wed Jun 16, 2004 12:43 pm
- Location: Virginia, USA
- Contact:
Create two stage variables, each with an IF THEN ELSE. Drop the END.
Put the ConvertToTimezone() call in your derivation.
Put the ConvertToTimezone() call in your derivation.
Chuck Smith
www.anotheritco.com
www.anotheritco.com
-
- Premium Member
- Posts: 224
- Joined: Tue Sep 24, 2002 7:32 am
- Location: Denver, CO USA
This isn't a direct answer to your question, but an observation on the IF THEN ELSE you posted:
In the THEN clause do not try to set the value of the source field, just supply the value you want.
As Chuck suggested, use 2 stage variables:
SaveStartTime
SaveEndTime
The derivation of SaveStartTime would be:
The derivation of SaveEndTime would be:
Then the derivation of the target field would call ConvertToTimeZone (using the stage variables).
Hope this helps,
John
Code: Select all
If IsNull(DSLink15.Wloc_Cd) Then
DSLink15.Sav_Strt_tm = '02:00:00.000000'
DSLink15.Sav_End_tm = '02:00:00.000000'
Else
DSLink15.Sav_Strt_tm
DSLink15.Sav_End_tm
End
ConvertToTimeZone(DSLink2.PSG_ACTVT_SDTTM,DSLink15.Sav_Strt_tm,DSLink15.Sav_End_tm,"PST")
As Chuck suggested, use 2 stage variables:
SaveStartTime
SaveEndTime
The derivation of SaveStartTime would be:
Code: Select all
If IsNull(DSLink15.Wloc_Cd) Then
'02:00:00.000000'
Else
DSLink15.Sav_Strt_tm
End
Code: Select all
If IsNull(DSLink15.Wloc_Cd) Then
'02:00:00.000000'
Else
DSLink15.Sav_End_tm
End
Hope this helps,
John