CC12
%Addval: A SASŪ Macro which completes the Cartesian Product of dataset observations for all values of a selected set of variables.

Richard L Schiefelbein, PRA International


It is often useful in clinical programming to create additional observations to add to an existing dataset as "placeholders." These additional observations then complete the "Cartesian product" of the combinations of all values for a selected set of vari ables. For example, the output dataset from the PROC FREQ analysis of count data does not include observations for combinations of variables that are not present in the input data, but may still be of interest (i.e. the result dataset does not include an observation with a count value of "0" for "Caucasian/Females" if that particular combination is not present in the input data). This macro is a very flexible tool which allows one to quickly and easily create additional "combination" observations in dataset. Not only will it create observations for all combinations of values for a selected group of existing variables, but entirely new variables, with predetermined values as needed, may also be created in the output dataset. The final resultin g dataset will then include the "Cartesian product" of all values for the set of variables specified as well as any additional placeholders needed.