BookmarkSubscribeRSS Feed
Pyrite | Level 9

When I request submit PROC FREQ code that requests a three-way table, each formatted level of the first named variable produces a separate two-way table of the last two variables named on the Tables statement.  In order for the output to be useful, the formatted value of the first named variable SHOULD BE printed above each constructed table.  I used to get a line saying "Controlling for ..." to indicate what value(s) of the first named variable produced a specified cross-tabulation.  I no longer get the "Controlling for ..." message.


I presume that there is some sort of option or environmental variable that is causing the "Controlling for ..." statement to be suppressed.  Any idea what that option/environmental variable might be?


For instance, if I have three variables, A, B, and C with A taking on values 1, 2, and 3, and I submit the code:


proc freq data=mydata;

  tables a*b*c;



I should get three tables of B*C for each of the three levels of A.  The first table should be preceded by the text "Controlling for A=1", the second preceded by "Controlling for A=2", and similarly for the third table.  I do not get such text now.  How do I restore such text?

Super User

Have you are anyone modified the templates use by Proc Freq for tables?


Do you have an entry for CROSSTABFREQS in any template path other than in SASHELP.Tmplbase?

In the results window right click on Results and select Templates from the menu. Do you have anything that starts with a name other than SASHELP? If that template repository, likely SASUSER.TMPLAT contains a CROSSTABFREQS that is a likely culprit.


Or run this code:

proc template;
   path show;

The default result in the log would look like:



If you have another path, especially if it has a lower number than SASHELP.TMPLMST, that may have another CROSSTABFREQS.



You can set your system to ignore templates not created by SAS by using either

proc template;
   path verify;

Or if you find the modified template ensure that it has this code in the template:


      define ControllingFor;                                                  
         dynamic StratNum StrataVariableNames StrataVariableLabels;           
         text "Controlling for" StrataVariableNames / StratNum>0;             



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg



Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 2 in conversation