Solved

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

Posted on 2005-05-14
441 Views
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

LVL 14

Expert Comment

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

LVL 9

Accepted Solution

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

LVL 9

Expert Comment

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

Tony.
0

## Featured Post

Outlook Free & Paid Tools
For Sennheiser, comfort, quality and security are high priority areas. This paper addresses the security of Bluetooth technology and the supplementary security that Sennheiser’s Contact Center and Office (CC&O) headsets provide.
Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…