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

concatenate

Former Member
0 Likes
1,654

Hi,

what is the syntax for concatenating spaces after a variable , if the number of spaces varies every time?

Say, I have var1 = 'jay'

and i need to pad two spaces after that , to get 'jay '.

But the number of spaces to be padded changes every time.

If i have the number of spaces to be padded in another variable , say var2, how can I achieve this?

Can I use anything other that concatenate to resolve this issue?

Hi,

what is the syntax for concatenating spaces after a variable , if the number of spaces varies every time?

Say, I have var1 = 'jay'

and i need to pad two spaces after that , to get 'jay '.

But the number of spaces to be padded changes every time.

If i have the number of spaces to be padded in another variable , say var2, how can I achieve this?

Can I use anything other that concatenate to resolve this issue?

14 REPLIES 14
Read only

Former Member
Read only

Former Member
0 Likes
1,612

You can only add space in between or before the string,not after the string.

Regards,

Aparna Gaikwad

Read only

Former Member
0 Likes
1,612

That does not answer my question.

Read only

Former Member
0 Likes
1,612

Trailing spaces can't be added to any by concatenation.

Read only

naveen_inuganti2
Active Contributor
0 Likes
1,612

Hi... Jayitha....

You posted...

the number of spaces varies

to be padded in another variable , say var2

So here variable is changing.. also number of spaces....

Multiple combination....?

plz clarify this...

Thanks,

Naveen.I

Read only

Former Member
0 Likes
1,612

How can I achieve this then?

Read only

0 Likes
1,612

Hi....

Number of spaces depends on name or what?

They must be depend on some thing naa..?

Plz get back again....

Thanks,

Naveen.I

Read only

Former Member
0 Likes
1,612

hi.

use space eithe hardcoded or by syntex.

concatenate 'jay' ' ' into var_1.

hope this will help u and try to check out syntex from F1.

Read only

Former Member
0 Likes
1,612

hi,

You can try. this may help.

Concatenate var1 '1' '1' into var1.

replace all occurances of '1' with space.

This may solve your problem some how.

Regards

Sumit Agarwal

Read only

Former Member
0 Likes
1,612

I need to pad spaces at the end of a variable.

How do i concatenate spaces if the number of spaces is not fixed?

because I cant write - concatenate var1 2 spaces........

something of this kind cant be written.

If i need to concatenate 2 spaces , the normal syntax is - concatenate var1 sapce space into.....

But here, the number of spaces to be concatenated is not fixed.

Read only

0 Likes
1,612

hi,

if the number of spaces are not fixed then use concatenate statement in a loop.

Do N_spacce times.

Concatenate var1 space into var1.

Enddo.

Regadrs

Sumit Agarwal

Read only

Former Member
0 Likes
1,612

Suppose var1 has no. of spaces to concatenate

var2 has 'JAY'.

do var1 times.

concatenate var2 '' into var3.

enddo.

var3 will have your result.

Hope this helps..

Reward if it does

Read only

Former Member
0 Likes
1,612

Hi,

you have to use the addition "RESPECTING BLANKS".

concatenate var1 var2 into var3 respceting blanks.

suppose var2 conatins 2spaces( or any dyamic spaces ) then it will accept 2 blanks(or as that of dynamic) as it is without condensing.

Revrt back if any issues.

Regards,

Naveen

Edited by: Naveen Deva on Aug 5, 2008 3:16 PM

Read only

Former Member
0 Likes
1,612

Hi,

Declare one constant of type character with length 1, and the value of constant must be like this press ALT key on keyboard then press on 0160 in the key board, which create one blank space in ascii formate. Then concatenate this constant to your variable as many as you want times using the below code....

Do <n> times.

concatenate name constant into l_variable.

Enddo.

Rgds,

Bujji