The SAS Output Delivery System and reporting techniques

customized html output

Reply
N/A
Posts: 0

customized html output

Hi,

is there a way to add format the output of ods html so that after a set amount of columns, the title, column heading, and first column repeat itself?

examp of my output:

abc 11 22 33 44 55 66 77 88 99...

this is what I need on my html output:

abc 11 22 33 abc 44 55 66 abc 77 88 99.....

thank you.
SAS Super FREQ
Posts: 8,869

Re: customized html output

Posted in reply to deleted_user
Try this:
[pre]
ods html file='c:\temp\repeatcol.html' style=sasweb;

proc print data=sashelp.class label;
title 'repeat name column';
var name age height name weight sex;
label name='Wombat';
run;

ods html close;
[/pre]

PROC PRINT, for example, will let you repeat a column in the VAR statement...as shown above.

I'm not sure what you mean by repeating the SAS title, but in the above example, the label used for the NAME column is used every time that the NAME column appears in the output.

In an HTML file, the SAS title, appears one time, at the top of the HTML file, unless you have multiple procedures or a single procedure that uses BY group processing or that produces a new page (like the PAGEBY statement or using the PAGE dimension in PROC TABULATE or the PAGE option in PROC REPORT). If you wanted to repeat the title for every 4 observations, then you could do this:
[pre]
ods html file='c:\temp\repeatcolandtitle.html' style=sasweb;

proc print data=sashelp.class(firstobs=1 obs=4) label;
title 'repeat name column and title';
var name age height name weight sex;
label name='Wombat';
run;

proc print data=sashelp.class(firstobs=5 obs=8) label;
title 'repeat name column and title';
var name age height name weight sex;
label name='Wombat';
run;

ods html close;

[/pre]

If you look at the above file, you will see that the title repeats with every group of 4 observations. There are other ways to do this, including using SAS Macros and/or using an explicitly set "break" variable and possibly using BY group processing with PROC PRINT or GROUP processing with PROC REPORT.

Otherwise, if you are trying to create "panels" of output, you might consider using the HTMLPANEL destination, and look at the documentation here:
http://support.sas.com/rnd/base/topics/odsmarkup/htmlpanel.html

Or, if none of these suggestions will work for you, then perhaps you should consider contacting Tech Support for more specific help.

cynthia
N/A
Posts: 0

Re: customized html output

Posted in reply to Cynthia_sas
Cynthia,

Thank you very much for the quick and detail responsed.
Let me explain my question in a little more detail. Basically, I run a tabulate with about 30 var. as a result, my html file contain many columns and is difficult to read, especially on a paper print out. I am looking for a easy way to divide the column so that each page will contain the value of the observations, such as in a rtf format except it will be in a html file format.
For instant, if my output from tabulate is:

abc 11 22 33 44 55 66 77 88 99 00
efg 22 33 44 55 66 77 88 99 00 11
hij 33 44 55 66 77 88 99 00 11 22

then my desire output would be:


abc 11 22 33 44 abc 55 66 77 88 abc 99 00
efg 22 33 44 55 efg 66 77 88 99 efg 00 11
hij 33 44 55 66 hij 77 88 99 00 hih 11 22

I don't have any experience with htmlpanel, but I will give it a try. Also, with your second suggestion, would the the output line up side by side or one on top another?

Once again, thank you very much.

Dave
SAS Super FREQ
Posts: 8,869

Re: customized html output

Posted in reply to deleted_user
Hi:
Proc TABULATE will not do what you want -- you can't put an "identifier" column in the middle of the table column area. However, Proc PRINT and Proc REPORT will allow you to do what you want. One possibility is to create an output data set from TABULATE and then use PRINT or REPORT to get the output in different form.

With my second method, the output would NOT be side by side. Run it and see. For help with HTMLPANEL (or HTMLSCROLL), you should consider contacting Tech Support. Remember that when you print from an HTML file, it is the BROWSER that controls the printing and NOT SAS.

cynthia
Ask a Question
Discussion stats
  • 3 replies
  • 129 views
  • 0 likes
  • 2 in conversation