Table redefinition

<< Click to Display Table of Contents >>

Navigation:  User guide > Tables >

Table redefinition

A table may be defined as often as required, but a redefinition cannot alter a table's type or size.

Table incrementation

All tables defined in a CL script are initialised to zero at the beginning of execution, unless run control parameter ADDTAB is set to allow them to be added to.

Every T (tabulate) command is an instruction to increment a table according the values of stub, banner and weights, for those records that reach it in the flow of execution (do not bypass the command as a result of a FILTER, UL, IF or GO TO). Incrementation will be inhibited if format NITB (No Increment Table) is used; this is often done to set up a table matrix for later use.

A table may be incremented as often as required in a CL script; records are added into the table (and do not replace data already there). Individual rows, columns and cells may be incremented if stub and banner are numbers.

Table manipulation

A MT (manip table) command is an instruction to set the cells of the table to a set of figures, which may be derived from other already incremented tables.

Each MT command for a table (or part-id) replaces the contents of the table (or part-id) unless the command is skipped due to the execution of an IF, UL or GO TO command. The contents may be updated using a self-referring expression. For example:

mt #7 = #7 * 2.0,

Which multiplies all cells in table 7 by two. Self-reference is not allowed in the first definition of a table.

IF, UL, ELSE and GO TO commands may be used so that different definitions of the same table do not overwrite each other.