Munich Personal RePEc Archive

SAS® Macros for Constraining Arrays of Numbers

Coleman, Charles (2015): SAS® Macros for Constraining Arrays of Numbers. Published in: Southeast SAS Users Group 2015 Proceedings

WarningThere is a more recent version of this item available.

Download (167kB) | Preview


Many applications require constraining arrays of numbers to controls in one or two dimensions. Example applications include survey estimates, disclosure avoidance, input-output tables, and population and other estimates and projections. If the results are allowed to take on any nonnegative values, raking (a.k.a. scaling) solves the problem in one dimension and two-way iterative raking solves it in two dimensions. Each of these raking macros has an option for the user to output a dataset containing the rakes. The problem is more complicated in one dimension if the data can be of any sign, the so-called “plus-minus” problem, as simple raking may produce unacceptable results. This problem is addressed by generalized raking, which preserves the structure of the data at the cost of a nonunique solution. Often, results are required to be rounded so as to preserve the original totals. The Cox-Ernst algorithm accomplishes an optimal controlled rounding in two dimensions. In one dimension, the Greatest Mantissa algorithm is a simplified version of the Cox-Ernst algorithm.

Each macro contains error control code. The macro variable &errorcode is made available to the programmer to enable error trapping.

Available Versions of this Item

Logo of the University Library LMU Munich
MPRA is a RePEc service hosted by
the University Library LMU Munich in Germany.