FOR loop in ACE - bug?
Posted in 1992
Topics: Storage & Space Management, Stored Procedures & SPL
Hi folks! I've come across a very annoying bug in Informix's report writer. Have any of you had similar experiences, and what was your workaround? Mine was to split the report into two and link them using a shell-script. Not very satisfactory, since it takes twice as long, and still approaches the size/complexity limit for ACE. Anyway, here's the scenario: {Extract of report to perform repeated summations of columns for a period} VARIABLE mx integer {month} VARIABLE yx integer {year} VARIABLE sm integer {start month} VARIABLE em integer {end month} ... LET sm=4 LET em=12 ... ON LAST ROW FOR yx = 1992 TO 1993 DO BEGIN IF yx=1993 THEN BEGIN {yes, I know this is logically a bit messy ...} LET sm=1 LET em=3 END FOR mx = sm TO em DO BEGIN {A} LET totalA = GROUP TOTAL OF columname WHERE month=mx AND year=yx ... <lots of code> ... PRINT ..... END {B} END The FOR loop control values work and are PRINTed ok, but the GROUP TOTALs don't work as they should. The columns "month" and "year" are both integer types, so match those of "mx" and "yx". My only recourse was to scrap the FOR loops and duplicate the large chunks of code between {A} and {B} (12 times!), substituting the appropriate values for mx and my. This meant that the report exceeded ACE's size/complexity limit, and had to be coded as two reports, reporting to separate files, ultimately linked by a shell-script. FOR loops in ACE are claimed by the manual to be valid, and I can't see any errors in the code above (types,syntax etc..). I am very annoyed with INFORMIX! The only potentially mitigating factor is that we've got an old release of INFORMIX. But even then ....! Grrrr! -- Ivan Hans Mark Reid Management Information Systems Analyst "Information is Power ..." Spider Systems Ltd vox: (+44 31) 554 9424 Spider Park, Stanwell St fax: (+44 31) 554 0649 Edinburgh EH6 5NG, SCOTLAND