Trimming the field
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 102
- Joined: Tue Jan 31, 2006 4:13 am
Trimming the field
There are 2 input columns A & B where the values will be like below
Column A has values like
smd 14 pin
SMD 16 PIN
SMD
SOT-23
Column B has values like
1
1
1
1
Output column C =Populate the values 'if the column B =1, then concatenate"SMD": column A values'
The result is
SMD smd 14 pin
SMD SMD 16 PIN
SMD SMD
SMD SOT-23
If SMD is repeating twice in the output value , I need to remove the 2nd SMD and populate the output like 'SMD 14 pin'. Please advise.
Column A has values like
smd 14 pin
SMD 16 PIN
SMD
SOT-23
Column B has values like
1
1
1
1
Output column C =Populate the values 'if the column B =1, then concatenate"SMD": column A values'
The result is
SMD smd 14 pin
SMD SMD 16 PIN
SMD SMD
SMD SOT-23
If SMD is repeating twice in the output value , I need to remove the 2nd SMD and populate the output like 'SMD 14 pin'. Please advise.
Sujatha K
-
- Premium Member
- Posts: 102
- Joined: Tue Jan 31, 2006 4:13 am
-
- Premium Member
- Posts: 102
- Joined: Tue Jan 31, 2006 4:13 am
What I did now is before concatenation with SMD , I checked for the field B is having 'SMD' or 'smd' using the expression below like
if column B = 1 AND LEFT(column A value,1,3) <>'smd' then "SMD ":Column A value
else
Column A value
The above command is checking for 'smd' alone. Is there any command in datastage server to get he first 3 characters irrespective of the UPPER OR LOWER case using LEFT.
if column B = 1 AND LEFT(column A value,1,3) <>'smd' then "SMD ":Column A value
else
Column A value
The above command is checking for 'smd' alone. Is there any command in datastage server to get he first 3 characters irrespective of the UPPER OR LOWER case using LEFT.
Sujatha K
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 102
- Joined: Tue Jan 31, 2006 4:13 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Need explanation on Downcase () and Upcase ()
HI SujathaK,
Could you please give me xplanation how you used the Downcase () and Upcase () to resolved ur problem?
thanks in advance
fareeda
Could you please give me xplanation how you used the Downcase () and Upcase () to resolved ur problem?
thanks in advance
fareeda
Thanks
Need explanation on Downcase () and Upcase ()
HI SujathaK,
Could you please give me xplanation how you used the Downcase () and Upcase () to resolved ur problem?
thanks in advance
fareeda
Could you please give me xplanation how you used the Downcase () and Upcase () to resolved ur problem?
thanks in advance
fareeda
Thanks