Sorry to bother, but I only work on the AS400 about twice a year and
so far have not found an answer on the Internet.
Could someone quote me a definition for a legal filename. I've heard
that the maximum length is 8 characters, however it's certainly 10 in
PDM. Also, is it illegal to start a name with a digit?
Any help would be most appreciated.
Elliot
> Hi All
Hello Elliot
>
> Sorry to bother, but I only work on the AS400 about twice a year and
> so far have not found an answer on the Internet.
>
> Could someone quote me a definition for a legal filename. I've heard
> that the maximum length is 8 characters, however it's certainly 10 in
> PDM. Also, is it illegal to start a name with a digit?
>
I suppose you are talking about object type *FILE ?
Take a look at this document:
http://publib.boulder.ibm.com/infocenter/iseries/v6r1m0/index.jsp?topic
=/rbam6/rbam6names.htm
The file name maximum length in RPG programs (I do not remember if it
applies to all RPG releases, for example, free-format RPG but for sure
it applies up to RPG IV) is 8 characters.
> Any help would be most appreciated.
>
> Elliot
>
--
Cordialement
Marc Rauzier
(pour me r�pondre, ne pas utiliser le from mais le reply-to)
Thanks for the link. It gave all the information I needed
A la prochaine et merci
Elliot
Where in RPG IV is it limited to 8 characters? I use 10 all the
time. In RPG III or RPG/400 (I am not sure what the difference is
between those, if any), the limit is most definitely 8.
John
The link provided by Marc was a good one, though it's written from the
perspective of the operating system, which isn't the same as from the
main programming language, RPG. As already discussed, older versions
of RPG do not support names longer than 8 characters. Further, even
in modern RPG, some legal names are not good to use. The example I
can think of off the top of my head is names containing periods. If
you want to keep life simple for RPG programmers trying to use your
files, then safest would be to avoid both periods and names longer
than 8 characters.
John
Aside from compatibility with older programs,
*maximum length of a physical file name is 10
*MUST begin with a character (A-Z, @,#,$)
*"numerics" can be in the name after the first character (alphanumeric
-- L123456789 and $12345678P is legal)
> Where in RPG IV is it limited to 8 characters?
Nowhere, you are right.
I made a mistake about this point. My RPG usage is too much ancient now
:-)
Although the @,#,$ characters are "supported" in a /QSYS.LIB file
system name, they are highly discouraged for use in a name because
they are "variant" characters across the EBCDIC CCSID values.
The rules noted above also exclude the support for "quoted" names
in the /QSYS.LIB file system for which the effective limit in length
of a name is then 8 bytes. That is because the quote characters, as
delimiters, are included in the length of the name. These delimited
names allow the effective override to the numeric first rule such
that the name "9TIMES" is allowed, as well as for both lower case
characters and some special characters such that the name "9Times"
is also valid and distinct from the former name because folding to
upper case is suppressed for the alpha between the delimiters.
Other file systems will have different naming rules.
The database, via the SQL, has even different rules for the
database *FILE objects it creates in the /QSYS.LIB system. The
files with the longer names supported by the SQL are not directly
accessible by the /QSYS.LIB non-SQL interfaces because of the
different rules, and thus any long named file has a shorter name
that accommodates the /QSYS.LIB naming rules; generally the name is
chosen\specified in the SQL CREATE statement. The SQL CREATE TABLE
creates a database "Physical File", object type *FILE attribute PF.
There is an API plus the SQL catalog to get the corresponding name
from one to the other.
Regards, Chuck
Heck, I feel out of date using fixed-format RPGLE, and seldom using more
than one or two modules per program.
--
93. If I decide to hold a double execution of the hero and an underling
who failed or betrayed me, I will see to it that the hero is
scheduled to go first.
--Peter Anspach's list of things to do as an Evil Overlord
If you are going to refer to any object, then you are forgetting the
other file systems. A STMF in the /root file system for instance can
be much larger than 10 characters, can support unusual characters,
such as periods, spaces etc etc and I'm pretty sure it can start with
a number.
(Heck, it'll support stuff in the filename that you can't even TYPE on
most terminals...)
--
97. My dungeon cells will not be furnished with objects that contain
reflective surfaces or anything that can be unravelled.