0
votes

I have the following homework question in SAS. I am given twelve variables, each with a single observation (they are in an excel spreadsheet), and my assignment is to convert them into a single variable with twelve observations without use of proc transpose. This seems like it should be a simple exercise in records management, using arrays, but neither me nor my classmates can figure it out. Any help would be greatly appreciated.

1
Assuming you have read the excel data into a SAS data set, this looks like a data step exercise. Put all of the variables into an array (look up the ARRAY statement in SAS documentation). Loop over the array with a DO loop, setting your new variable equal to the array variable and outputting a row in each iteration of the DO loop. Can help further if you give this a try on your own and you get stuck somewhere.DWal
Look through some of the other Stack Overflow questions in sas with transpose keyword. Some of them will show exactly this method.Joe

1 Answers

-1
votes

You can concatenate all variable and assign value to required variable.