You want to use the REPEAT function, as discussed in the Getting Started chapter of my book. Several examples are here: http://blogs.sas.com/content/iml/2012/06/27/create-an-id-vector-for-repeated-measurements/ For the first two columns, you should read about the very useful Define2DGrid function, which wraps up some of the REPEAT and SHAPE functionality: http://blogs.sas.com/content/iml/2011/01/21/how-to-create-a-grid-of-values/ You can use that function to generate the indices for the first two columns: ij = Define2DGrid(1, 3, 3, 1, 3, 3); i = ij[,1]; j = ij[,2]; rname={a b c}; cname = {i j k}; c1 = rname ; c2 = cname;
... View more