The COMPUTAB Procedure

INIT Statement

INIT anchor-name [locator-name] values [locator-name values] ;

The INIT statement initializes values in the COMPUTAB data table at the beginning of each execution of the procedure and at the beginning of each BY group if a BY statement is present.

The INIT statement in the COMPUTAB procedure is similar in function to the RETAIN statement in the DATA step, which initializes values in the program data vector. The INIT statement can be used at any point after the variable to which it refers has been defined in COLUMNS or ROWS statements. Each INIT statement initializes one row or column. Any number of INIT statements can be used.

The first term after the keyword INIT, anchor-name, anchors initialization to a row or column. If anchor-name is a row name, then all locator-name values in the statement are columns of that row. If anchor-name is a column name, then all locator-name values in the statement are rows of that column.

The following terms appear in the INIT statement:

anchor-name

names the row or column in which values are to be initialized. This term is required.

locator-name

identifies the starting column in the row (or starting row in the column) into which values are to be placed. For example, in a table with a row SALES and a column for each month of the year, the following statement initializes values for columns JAN, FEB, and JUN:

   init sales jan 500 feb 600 jun 800;

If you do not specify locator-name values, the first value is placed into the first row or column, the second value into the second row or column, and so on. For example, the following statement assigns 500 to column JAN, 600 to FEB, and 450 to MAR:

   init sales 500 600 450;
+n

specifies the number of columns in a row (or rows in a column) that are to be skipped when initializing values. For example, the following statement assigns 500 to JAN and 900 to JUL:

   init sales jan 500 +5 900;
n*value

assigns value to n columns in the row (or rows in the column). For example, both of the following statements assign 500 to columns JAN through JUN and 1000 to JUL through DEC:

   init sales jan 6*500 jul 6*1000;
   init sales 6*500 6*1000;