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

Getting spaces in a variable

Former Member
0 Likes
575

Hi,

I want 15 spaces as a variable we can do it like this ' '.

Supppose I want to get 100 spaces in one variable then how best can I do it.

We can do it in a loop.But is there any better solution.

Regards,

Subhashini

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
545

Hi,

Define a variable of char type.

data v_tmp type char150.

v_tmp+100 = 'abcdefgsdjknsdnsdn'.

This way variable will have 100 spaces first and then abcde....

Regards,

NaPPy

4 REPLIES 4
Read only

Former Member
0 Likes
546

Hi,

Define a variable of char type.

data v_tmp type char150.

v_tmp+100 = 'abcdefgsdjknsdnsdn'.

This way variable will have 100 spaces first and then abcde....

Regards,

NaPPy

Read only

NAeda
Contributor
0 Likes
545

Hi subhasini,

Can you just elaborate more.!

rgds

Aeda

Read only

former_member156446
Active Contributor
0 Likes
545

you need to follow some thing like this :

data: v_source(10),

v_material(8),

v_space(9),

v_spec value '#',

v_spclen type i.

v_spclen = 10 - STRLEN( v_source ).

DO v_spclen TIMES.

concatenate v_space v_spec into v_space.

ENDDO.

CONCATENATE v_source v_material INTO v_string seprated by v_space.

translate v_string using '# '.

[ref>>|;

Read only

Former Member
0 Likes
545

you can try this:

data: lv_var type string.

do 100 times.

concatenate lv_var space into lv_var SEPARATED BY space.

enddo.