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

Regarding Split

Former Member
0 Likes
592

Hi,

I have a material Description as some XXXX YYYY ZZZZ I have to split this by four characters that is the four space inbetween should also get loaded into the variable is there any way to do this without using loop ..

Kindly help urgent...

Thanks in advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
550

Hi,

If you know the material description is going to splitted after every 4 characters every time then use offset, it will solve your problem.

eg, Material descrption = 'XXXXYYYYZZZZ'.

var1 = material description+0(4).

var2 = material description+4(4).

var3 = material description+8(4).

Regards,

SD

4 REPLIES 4
Read only

Former Member
0 Likes
551

Hi,

If you know the material description is going to splitted after every 4 characters every time then use offset, it will solve your problem.

eg, Material descrption = 'XXXXYYYYZZZZ'.

var1 = material description+0(4).

var2 = material description+4(4).

var3 = material description+8(4).

Regards,

SD

Read only

Former Member
0 Likes
550

data: var1(8) type c,

var2(8) type c,

var2(8) type c,

var1 = field+0(4).

var2 = field+4(4).

var3 = field+8(4).

Read only

Former Member
0 Likes
550

Hi ,

Try This.

eg, descrption = 'XXXX YYYY ZZZZ'.

Desc1= description+0(5). '' XXXX "

Desc2= description+5(5). "YYYY "

Desc3 = description+10(4). "ZZZZ"

This will allow to get the spaces also.

Reward If useful.

Regards,

Chitra

Read only

Former Member
0 Likes
550

data: sym(15) type c value 'XXXX YYYY ZZZZ',

var1(5) type c,

var2(5) type c,

var3(5) type c.

var1 = sym+0(4).

var2 = sym+5(4).

var3 = sym+10(4).

write: var1,var2,var3.