|
From: Fred M. <fr...@mo...> - 2005-08-18 18:24:49
|
Jim Morcombe wrote: > > Here is a "cut down" listing of a program. > > The Working Storage variable, "DISPLAY-SELECTIONS" is defined a little > stranglely, but I think it should be legal. > > If I add the "03 FILLER." that the programmer forgot, then the program > compiles without an error. Without this "03 FILLER", the compiler > reports an error message when the variable S01-SELECT-LINE() is used. > > 000100 IDENTIFICATION DIVISION. > 000300 PROGRAM-ID. rgmssch. > 001200 ENVIRONMENT DIVISION. > 001700 > 001900 DATA DIVISION. > 002100 FILE SECTION. > 002300 > 002500 WORKING-STORAGE SECTION. > 003400 01 DISPLAY-SELECTIONS. > * When the following line is commented out, the compiler > * returns an error. > * 03 FILLER. > 003600 05 ROW-DISPLAY-SELECTIONS PIC 99 > 003700 VALUE ZERO. > 03 SC-S01-SELECT-LINE OCCURS 12 TIMES. > 05 S01-SELECT-LINE PIC X(17). I'm glad the compiler returns an error in case of the missing line with the 03 level. While I cannot find this described in the standard nice teachers learned me in the past that a certain form of symmetry is supposed with regard to the level numbers. in the above structure the level-number 02 cannot be used while 04 is acceptable. On the other hand, the level-number 03 for ROW-DISPLAY-SELECTIONS would be quite usable and removes the need for the FILLER line. -- Fred Mobach - fr...@mo... - pos...@mo... Systemhouse Mobach bv - The Netherlands - since 1976 website : http://fred.mobach.nl Q: servos ad pileum vocare ? A: servos fenestrae ad pileum rubrem vocare ! |