Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Legal Physical File name

285 views
Skip to first unread message

Elliot

unread,
Dec 10, 2009, 3:24:58 PM12/10/09
to
Hi All

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

Marc Rauzier

unread,
Dec 10, 2009, 3:46:47 PM12/10/09
to
Elliot �crivait dans news:f39d842e-1acb-4bb0-9dfd-
f9efb9...@d21g2000yqn.googlegroups.com ce qui suit:

> 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)

Elliot

unread,
Dec 10, 2009, 3:57:46 PM12/10/09
to
Hi Marc

Thanks for the link. It gave all the information I needed

A la prochaine et merci

Elliot

John Yeung

unread,
Dec 11, 2009, 2:17:53 AM12/11/09
to
On Dec 10, 3:46 pm, Marc Rauzier <marc.vers.d...@free.fr> wrote:
> 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.

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

John Yeung

unread,
Dec 11, 2009, 2:26:59 AM12/11/09
to
On Dec 10, 3:24 pm, Elliot <esel...@gmail.com> wrote:
> 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?

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

JTF

unread,
Dec 11, 2009, 9:43:27 AM12/11/09
to
On Dec 10, 3:24 pm, Elliot <esel...@gmail.com> wrote:

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)

Marc Rauzier

unread,
Dec 11, 2009, 12:50:37 PM12/11/09
to
John Yeung �crivait dans news:df8ddf3e-52f5-45f9-a40f-
3e3c6d...@9g2000yqa.googlegroups.com ce qui suit:

> 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
:-)

CRPence

unread,
Dec 11, 2009, 12:54:19 PM12/11/09
to
JTF wrote:
> On Dec 10, 3:24 pm, Elliot <esel...@gmail.com> wrote:
>>
>> 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.
>
> 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 are legal names)

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

Peter H. Coffin

unread,
Dec 11, 2009, 1:27:08 PM12/11/09
to
On 11 Dec 2009 17:50:37 GMT, Marc Rauzier wrote:
> John Yeung �crivait dans news:df8ddf3e-52f5-45f9-a40f-
> 3e3c6d...@9g2000yqa.googlegroups.com ce qui suit:
>
>> 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

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

Grim

unread,
Dec 11, 2009, 3:22:49 PM12/11/09
to
Your not finding an answer because there are no requirements for file
names. Your looking for the wrong info. Everything on the ISeries is
an object. This is something that a lot of people always forget. There
are different types of objects but they are all basically the same
thing, a memory address. What you should be looking for is "Object
Naming Rules". All objects are max length 10 Alphanumeric characters.
Some characters you cannot use like ,":()^!@ You cannot start an
object with a number.

jsev99

unread,
Dec 13, 2009, 4:36:59 PM12/13/09
to

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.

Peter H. Coffin

unread,
Dec 13, 2009, 10:10:55 PM12/13/09
to

(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.

0 new messages