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
SAS Super FREQ
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
SAS Super FREQ
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.

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!

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.

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