I have a mircosoft Access database that picks up a file and formats it into a sequential file for me. That sequential file is than ftp to the server and datastage runs. This job is only run once a month. There was a request to change one of the columns and i need to use a like statement i tried to do it in access but it blew up saying it was too complex.
I need to do something like this if(input_colum like '*MND*' ) than MND else if(input_column like '*Puni*Wrap*' than "Puni Wrap' else input_column, (it keeps going but i will stop there) i know there is a match function in datastage but that didn't work, is there a way to do this in the transformer? Or can you use the match function with the wild card?
Thanks for the help...
Like statement in transformer
Moderators: chulett, rschirm, roy
I looked at the help for matches is this what i found
pattern must contain elements that describe all the characters in string. For example, the following statement returns an empty string because pattern does not cover the substring "AB" at the end of string:
MatchField ("XYZ123AB", "3X3N", 1)
I'm not sure what the "3X3N", 1 is supposed to represent. I guess what i need is for "3X3N" to represent a wildcard, has anybody ever used something like that before?
pattern must contain elements that describe all the characters in string. For example, the following statement returns an empty string because pattern does not cover the substring "AB" at the end of string:
MatchField ("XYZ123AB", "3X3N", 1)
I'm not sure what the "3X3N", 1 is supposed to represent. I guess what i need is for "3X3N" to represent a wildcard, has anybody ever used something like that before?
'X' refers to alphabet or numeric, whatever. So, you probably now know what 'N' and 'A' are. The digit refers to the 'number' of characters. You may also want to try this simple way -jpockets wrote:I looked at the help for matches is this what i found
pattern must contain elements that describe all the characters in string. For example, the following statement returns an empty string because pattern does not cover the substring "AB" at the end of string:
MatchField ("XYZ123AB", "3X3N", 1)
I'm not sure what the "3X3N", 1 is supposed to represent. I guess what i need is for "3X3N" to represent a wildcard, has anybody ever used something like that before?
Code: Select all
To check for "pose" in the string "supposed to represent", use -
Link.InputString Matches "...pose..."
gateleys
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You should also have found the Matches operator in your trawl through on-line help. would do it, as would
Code: Select all
InLink.TheColumn Matches "...MND..."
Code: Select all
InLink.TheColumn Matches "0X'MND'0X"
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.