/*varcut macro by Kaz Uekawa www.estat.us Jan 2005 SAS PROC MIXED has a defect where, when you have many class variables, the coefficient table come out very wide horisontally. This macro will clearn up the messy table and keep it small. How to use this: a) You place this file itself in C:\temp. b) You will need the following four lines in your SAS syntax after PROC MIXED run. The PROC MIXED syntax should include an ODS statement as in the following example. _soln is the name I chose here, but any name can be used. If I use _soln, I will get _soln2 as a result data set. Its content will be printed out, so you will be able to read a more concise coefficient table. PROC MIXED.. ods output solutionF=_soln; run; %let soln=_soln; %include "C:\temp\varcut.txt"; filename this "C:\temp\this.txt" lrecl=2000; %include this; */ proc contents data=&soln; ods output Variables=asdf0; run; data asdf;set asdf0; keep variable; if type="Char"; if variable ne "Effect"; run; proc transpose data=asdf out=asdf2; var variable; run; proc print data=asdf2; run; data asdf3; set asdf2; /*make sure all class variables are here*/ sen="||"; con="compress("; kakko =");"; ending=";"; length code $ 300; desc="desc="; x=compress(desc||con|| col1 ||sen|| col2||sen ||col3||sen ||col4||sen ||col5||sen ||col6||sen ||col7||sen ||col8||sen ||col9||sen ||col10||sen ||col11||sen ||col12||kakko); code=translate(x,"i","."); droppp="drop "; q=(droppp|| col1 ||col2 || col3 || col4 ||col5 ||col6 ||col7 ||col8 ||col9 ||col10 ||col11 ||col12 ||col13 ||col14 ||col15 ||ending); code2=translate(q,"i","."); code3="desc=compress(desc,.);"; keep code code2 code3; run; data _null_2; set asdf3; file "c:\temp\this.txt" lrecl= 3000; put "data &soln.2;retain effect desc estimate StdErr sign DF tValue Probt; set &soln;"; put code; put code2; put code3; put "length sign $ 3;"; put "sign=''; " ; put "if probt < 0.1 then sign='+'; " ; put "if probt < 0.05 then sign='*'; " ; put "if probt < 0.01 then sign='**'; " ; put "if probt < 0.001 then sign='***';" ; put "if probt < -999 then sign=' ';" ; put "run;"; put "proc print data=&soln.2;title 'Coefficients';run;"; run; filename this "C:\temp\this.txt" lrecl=2000; %include this;