Index Query

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

Post Reply
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

Hi,

I think Anupams solution in the other post should work for you.

viewtopic.php?t=102188&highlight=

Thanks
Sam
praburaj
Premium Member
Premium Member
Posts: 133
Joined: Thu Jun 30, 2005 1:26 am
Location: philippines

Post by praburaj »

That is i did. but it is not working. plz help me. How can i do that?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There is no "Raise Error" in DataStage BASIC expressions. You do not appear to have a complete set of matching Else clauses. Every If must have a Then and an Else when used in an expression.

Can you re-post your code, single spaced and properly indented, surrounded by Code tags to preserve the indenting? I am having too much difficulty trying to read your code as it stands.

To determine whether there is more than one "*" it is sufficient to use the Index() function to seek the second occurrence.

Code: Select all

Index(InLink.TheField, "*", 2)
This will return 0 if there is no second occurrence, or a non-zero value (the character position in the string of the second occurrence) if found.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Do it in a routine. I think it would be a lot easier using a Case statement.
Mamu Kim
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Have DCount() function in the constraint to count and reject or allow the record based on the number of delimeter '*' found.
In derivation,

Code: Select all

If Link.InputCol[1,3] =  'LPG' Then 'NPG':Link.InputCol[4,Len(Link.InputCol)] Else Link.InputCol
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply