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



Hi Matt,

It is important to note that this only affects the size of the program object, not the size of the loaded program. It is not the external definition that is causing the increase in size but the number of fields (621 in your case) being included.

Since the data structure is based on a pointer, no storage is allocated for it and it does not take up any space at run time (bar the 16 bytes allocated for the never used pointer).

Paul

----- Original Message ----- From: "Tyler, Matt" <mattt@xxxxxxxxxxxxxx>
To: "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
Sent: Thursday, September 29, 2005 3:19 PM
Subject: RE: Prototype Field References


I have found that using an external data structure to base other
definitions on can greatly increase the program object size.  I have a
reference file with a record format size of 4748 bytes with 621 fields.
Using the following;

D TYPES_DS      E DS                  EXTNAME(RIMREFPF) BASED(@)
PREFIX(@)

I checked the size of the program object and it was over 800K.  If I
removed the external data structure and use explicitly define the
reference fields in the program, my program object size dropped by over
100K.

I have not totally stopped using external data structures for field
definition referencing, but it makes me stop and think about which one I
will use.

Thank you,
Matt Tyler
WinCo Foods, LLC
mattt@xxxxxxxxxxxxxx

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Marco Facchinetti
Sent: Thursday, September 29, 2005 2:26 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: Prototype Field References

About prototype definitions you can use the like keyword.
Our standard is to define the ds (dictionary) in all the programs, of
course
the ds is based on a pointer so there is no memory waste and since the
pointer is never set we cannot modify (and use) the fields.

E.g. d mydiz      e ds       based(p_mydiz)

This is working since we have a package and the srvpgm are for internal
use
only (we are not selling the service programs to somebody else). Of
course
if you have to distribute your programs this is not the right way.

HTH
Marco


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





As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.