String Handling

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
saur_classic
Participant
Posts: 9
Joined: Tue Aug 01, 2006 9:43 pm

String Handling

Post by saur_classic »

Hi,

I am facing difficulties in extract the last portion from the URL string
for e.g.
Source sends "root^xhtmlmp^samsung(xhtml)^samsungsgh-a701" and we need "samsungsgh-a701" from it.

Does Datastage provides any Function to do the above job?

Saur
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Use Dcount and Field. Something like

Code: Select all

Field(InLink.RecIn, "^", DCOUNT(In.Col,"^"))
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If DCount() does not work in the expression, use Count().

Code: Select all

Field(InLink.RecIn, "^", Count(In.Col,"^")+1, 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.
Post Reply