!============================================================================= ! ! Code Sample, From "The Unofficial GEMBASE Home Page". ! http://members.tripop.com/GEMBASE/ ! ! This code fragment shows how to avoid one of the most frequent uses ! of the WHILE (1) coding error. In most cases we would advise against ! using the START_STREAM statement for this processs, instead we would ! advise using a PROCEDURE_FORM with a /TABLE qualifier. !============================================================================= ! . . . BEGIN_BLOCK READING_LOOP START_STREAM RC & /TABLE = ANY_TABLE & /LOCK = NONE ! Instead of using WHILE (1), do an initial read on the stream. ! FETCH RC WHILE ( %STATUS = %SUCCESS ) ! Now do the processing of the record. ! PERFORM SOME_PROCESSING ! Read another record, thus setting %STATUS for the WHILE ! condition test. FETCH RC END_WHILE END_BLOCK . . .