Using Field function to get final delimeter of a string

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If that really works for you (I didn't check it) there's no need for a routine. You can inline all that and save all those intermediate variables:

Code: Select all

left(mystring[index(mystring,' ',dcount(mystring,' ')-1)+1,30],3)
:shock: :lol:
-craig

"You can never have too many knives" -- Logan Nine Fingers
vivek
Charter Member
Charter Member
Posts: 17
Joined: Wed Feb 22, 2006 1:38 am
Location: USA

Post by vivek »

Chulette,
The reason I went for a subroutine is to specify an exception, such as how to handle the string if the delimeter(the double space) is not found.
we are replacing the result with '00' for now.

even though that's not the present situation may be in future we may get data with out this delimeter.that's why i have opted for a routine.

once agian thanks for your followup with the request.
Post Reply