I would like to split the "condition" variable into different variables based on the list of coniditons and so that each row within the data is listed by the caseid and a value of "1" is given when the caseid has the condition and a "0" when they don't. I would like my data to appears as:
I have tried transposing the data using caseid as the "by" variable which results in a dataset where the list of conditions still remains as the observation and not as a variable label. I've also tried creating an array to input the data into. All to no avail. I would appreciate any advice on how to resolve this issue.
"now you just need a way to automatically rename the _Cn_ variables" -- there's not a way within PROC REPORT to do that. The RENAME option on the OUT= is the way. So if you wanted "automatically" you'd have to do it with macro techniques.
> How do we order the variables alphabetically?
I used ORDER=DATA because that is order the OP had used in his NEED data set. If you remove ORDER=DATA from my program the variables will be alphabetical.