08-14-2017 11:13 AM
I am having this dataset.*/
input Income_JUN $ count_jun percent_jun Income_MAY $ count_may percent_may;
0 2220613 100.00 0 2211243 100.00
>0 2 0.00 >0 2 0.00
/*I do a small calculation here*/
/*I do a transpose (thanks Art)*/
proc transpose data=have_1 out=want name=Income_JUN;
var count_JUN percent_JUN count_MAY percent_MAY DELTA ;
The data set generated by transpose is like below*/
But I want the dataset like below. That means counts are '000 separated and percentages are printed with % sign with 2 decimals. Could you help.
08-14-2017 11:22 AM
You need to convert them to text using PUT and the format you want.
A column can have only one type so this is the best way to do this.
Use an IF statement to check if it's count or percent based on the name and then use PUT to convert to the format you want.
sketch - not working code to get you started
IF name =: "count" then new_value = put(old_value, percent8.1);