11-15-2012 02:29 PM
I would like to transpose a one-row dataset which containts over 1000 columns. proc transpose seems to transpose only the numeric columns. I have read that i need to use VAR to define all character columns in order to transpose them. I have over 1000 columns so i was hoping to find a better way to transpose every column in the dataset. Below is the code i used. cust_data has 1023 variables. cust_data1 has 851 observations. 172 variables did not get transposed.
Thank you very much for you input !
proc transpose data= cust_data out=cust_data1;
11-15-2012 04:34 PM
When transposing mixed var lists the numeric variables are converted to numeric using their associated formats. Very powerful, like a VVALUE en masse.
11-16-2012 01:45 PM
Here is a like to an application:
This example is a bit contrived.
11-15-2012 02:48 PM
I think you will have to do two transpositions. One for numeric and one for character variables. Something like this :
input a$ x b$ y c$ z;
1 2 3 4 5 6
proc transpose data=have out=haven;
proc transpose data=have out=havec;
length col1c $12;
col1c = strip(put(col1, best12.));
set havenc(rename=col1c=col) havec(rename=col1=col);
Need further help from the community? Please ask a new question.