BookmarkSubscribeRSS Feed
Snow_Belssas
Calcite | Level 5
Dears

Does any of you managed to create a two-way table from PROC FREQ which only uses var label text but not default "Var-name (Var-label)".
Many thanks in advance for your help.

Snow
5 REPLIES 5
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
From what I read, SAS 9.2 can address this requirement.

The only other technique may be to use PROC FREQ with OUT=, and then attempt some PROC TRANSPOSE to achieve the two-way cross-tab output report, possibly.

Scott Barry
SBBWorks, Inc.

Customizing FREQ Procedure Output in SAS 9.2
http://support.sas.com/resources/papers/freq92.pdf

SAS Procedures Guide: Statistical Procedures, PROC FREQ
Example 3.1 Output Data Set of Frequencies
http://support.sas.com/documentation/cdl/en/procstat/59629/HTML/default/procstat_freq_sect024.htm
Snow_Belssas
Calcite | Level 5
Hi SBB

Many thanks for your info given. I am working with SAS 9.2, but when I tested the samples copied from (in the first link) techno paper, either RTF or original HTML format, my SAS simply crached. Any idea about that?

Regards
Snow
Snow_Belssas
Calcite | Level 5
Hi again

Sorry, I forgot to post the used sample program see as printed.

data class;
set sashelp.class;
label sex="Gender"
age="Age in Years";
run;
proc template;
define crosstabs Base.Freq.CrossTabFreqs;
define header tableof;
text "Table of " _row_label_ " by " _col_label_;
end;
define header rowsheader;
text _row_label_ / _row_label_ ^= " ";
text _row_name_;
end;
define header colsheader;
text _col_label_ / _col_label_ ^= " ";
text _col_name_;
end;
cols_header=colsheader;
rows_header=rowsheader;
header tableof;
end;
run;


ods listing close;
ods HTML file="body.html";
proc freq data=class;
tables sex*age;
run;
ods html close;
ods listing;
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
You will be best served by contacting SAS Support to open a track if you are not getting the expected results, especially where involving a SAS system/environment failure.

Scott BarryS
SBBWorks, Inc.
Snow_Belssas
Calcite | Level 5
Thanks, I have submitted the problem to our dear SAS tech support.

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 ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1937 views
  • 0 likes
  • 2 in conversation