‎2008 Oct 23 11:57 AM
Hi,
I want to split contents of one character variable of length 15. say variable a stores string of length 15. i want to store first characters of a to variable b and rest of 11 characters in variable c.
i dont have any saperator there.
Please help
‎2008 Oct 23 12:01 PM
data: str type string,
var1 type string,
var2 type string.
var1 = str+0(4).
var2 = str+4(11).
‎2008 Oct 23 11:59 AM
Hi,
I supoose you can use the offset for this purpose.
Thanks & Regards
‎2008 Oct 23 12:02 PM
can you give me xample please.
i tryied following for geting b
b = a(4).
and it works fine but dont know how to get rest of contents in c
‎2008 Oct 23 12:03 PM
‎2008 Oct 23 12:01 PM
data: str type string,
var1 type string,
var2 type string.
var1 = str+0(4).
var2 = str+4(11).
‎2008 Oct 23 12:05 PM
‎2008 Oct 23 12:07 PM
Hi,,
DATA: a(15) TYPE c VALUE 'abcdefgh',
b TYPE char20,
c TYPE char20.
b = a(1).
c = a+1.
Edited by: Sukriti Saha on Oct 23, 2008 4:38 PM
‎2008 Oct 23 12:08 PM
Hi Sundeep,
Check the below code.
DATA : A TYPE CHAR20 VALUE 'ABCDEFGHIJKLMNO'.
DATA : B(4).
DATA : C(11).
B = A(4).
C=A+4(11).
regards
kumar M.