Wierd 4GL Bug
Posted in 1992
Ok folks, here is one for the 4GL wierd bug hall of fame. I have a report
that I am working that refuses to compile cleanly. The relevent code is
below:
REPORT trkcgrprp(r_rec, r_location, r_old_date, r_new_date,
r_old_time, r_new_time)
DEFINE
r_rec RECORD
trancode CHAR(1),
sitecode LIKE trte_cgrp_temp.sitecode,
rep_date LIKE trte_cgrp_temp.rep_date,
rep_time LIKE trte_cgrp_temp.rep_time,
job_num LIKE trte_cgrp_temp.job_num,
sitecodeb LIKE trte_cgrp_temp.sitecodeb,
cgrp LIKE trte_cgrp_temp.cgrp,
grpapri LIKE trte_cgrp_temp.grpapri,
grpa1 LIKE trte_cgrp_temp.grpa1,
grpa2 LIKE trte_cgrp_temp.grpa2,
grpa3 LIKE trte_cgrp_temp.grpa3
END RECORD,
r_location LIKE site_xref.location,
r_old_date DATE,
r_new_date DATE,
r_old_time DATETIME HOUR TO SECOND,
r_new_time DATETIME HOUR TO SECOND,
r_dashline CHAR(80),
first_time SMALLINT,
tof SMALLINT
OUTPUT
LEFT MARGIN 0
ORDER BY r_rec.trancode
When the program containing this code is compiled, the following errors occur
in step 2 of the compile:
|
| The following errors were discovered during compilation.
|
|fglc2: file "trkcgrprp.ec", line 3118: type 'p3' is unknown
|fglc2: file "trkcgrprp.ec", line 3129: type 'p14' is unknown
|fglc2: file "trkcgrprp.ec", line 3130: type 'p15' is unknown
|fglc2: file "trkcgrprp.ec", line 3131: Host object 'p3' not declared
|fglc2: file "trkcgrprp.ec", line 3131: Syntax error on identifier 'p4'. (sqlhos
t.y)
|5 errors found
|
Here are the relevent lines in the ec file:
${
$ static char p0[2];
$ static char p1[4];
$ static date p2;
$ static p3;
$ static char p4[11];
$ static char p5[4];
$ static short p6;
$ static short p7;
$ static short p8;
$ static short p9;
$ static short p10;
$ static char p11[21];
$ static date p12;
$ static date p13;
$ static p14;
$ static p15;
$ fetch c_trkcgrprp into $p0 , $p1 , $p2 , $p3 , $p4 , $p5 , $p6 , $p7 ,
$p8 , $p9 , $p10 , $p11 , $p12 , $p13 , $p14 , $p15;
Notice that in the structure above, 'p3', 'p14', and 'p15' are not defined.
These are the 'DATETIME' variables. If I take out the 'ORDER BY' clause,
the thing compiles clean. I fixed the problem by defining the 'DATETIME'
variables as 'CHAR (8)', but still, this bothers me. Does this occur in
releases other than 4.0? Any comments would be appreciated.
-----------------------------------------------------------------------------
Bob Kane Internet: bob@worms-emh2.army.mil (IP 134.235.9.2)
TechDyn Systems Voice: (049) 6241-75936 (WORMS, GERMANY)
CMR 421, BOX 706 Fax: (049) 6241-500154
APO AE 09056