Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
• Status: Solved
• Priority: Medium
• Security: Public
• Views: 458

# What is the maximum length for a char variable that i can have in RPG ile ?

What is the maximum length for a char variable that i can have in RPG ile ?
I think its 40..... is it correct ?
and is there any way in which i can have a char variable of length more than 40.
0
• 2
1 Solution

Commented:
Hi
I think it is 32766 - but after 10-15 who cares.

Here is how you define it

h
dthis_is_a_long_variable_name_that_excee...
dds_40_characters...
dthis_is_a_long_variable_name_that_excee...
dds_40_characters...
dthis_is_a_long_variable_name_that_excee...
dds_40_characters...
dthis_is_a_long_variable_name_that_excee...
dds_40_characters...
dthis_is_a_long_variable_name_that_excee...
dds_40_characters...
dthis_is_a_long_variable_name_that_excee...
dds_40_characters...
dthis_is_a_long_variable_name_that_excee...
dds_40_characters...
dthis_is_a_long_variable_name_that_excee...
dds_40_characters...
dthis_is_a_long_variable_name_that_excee...
dds_40_characters...
d                 S             25
c
c                   Eval      *inlr=*on

This defines on very long variable name

you can repeat the lines as many times as you want till you get a compiler error.

Let us know waht the value is - I don't realy care as it will make the program to hard to read.

Dave
0

Commented:
Looking at V5R2....

A symbolic name (includes variable names) can be upto 4096 characters (....I agree with Dave - anything over 20 characters except for occasional circumstances is a little extreme)

However - I think mayankgangrade may mean how many characters can a character variable hold ?

Maximum characters for a named variable is 65535 in RPG IV.

and

A named constant or literal is max characters of 1024.

Tony.
0

Commented:
Just had a quick look and same applies to V5R3 RPG IV.

Tony.
0

## Featured Post

• 2
Tackle projects and never again get stuck behind a technical roadblock.