Hi,
I have a file which has two field.
report_code integer 10
report_name varchar(255)
field_value varchar(255)
sequential file
Transformer
will trasfer it to a sequential file based on some logic.
if report_code = 59 then i have to store the value in date column. Because it has datetime value.
if report_code = 60 then i have to store the value in rank column.
So i include like
if (DS4Link.report_code <> 59 or DS4Link.report_code <> 60 )then DS6Link.field_value else 0
this is for field_value
if (DS4Link.report_code = 59 then DS6Link.field_value else 0
this for date column
if (DS4Link.report_code = 60 then DS6Link.field_value else 0
this is for rank column
But the value are not going as expected.
sequential file:
report_code integer 10
report_name varchar 255
field_value numeric 18,8
date timestamp 23 3
rank varchar(5)
Transformer , IF condition
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 729
- Joined: Tue Apr 28, 2009 10:49 pm
Transformer , IF condition
Karthik
-
- Premium Member
- Posts: 41
- Joined: Tue Jan 24, 2006 3:43 pm
- Location: United States
- Contact:
The nested If Then Else syntax should be If [condition] Then [output] Else If [condition] Then [output] Else If [condition] Then [output] Else [output].
In your case you don't need a nested condition, I think. You can use two transformers and a funnel stage to acheive it. In your first transformer use a constraint for DSLink.Report_code=59, in the second use DSLink.Report_code=60. Funnel the outputs into a sequential file or a database target.
In your case you don't need a nested condition, I think. You can use two transformers and a funnel stage to acheive it. In your first transformer use a constraint for DSLink.Report_code=59, in the second use DSLink.Report_code=60. Funnel the outputs into a sequential file or a database target.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Re: Transformer , IF condition
Attention to detail is very important in an ETL developer.karthi_gana wrote:I have a file which has two field.
report_code integer 10
report_name varchar(255)
field_value varchar(255)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.