Any alternative for Substrings 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

Post Reply
sumesh.abraham
Participant
Posts: 153
Joined: Thu May 11, 2006 1:52 am
Location: Bangalore

Any alternative for Substrings function?

Post by sumesh.abraham »

Hi All,

I've a requirement. The input column data is of 10 digits and the output should be of 9 digits, with the second digit removed.Substrings function works perfectly fine.Now I want to know of any other function which does the same work more efficiently.
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Re: Any alternative for Substrings function?

Post by sachin1 »

hello dear taking your request into consideration,

following could help you,

suppose your string is str1=;1234567890' so your output will be like str1[3,10]:str1[1,1]

and the output is like 345678901

this is one of the method i think is efficient.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Substring and concatenation is almost certainly the most efficient. Arithmetic (with Int() and Mod() functions) will be a close second.
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