I am using QS.
I have a URGENT requirements to strip of all the characters after ':' and ';' including.
Any gurus to guide me...
thanks in advance
Kewl,
USING RULES Need help Overiding and stripping
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
There is no such thing as URGENT here.
If you have DataStage it's very easy to pre-process your data. It's more tedious to do using QualityStage stages, but in general it's possible.
Do you have DataStage?
If you have DataStage it's very easy to pre-process your data. It's more tedious to do using QualityStage stages, but in general it's possible.
Do you have DataStage?
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.
Re: USING RULES Need help Overiding and stripping
Probably a lot easier in DS, but if you must use QS: Firstly, have ':' and ';' in your sep, but not strip lists.kommven wrote:I have a URGENT requirements to strip of all the characters after ':' and ';' including.
Then a rule like
Code: Select all
:|**|$
RETYPE [1] 0
RETYPE [2] 0
;|**|$
RETYPE [1] 0
RETYPE [2] 0
**
COPY [1] {OP}
(Note: Haven't pattern coded for a while, but I think this will work.)
Cheers,
Jamas
Again, probably easier outside QS, but...kommven wrote:I need to strip away everything in parenthesis
Code: Select all
\(|**|\)
RETYPE [1] 0
RETYPE [2] 0
RETYPE [3] 0
Cheers,
Jamas
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
For removing everything between parentheses, and assuming there is only one set of parentheses, you can use an expression. If there is more than one set of parentheses, you need a routine that iteratively processes the string using the same logic for each set.
Extract everything up to and including the left parenthesis, then concatenate everything from and including the right parenthesis. You could use the field function, but Index() and Substring operations may be clearer. The following expression might appear in a server job Transformer stage.
Later in the same job, use a QualityStage stage in the DataStage job to invoke your other QualityStage processing job.
To strip all the characters following ":" or ";" similar expressions are used, for example
Extract everything up to and including the left parenthesis, then concatenate everything from and including the right parenthesis. You could use the field function, but Index() and Substring operations may be clearer. The following expression might appear in a server job Transformer stage.
Code: Select all
Left(TheString,Index(TheString, "(", 1)) : Right(TheString, Len(TheString)-Index(TheString, ")", 1) + 1)
To strip all the characters following ":" or ";" similar expressions are used, for example
Code: Select all
Left(TheString, Index(TheString, ":", 1))
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.