Arun
you
can use the SUBSTR function that you already know, if in fact there is actually some character (or even a blank) in the field that separates the two elements, even if that location varies for each record.
Look up the POSIT function.
POSIT will give you the location within a string of a specified character.
POSIT returns a 0 if it doesn't find that character.
POSIT(parent, inlength, substring, sublength, outfield)
Lets say the input string is 20 long, the character is a dash, and you define a field
MYPLACE/I2=POSIT(input,1,'-',1,MYPLACE);
then your first SUBSTR reads the input up to the posit location-1.
Your second SUBSTR reads the input starting with the posit location + 1;
bulletproofing note: Make each resulting field the same length as the input field, to allow for no dash.
FIRSTBIT/A20=SUBSTR(20,input,1,MYPLACE-1,MYPLACE,FIRSTBIT);
etc. you get the idea.
GETTOK is a more elegant way to do it,
but i thought you might like to use the SUBSTR function you already know.
-S
| In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID |