Hi,
I have a decimal(7,3)
eg: +1234.567 or -1234.567 need O/p as 1234.567
Also IF more than 4 positions to left or more than 3 positions to right reject.
eg: +12345.67 reject
+123.4567 reject
How to implement this can any one help me am new to datastage!
How to remove sign to a decimal[7,3]
Moderators: chulett, rschirm, roy
How to remove sign to a decimal[7,3]
Thanks,
Avunoori.
Avunoori.
Code: Select all
svNum=Trim(Convert('+-','',Input))
Code: Select all
Len(Field(svNum,'.',1)) < 4 And Len(Field(svNum,'.',2)) < 3
You are the creator of your destiny - Swami Vivekananda
anbu wrote:Use this as transformer constraintCode: Select all
svNum=Trim(Convert('+-','',Input))
Code: Select all
Len(Field(svNum,'.',1)) < 4 And Len(Field(svNum,'.',2)) < 3
I can still see the signs in output file. convert is not working.Help me Please.
Thanks in advance.
Thanks,
Avunoori.
Avunoori.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The approaches thus far seem to be overly complex. It seems to me that there are two separate things to solve: removal of the sign and checking of the structure.
Use Convert() or Abs() to strip the sign.
Test that result. You could use IsValid() to test for Decimal(7,3) or you could convert to string and check for a decimal placeholder in the fifth character position.
Use Convert() or Abs() to strip the sign.
Test that result. You could use IsValid() to test for Decimal(7,3) or you could convert to string and check for a decimal placeholder in the fifth character position.
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.