Table look up definitions

<< Click to Display Table of Contents >>

Navigation:  Reference > Commands >

Table look up definitions

A table look up definition command takes the form:

DW wvar = svar (table),

Here wvar is assigned the value of the cell of table where the true bit in svar is used to determine which cell to use. So if bit 1 in svar is set, wvar is set equal to the first cell of the table (R1,C1), bit 2 second cell (R1,C2), and so on. If the svar is empty (value 0), then the wvar is set undefined. The cells are regarded as being numbered across the table and then down row by row, not including the total row/column. So if a table has 10 rows (plus total) and 4 columns (plus total), the fifteenth cell is row 4 column 3.

IMPORTANT: the cell numbering in this form of definition (ignoring the total column and total row of the table) is a non-standard case. R0 and C0 are ignored to facilitate the use of a matrix definition for the svar. Elsewhere in CL, total rows and columns are counted in the numbering of cells.

This definition type is used for weighting to targets. It is used to extract the relevant weighting factor from the table of factors. The table of factors is usually calculated by dividing a table of targets by a table of actuals.

The table should normally have been given values in an earlier stage. It is possible to transfer values from the current stage, but if this occurs in a Tables Stage, then run control parameter NOLOOP must be used.

Note also that the table used is always the weighted table, if both a weighted table and an unweighted table are present.

Example of a table look up definition command:

ds $sadd=$row.by.$col,

dw $wfrac=$sadd(#fac),