‎2007 Feb 15 4:09 PM
I am trying to convert a value from a string or a number.
I just want to grab either the first number or the first character
of one variable and assign it to another variable.
How do I do this?
How do I do this if I'm trying to return just the third character or number in the value?
Where could I have looked this up myself in the documentation?
‎2007 Feb 15 4:11 PM
You can take the offset like...
say u want the first character of variable v1 you take it as v2 = v1+0(1)
for 3rd character v2 = v1+2(1)
You can do f1 on your code and go to the operations on strings. you can get the help there.
‎2007 Feb 15 4:12 PM
Hi,
DATA: V_CHAR8(8) VALUE '12345678'.
DATA: V_CHAR.
V_CHAR = V_CHAR8(1).
Thanks,
Naren
‎2007 Feb 15 4:12 PM
This can be achieved using offset: Is this what you are looking for?
data: str(3) type c value 'xyz'.
write:/ str+1(2). "Extract two chars starting from position 1.
Output: xy.
Thanks,
Santosh