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



Thanks for the explanation Barbara

I like to understand these things :-)

regards,
Craig

On 14 June 2018 at 23:44, Barbara Morris <bmorris@xxxxxxxxxx> wrote:

On 2018-06-14 9:45 AM, dlclark@xxxxxxxxxxxxxxxx wrote:

I call it "tricking" the compiler because using a prefix with a
period in it creates a qualified variable that is not actually qualified
in the resulting I-specs. Thus, the compiler ends up generating the same
storage addresses for his separate data structure where the variables
*are* qualified.


The variables _are_ qualified in the resulting I-specs. So the I specs
refer to the actual qualified data structure. You do have to define the
qualified data structure, though.

Remember that I specs are not definitions. They basically describe move
operations from the buffer to the program field. But they can seem to act
as definitions, because the compiler will usually generate a definition for
the field if it's not explicitly defined in the source. ("Usually", because
the compiler won't generate a definition for a qualified data structure
implied by a PREFIX keyword with a period in it.)

S o u r c e L i s t i n g
1 dcl-f #junkf prefix('DS.');
*--------------------------------------------------------------
* RPG name External name
* File name. . . . . . . . . : #JUNKF BMORRIS/#JUNKF
* Record format(s) . . . . . : REC REC
*--------------------------------------------------------------
2 dcl-ds ds extname('#JUNKF') qualified end-ds;
*--------------------------------------------------------------
* Data structure . . . . . . : DS
* External format . . . . . : REC : BMORRIS/#JUNKF
*--------------------------------------------------------------
3=D FLD1 10A
4=D FLD2 10A
5
6=IREC
*-----------------------------------------------------
* RPG record format . . . . : REC
* Prefix . . . . . . . . . . : DS. : 0
* External format . . . . . : REC : BMORRIS/#JUNKF
*-----------------------------------------------------
7=I A 1 10 DS.FLD1
8=I A 11 20 DS.FLD2

--
Barbara


--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
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: http://amzn.to/2dEadiD


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.