I have a large data set and want to summarise the count and percent of a number of variables by site then output these values into a new data set with a single row per site. I have used the following code: ods output onewayfreqs=work.owf; proc freq data=euro1; tables f1q1 f2q3; by country site; run; ods listing; proc print data=work.owf; run; the output looks like this, with multiple rows per site Obs Country Site Table F_f1q1 f1q1 Frequency Percent F_f2q3 f2q3 1 UK 42 Table f1q1 A A 50 100 2 UK 42 Table f2q3 19 38 F F 3 UK 42 Table f2q3 31 62 M M 7 UK 50 Table f1q1 A A 50 100 8 UK 50 Table f2q3 22 44 F F 9 UK 50 Table f2q3 28 56 M M 13 Germany 75 Table f1q1 B B 50 100 14 Germany 75 Table f2q3 22 44 F F However, I would like to re-define the frequency and percent variables to relate to the corresponding variable value and to only have one row per site. i.e. this is what I want the data to look like: Obs Country Site freqf1q1A freqf1q1B percf1q1A percf1q1B freqf2q3F freqf2q3M percf2q3F percf2q3M 1 UK 42 50 100 19 31 38 62 2 UK 50 50 100 22 28 44 56 3 Germany 75 50 100 22 44 Any help would be much appreciated thank you! Catrin
... View more