×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




EXTNAME simply retrieves the structure of the file at compile time...

So no, you don't have to re-compile the program unless you have a
requirement to pick up the new definition..

One such use case, you have _dynamic_ SELECT * SQL statement...

A static SELECT * isn't a problem given the way the pre-compiler works...

Though SELECT * in production is generally a bad idea.

As far as an END-DS, jon covered the reason...EXTNAME allows you to add
fields to the DS...

dcl-ds myds extname(mytable);
extraFld1 char(10);
extraFld2 char(15);
end-ds;

Assuming MYTABLE has 5 columns, the myDS structure above will have 7
subfields...

Charles

On Wed, Oct 16, 2019 at 10:43 AM Robert Jacobs <robertjacobsit@xxxxxxxxx>
wrote:

That's a great explanation. Thanks, Jon!

Are you also able to verify that, when using the extName keyword, a change
to the physical file would not require a re-compile of the program, unless
the change was to a field explicitly referred to?

Finally, I do still wonder why the end-ds is required for an extName
data-structure, but not a likeRec data-structure. It's not straight
forward what the issue is when encountered in RDi (when you leave out the
end-ds), so it took me a bit to even realize that's what was causing a
problem. I also had to account for extName template not being qualified (I
expected the template keyword to make the data-structure qualified
automatically) as opposed to the likeRec template being qualified by
default (a result of the likeRec keyword), but that's just a nitpick.



On Wed, Oct 16, 2019 at 10:11 AM Jon Paris <jon.paris@xxxxxxxxxxxxxx>
wrote:

I can't think of any real advantage to using the file approach - unless
you plan on passing the file as a parm - which is primarily what
templated
files are for.

The ExtName approach also has the advantage that additional fields and/or
redefinitions can be added to the DS. A LikeRec cannot be used in that
way.

--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


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