You have an answer, however is the output you post the best way forward? I mean, how are you going to know what the variables are called, there doesn't appear to be a logical assignment. Why not, if you have to transpose the data at all, creat the variables as a generic, then assign labels to the generic variables, this will make further processing far easier for you:
proc transpose data=have out=want;
by product;
var resp;
label=subject;
run;
What you will get is a dataset, something like:
PRODUCT VAR1 VAR2 VAR3 VAR4
...
With VAR1 label as _4, VAR2 as _7 etc.
Then in your programming you can refer to var1-var4, or as an array of var{4}. None of which you can use if you don't know the variables.
... View more