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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

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