× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Jerry,

What Jon is referring to (as I interpreted it) is that in fixed format RPG you can do the following:


D myDS          E DS                  ExtName(XXXX)


In this case, XXXX is interpreted by the RPG compiler as the name of the file to get the external definitions for, and is not case-sensitive.  Whereas in free-format, you have to do the following:


dcl-ds myDS ext extfile('XXXX') end-ds;


The quotes are required because without the quotes CUSTMAS would be interpreted as a named constant.  And the quotes make it case-sensitive.


But, I believe Jon mistakenly applied it to ExtFile and ExtDesc, which never allowed it to be interpreted as the filename without the quotes.  You are actually saying the same thing that I am, except that you are approaching it from the perspective of using a variable for the filename -- the opposite perspective that the OP used, and opposite of what Jon was referring to when he said it now requires quotes.


FMYFILE    IF   E             DISK    ExtFile(XXX)  <-- XXX is treated as a variable name.


or


dcl-f MYFILE disk extfile(XXX);


In both cases it is interpreted as a VARIABLE, it's never interpreted as the file name.  It will get the name from the contents of the variable, which is exactly what you're saying. And that's sort of my point -- ExtFile and ExtDesc have always required quotes, otherwise it is treated as a variable name.


If you want it to be treated as a literal, which is what the OP was doing, then it needs to be quoted and will be case-sensitive.


FMYFILE    IF   E             DISK    ExtFile('XXX') <-- XXX is treated as a case-sensitive file name




On 8/10/24 5:19 AM, Jerry Adams wrote:
I have never used quotes (single or double) around ExtFile, rather
ExtFile(MyFile) and, then defined MyFile in D-specs as 10A. Thinking about
it this early in the morning, the reason I do that is because most of my
files are legacy S/34/36 files with a group id, such as A.MYFILE and
B.MYFILE. So once I know which company the program is running over, I can
build in my initialization routine, such as MyFile = group + '.MYFILE' and
only then OPEN MYFIE.

In other words, if the F-Spec name is the same as the file/table on disk, I
do not use ExtFile; why would I?

Jerry C. Adams
IBM i Programmer/Analyst
Umpires should be natural Republicans - dead to 'human feelings'. - George
Will
--
NMM&D
615-585-2175

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of
Scott Klement
Sent: Saturday, August 10, 2024 12:27 AM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: Re: Extfile and ExtDesc

ExtFile and ExtDesc have always required quotes and always been
case-sensitive.

You are thinking of ExtName that once allowed unquoted names.

On 8/7/24 3:29 PM, Jon Paris wrote:
Just as a general FYI ...

When RPG changed to accept named constants for file names etc. it became a
requirement to place literal names in quotes. That also means of course that
they must also be in upper case.

Jon P

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.