extract function in transformer stage string functions

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
RAJEEV KATTA
Participant
Posts: 103
Joined: Wed Jul 06, 2005 12:29 am

extract function in transformer stage string functions

Post by RAJEEV KATTA »

Can anyone help me out how does an extract function in server transformer stage work.I have tried with different options being passed for example Extract("dsxchange",1,2,2),it runs the job properly but returns null value.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The Extract() function works with dynamic arrays to extract an element therefrom. Your function (Extract("dsxchange",1,2,2)) attempts to get the second sub-value from the second value of the multi-valued first field of a dynamic array but your first argument is not a dynamic array, merely a scalar string. In such cases, the Extract() function will always return "". Indeed, all string functions in DataStage BASIC return "" if reference is made to a non-existent position.

Please specify in English what you want to accomplish, and we will be able to advise more accurately the function that you should be using.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
RAJEEV KATTA
Participant
Posts: 103
Joined: Wed Jul 06, 2005 12:29 am

Post by RAJEEV KATTA »

Thanks a lot Ray but i think first i need to brush up myself with what is an dynamic array.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I doubt it. I think you need a different function, such as Substrings(). But that's just a guess, since you will not reveal what you want to accomplish.
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