Programming the statistical procedures from SAS

Using label in two-way freq table

Reply
Occasional Contributor
Posts: 10

Using label in two-way freq table

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
Super Contributor
Super Contributor
Posts: 3,174

Re: Using label in two-way freq table

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
Occasional Contributor
Posts: 10

Re: Using label in two-way freq table

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
Occasional Contributor
Posts: 10

Re: Using label in two-way freq table

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;
Super Contributor
Super Contributor
Posts: 3,174

Re: Using label in two-way freq table

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.
Occasional Contributor
Posts: 10

Re: Using label in two-way freq table

Thanks, I have submitted the problem to our dear SAS tech support.
Ask a Question
Discussion stats
  • 5 replies
  • 151 views
  • 0 likes
  • 2 in conversation