‎2009 May 27 9:38 AM
Hi ,
I want to split the variable var into two variables at var1 and var2 .
I want to split var at the second place .
how should i do it?
Regards,
Harshit Rungta
‎2009 May 27 9:40 AM
data: var type c length 6 value '1ABCDE",
var1 type c length 1,
var2 type c length 5.
var1 = var(1).
var2 = var+1.
‎2009 May 27 9:40 AM
‎2009 May 27 9:42 AM
The command is SPLIT VAR AT DELIMITER INTO VAR1 VAR2.
If you need to split at the second occurrence of DELIMITER then:
SPLIT VAR AT DELIMITER INTO TEMP1 TEMP2 VAR2.
CONCATENATE TEMP1 TEMP2 INTO VAR1.
‎2009 May 27 9:44 AM
Hi,
Try this .
data : word(12), w1(10),w2(10).
word = 'WE CAN SPLIT'.
SPLIT word+1(11) at space into w1 w2.
write : / w1.
write: / w2.
Hope this one help you
Regards,
Smart
‎2009 May 27 9:51 AM
This is sample one
data:var(10) VALUE 'ab cde',var1(10),var2(10).
split var at space into var1 var2.
write : / , var2,
var1.
Output:
Var2 -->cde
Var1 -->ab
Please selct split and press f1 and check it.