Hi All,
I have to give one condition in transformer. I am using a stage variable to do this.But the job is getting aborted because of that particular condition.I am not able to find out whats wrong in the below condition.
If Trim(Move_Xfm.Make)='Chevrolet' And Trim(Move_Xfm.Model)='Impala' And Trim(Move_Xfm.ModelYear) >='2006' And Trim(Move_Xfm.prfx) [4,2]= 'WS' Then 'E'
Else If (Trim(Move_Xfm.Make)='Chevrolet' Or Trim(Move_Xfm.Make)='GMC') And Trim(Move_Xfm.ModelYear) > '2007' And (Trim(Move_Xfm.prfx) [5,2]= 'C0' Or Trim(Move_Xfm.prfx) [5,2]= 'K0') Then 'E' Else ''
Can anybody help me out.
Thanks
Problem in defining one business rule in transformer
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Premium Member
- Posts: 70
- Joined: Thu Aug 14, 2003 6:24 am
- Contact:
Re: Problem in defining one business rule in transformer
Also consider providing initial values to stage variables, will help you...shalini11 wrote:Hi All,
I have to give one condition in transformer. I am using a stage variable to do this.But the job is getting aborted because of that particular condition.I am not able to find out whats wrong in the below condition.
If Trim(Move_Xfm.Make)='Chevrolet' And Trim(Move_Xfm.Model)='Impala' And Trim(Move_Xfm.ModelYear) >='2006' And Trim(Move_Xfm.prfx) [4,2]= 'WS' Then 'E'
Else If (Trim(Move_Xfm.Make)='Chevrolet' Or Trim(Move_Xfm.Make)='GMC') And Trim(Move_Xfm.ModelYear) > '2007' And (Trim(Move_Xfm.prfx) [5,2]= 'C0' Or Trim(Move_Xfm.prfx) [5,2]= 'K0') Then 'E' Else ''
Can anybody help me out.
Thanks
Sree Boyapati
Sr. ETL Architect
Certified Developer in DataStage, QualityStage, Information Analyzer.
Sr. ETL Architect
Certified Developer in DataStage, QualityStage, Information Analyzer.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The obvious difference is where Variable contains leading trimmable characters. The first syntax strips the first len characters (whatever they are) and trims the remainder. The second syntax trims the trimmable characters before performing the substring operation.shalini11 wrote:Thank you Sir,
It worked.
Such a small thing and it created a havoc.
Can you explain me what's the difference in writing Trim(Variable[from,len]) and Trim(Variable)[from,len].
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.