Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

To use split statment

Former Member
0 Likes
586

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

5 REPLIES 5
Read only

Former Member
0 Likes
555

data: var  type c length 6 value '1ABCDE",
var1 type c length 1,
var2 type c length 5.

var1 = var(1).
var2 = var+1.
Read only

Former Member
0 Likes
555

give an F1 on SPLIT statement and chk.

Read only

Former Member
0 Likes
555

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.

Read only

Former Member
0 Likes
555

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

Read only

Former Member
0 Likes
555

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.