BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jerry898969
Pyrite | Level 9

Hello,

 

When I do a two-way proc freq it doesn't show the two variable names above the freq table. 

I never changed any of the setting on my SAS.  Is there a way to bring them back?

 

EX.

 

The SAS System

The FREQ Procedure

Two-Way Table Output

Count   |0-YES    |1-NO     |   Total
--------+---------+---------+
0-YES   |       6 |       2 |       8
--------+---------+---------+
1-NO    |       2 |      56 |      58
--------+---------+---------+
Total           8        58        66

Under "Two-Way Table Output" shouldn't I see the 2 variables names used?

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Do you know if anyone using your system has experimented or run example code for Proc Template to modify any table templates?

 

Try running this code:

proc template;
  source base.freq.crosstabfreqs;

run;

A line at the bottom of the output should look like this:

NOTE: Path 'Base.Freq.Crosstabfreqs' is in: SASHELP.TMPLBASE (via SASHELP.TMPLMST).

If the path references somewhere else then likely someone ran something that created another template that is being used. The most likely alternate path would mention SASUSER.Templat. If that is the case we can use Proc Template to remove the altered template if that is what you need.

View solution in original post

6 REPLIES 6
ballardw
Super User

@jerry898969 wrote:

Hello,

 

When I do a two-way proc freq it doesn't show the two variable names above the freq table. 

I never changed any of the setting on my SAS.  Is there a way to bring them back?

 

EX.

 

The SAS System

The FREQ Procedure

Two-Way Table Output

Count   |0-YES    |1-NO     |   Total
--------+---------+---------+
0-YES   |       6 |       2 |       8
--------+---------+---------+
1-NO    |       2 |      56 |      58
--------+---------+---------+
Total           8        58        66

Under "Two-Way Table Output" shouldn't I see the 2 variables names used?

 

Thank you


Please show the code you are using. Since the displayed output is not a default two-way proc freq output we need to see all of the options you may have used.

jerry898969
Pyrite | Level 9

I apologize for not posting the code.

 

This is the code :

 


proc freq data= _chk ;
tables Old*New / missing nocol norow nopercent ; 
run ;

Thank you

ballardw
Super User

Do you know if anyone using your system has experimented or run example code for Proc Template to modify any table templates?

 

Try running this code:

proc template;
  source base.freq.crosstabfreqs;

run;

A line at the bottom of the output should look like this:

NOTE: Path 'Base.Freq.Crosstabfreqs' is in: SASHELP.TMPLBASE (via SASHELP.TMPLMST).

If the path references somewhere else then likely someone ran something that created another template that is being used. The most likely alternate path would mention SASUSER.Templat. If that is the case we can use Proc Template to remove the altered template if that is what you need.

jerry898969
Pyrite | Level 9

Hi ballardw,

 

I ran this code and this is what it said in the log:  NOTE: Path 'Base.Freq.Crosstabfreqs' is in: SASUSER.TEMPLAT.

proc template;
  source base.freq.crosstabfreqs;
run;

 

1. I went to SAS and right-clicked on the word results in the result window and selected templates. 

2. I clicked the "+" of  Sasuser.Templat

3. I clicked the "+" of Base

4. Selected "Freq" and it had "CrossTabFreqs" so I renamed it to "_CrossTabFreqs" . 

5. I re-ran my freq and now it shows the column names.

 

Thank you all for your help.

ballardw
Super User

If you search the help for Proc Template there is an example that shows how to modify a procedure's table template, use that, and then remove the replaced template.

 

Good work on finding at least one manual way to correct the issue once identified.

 

 

Reeza
Super User

I'm guessing that someone messed up the templates for PROC FREQ. Were you trying to customize the output in some manner?

 

To work around it for now, you can use PROC TABULATE which has very similar functionality for displaying information at least. 

 


@jerry898969 wrote:

Hello,

 

When I do a two-way proc freq it doesn't show the two variable names above the freq table. 

I never changed any of the setting on my SAS.  Is there a way to bring them back?

 

EX.

 

The SAS System

The FREQ Procedure

Two-Way Table Output

Count   |0-YES    |1-NO     |   Total
--------+---------+---------+
0-YES   |       6 |       2 |       8
--------+---------+---------+
1-NO    |       2 |      56 |      58
--------+---------+---------+
Total           8        58        66

Under "Two-Way Table Output" shouldn't I see the 2 variables names used?

 

Thank you


 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 2094 views
  • 7 likes
  • 3 in conversation