"RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxx> wrote on 06/14/2018 06:44:44
PM:
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.
OK, I understand. But, from the perspective of the next
programmer coming along, it is "tricking" the compiler because it is not
clear/obvious what is going on -- because it is not usual to use a prefix
with a period in it. Because, usually, the resulting I-specs are not
actually qualified. Here is my compile listing to demonstrate what I am
saying.
4 dcl-f MyFile disk extfile(*extdesc) prefix('CHE.')
5 extdesc('SHR460/IMLFCMPT');
*---------------------------------------------------------------
* RPG name External name
* File name. . . . . . . . . : MYFILE SHR460/IMLFCMPT
* Record format(s) . . . . . : IMLFCMPRF IMLFCMPRF
*---------------------------------------------------------------
6
7=IIMLFCMPRF
*---------------------------------------------------------------
* RPG record format . . . . : IMLFCMPRF
* Prefix . . . . . . . . . . : CHE. : 0
* External format . . . . . : IMLFCMPRF : SHR460/IMLFCMPT
*---------------------------------------------------------------
8=I I 1 8 0CHE.IMLFCMPTID
9=I I 9 16 0CHE.CICOMPPTID
10=I I 17 24 0CHE.IMLFSEQTID
11=I (ALWNULL) P 25 31 2CHE.BOYEXTTTL
12=I (ALWNULL) P 32 38 2CHE.YTDEXTTTL
13=I (ALWNULL) P 39 42 4CHE.EXTIDX
14=I (ALWNULL) P 43 46 4CHE.ABSRTO
15=I (ALWNULL) Z 47 72 CHE.TMSLSTEXT
16=I (ALWNULL) Z 73 98 CHE.TMSLSTLRL
17=I (ALWNULL) Z 99 124 CHE.TMSLCLCMP
18=I (ALWNULL) Z 125 150 CHE.TMSCRPACT
19=I *VAR A 151 170 CHE.ADDBYUSR
20=I (ALWNULL) *VAR A 171 182 CHE.ADDBYPGM
21=I Z 183 208 CHE.ADDTS
22=I *VAR A 209 228 CHE.CHGBYUSR
23=I (ALWNULL) *VAR A 229 240 CHE.CHGBYPGM
24=I Z 241 266 CHE.CHGTS
25=I (ALWNULL) A 267 267 CHE.LIFOYN
Sincerely,
Dave Clark
As an Amazon Associate we earn from qualifying purchases.