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: 

length of field

Former Member
0 Kudos

hai how to find a char field length in a program in runtime pls

1 ACCEPTED SOLUTION

amit_khare
Active Contributor
0 Kudos

use STRLEN Command.

v_len = STERLEN (v_char).

Regards,

Amit

Reward all helpful replies.

4 REPLIES 4

Former Member
0 Kudos

Hi Sen,

Use STRLEN.

strlen will give string length.

Returns the length of a character-type field in characters. With c-fields, as opposed to fields with type STRING, only the actual length used is relevant because blanks at the end are not counted.

DATA: STRING(25) VALUE ' one two three four',

LEN TYPE I.

LEN = STRLEN( STRING ).

WRITE: STRING, '!'.

WRITE: / 'Length: ', LEN.

Thanks,.

amit_khare
Active Contributor
0 Kudos

use STRLEN Command.

v_len = STERLEN (v_char).

Regards,

Amit

Reward all helpful replies.

Former Member
0 Kudos

Hi ,

You can use STRLEN command

PLease reward if useful.

Former Member
0 Kudos

Hi

data : str(10) type c, len type I.

len = STRLEN ( STR ).

gives the length of the string

Regards

Anji