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



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


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.