18.10.2014 Views

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

SIMSCRIPT II.5 Programming Language

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Programming</strong> <strong>Language</strong> Concepts<br />

A final feature makes it possible to include row, as well as column, summarizations, in reports using<br />

the column repetition feature. This is done by adding a clause to the print statement that suppresses<br />

a part of the output for each line, until all column repetition data have been printed. A typical<br />

use of this feature is illustrated as follows:<br />

begin report printing<br />

for J = 1 to M, in groups of 10 per page<br />

print 1 line with a group of X(I,J) fields, SUMX(I)<br />

suppressing from column 70 as follows<br />

* * * * * * * * * * ****<br />

end '' OF REPORT<br />

Column 70<br />

If M = 30, three sets of column indices will be generated; the above format line will be repeated<br />

three times, on three separate pages. Only on the last page, however, will the last format be used,<br />

and the value SUMX(I) printed. The suppressing clause specifies that the printing of any data<br />

formatted to appear from column 70 onward is to be inhibited until all the column index values have<br />

been used. This applies both to data and and to any text literals appearing in the format specification.<br />

The three pages printed by the above statements are shown in figure 3-5.<br />

The following program segment illustrates the skeleton of the report section of a program that generates<br />

the report shown in figure 3-5. The report produces a table of shipment amounts from 120<br />

BASES to 60 DEPOTS, together with totals for each BASE and DEPOT and a grand total of all shipments,<br />

to produce an output report on double-width paper.<br />

133

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!