Application Development 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: 

removing comma

Former Member
0 Kudos

Hi experts,

DATA:G_LIFTS(20).

Using G_LIFTS variable iam trying to display some numbers like 2,12,<b>13,</b>

Here i want to remove ',' in the last.

SHIFT G_LIFTS RIGHT DELETING TRAILING ','.

why the above statement is not working...

thanks

kaki

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Just write these lines,

data: var type i.

i = strlen( G_LIFTS ).

i = i - 1.

G_LIFTS = G_LIFTS+0(i).

write: G_LIFTS.

this will work.

please close this if this solves the Problem

thanks

Sudheer

7 REPLIES 7

Former Member
0 Kudos

Kaki,

Try using a REPLACE command.

REPLACE <str1> WITH <str2> INTO <c> [LENGTH <l>].

Regards,

Ravi

Former Member
0 Kudos

hi

good

use it like this

DATA: T(14) VALUE ' abcdefghij',

STRING LIKE T,

STR(6) VALUE 'ghijkl'.

STRING = T.

WRITE STRING.

SHIFT STRING LEFT DELETING LEADING SPACE.

WRITE / STRING.

STRING = T.

SHIFT STRING RIGHT DELETING TRAILING STR.

WRITE / STRING.

thanks

mrutyun

Former Member
0 Kudos

Hi,

Just write these lines,

data: var type i.

i = strlen( G_LIFTS ).

i = i - 1.

G_LIFTS = G_LIFTS+0(i).

write: G_LIFTS.

this will work.

please close this if this solves the Problem

thanks

Sudheer

0 Kudos

Hi sudheer & srinivasa rao...

Points alloted.

thanks

kaki

Former Member
0 Kudos

Hi kaki,

Try this one.

data c type n.

c = strlen(g_lifts).

c = c - 1.

g_lifts = g_lifts+c.

regards,

srinivasarao oleti

Former Member
0 Kudos

Try this one.

data c type n.

c = strlen(g_lifts).

c = c - 1.

g_lifts = g_lifts+0(c).

regards,

srinivasarao oleti

Former Member
0 Kudos

Hi Kaki,

chk this out..

DATA: ALPHABET(15) VALUE ' ABCDEFGHIJ',

M1(4) VALUE 'ABCD',

M2(6) VALUE 'BJJCA '.

SHIFT ALPHABET LEFT DELETING LEADING M1.

The field ALPHABET remains unchanged.

SHIFT ALPHABET LEFT DELETING LEADING SPACE.

The field ALPHABET now has the following contents:

'ABCDEFGHIJ '.

SHIFT ALPHABET RIGHT DELETING TRAILING M2.

ALPHABET now has the following contents:

' ABCDEFGHI'.

Regards,

Bikash