Example 8.10 Adding Rows to a Table So That All Possible Values of Specific Columns Are Present in Each BY Group

Goal

Add rows to a table so that all possible combinations of specific columns are present in each BY group in the output table. The columns that are not used to define the combinations will have missing values.

This example is similar to Example 8.9 in that it fills out BY groups so that there is the same number of rows in each BY group and each BY group has the same combinations of specific variables. It differs from Example 8.9 in that the columns that define the combinations are character columns and not columns with sequential numeric values. Sequential numeric values as in Example 8.9 are straightforward to program with arrays ...

Get Combining and Modifying SAS® Data Sets: Examples Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.