Need do devide the numbers if '/' is found in the number

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
jaysheel
Participant
Posts: 57
Joined: Mon Apr 07, 2008 1:54 am
Location: Bangalore

Need do devide the numbers if '/' is found in the number

Post by jaysheel »

Hi,

I have a requirement where I am getting a Char(10) field from source. Which might contain data like '15/100', '345/10', '01/125' like this.
What I need to do is devide like each of them.
Means '15/100' as 15 devide by 100 and so on.
I am planning to use the field fucntion for this.
I have never used the field fucntion for this till now.
How would I search for the character '/' and then get the characters on its right and left side so that I can devide them.

Could anyone please help me on this Field function..?

Thanks in advance.
- Jaysheel -
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Write a routine. Use Index() to check for the "/".

Field(YourColumn,"/",1,1) would get the first field from a "/" delimited string while Field(YourColumn,"/",2,1) would get the second. Divide the two results.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply