BookmarkSubscribeRSS Feed
whpun
Calcite | Level 5
table var1*var2, var3 is used in proc tabulate
In the listing file, it shows var1 and var2 in 1 column like
AAAAA
111 100
222 200
BBBBB
100 10

But, in HTML output, var1 and var2 are shown in 2 columns
AAAAA 111 100
222 200
BBBBB 100 10

How can I make the HTML output same as in listing output? Thanks
3 REPLIES 3
Cynthia_sas
Diamond | Level 26
Hi:
Not sure what you're seeing. When I use this code, I get the same output in both the LISTING window and the HTML (viewed in a browser).

cynthia
[pre]
data class;
set sashelp.class;
var1=sex;
var2 = age;
var3 = height;
run;

ods listing;
ods html file='c:\temp\comptab.html' style=sasweb;
proc tabulate data=class;
class var1 var2;
var var3;
table var1*var2,
var3 ;
run;
ods html close;
[/pre]
whpun
Calcite | Level 5
I used the following code and the 2 outputs are diff.

ODS HTML FILE=ODSOUT RS=NONE STYLE=SASWEB;
PROC TABULATE DATA=SASHELP.CLASS NOSEPS;
CLASS SEX AGE;
CLASSLEV SEX / S=[JUST=L VJUST=TOP];
CLASSLEV AGE / S=[JUST=L];
VAR HEIGHT;
TABLE SEX=' '*AGE=' ', HEIGHT
/RTS=55 INDENT=5 S=[RULES=NONE BORDERWIDTH=0
JUST=L];
Cynthia_sas
Diamond | Level 26
Hi:
NOSEPS and INDENT=5 are LISTING options -- they only work in the LISTING destination or the OUTPUT window. They are basically ignored by other ODS DESTINATIONS (such as HTML). In the documentation:
http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/a002473736.htm#a003065557

when you see this restriction:
Restriction: The NOSEPS option affects only the traditional SAS monospace output destination.

It means that the option will only work in the LISTING window.

cynthia

Here's the doc site for the INDENT= option:
http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/a002473740.htm#a003068110
where it explains that HTML, RTF and PDF will not use INDENT= the same way as LISTING:
Restriction: In the HTML, RTF, and Printer destinations, the INDENT= option suppresses the row headings for class variables but does not indent nested row headings.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 3 replies
  • 1238 views
  • 0 likes
  • 2 in conversation