extracting start and end position using index function

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

sbass1
Premium Member
Premium Member
Posts: 211
Joined: Wed Jan 28, 2009 9:00 pm
Location: Sydney, Australia

Post by sbass1 »

1. Is there any chance of getting your source data changed? The whole purpose of a field delimiter is it's not part of your data. So get the comma field delimiter changed to ~, ^, |, etc.

2. Since your data appears to be name=value pairs separated by a delimiter, use the FIELD function to parse your data after fixing #1 above. Then, use the FIELD function on THAT to parse name/value (on the = sign).

3. When name equals your field of interest, you've found your field.

4. If you don't mind doing this outside DS, let me know. Somewhere I *may* (I'll have to dig it up) find a regular expression that ignores delimiters between quotes. I certainly didn't think it up - I found it in comp.lang.perl. It's really ugly with a bunch of backreferences (all this is from memory).

Your life is a lot easier if you address #1 above...
Some people are the Michael Jordan's of Datastage. I'm more like Muggsy Bogues :-)
Post Reply