BookmarkSubscribeRSS Feed
JohnH
Fluorite | Level 6
Our web site does not allow frames. The ODS HTML system can easily create a frames setup with a contents, page, and table file completely set up. I need to create the same look, but on the same page and, with a header logo. I assume that means I need a table into which each of the content, page, and stat tables are entered. Can proc template be used to create such a setup? Does anyone have such a template style?
8 REPLIES 8
Olivier
Pyrite | Level 9
Maybe you could create your own "main" page, using the IFRAME tag instead of the frame panels.
I don't have examples so far, but check a little help on the tag and build the HTML document with a DATA _NULL_ step...

Regards,
Olivier
Cynthia_sas
SAS Super FREQ
Hi:
You would either have to design your own custom TAGSET template for HTML in order to generate the custom tags you need. What you want to do is NOT a style change -- it is not the style template that builds multiple, linked files -- that happens in the generated HTML tags -- which means you'd have to change the TAGSET template to work differently than it does. Or you would have to generate the kind of HTML tags you want in a DATA step program.

The trick with generating your own tagset is that ODS builds hyperlinks to link the CONTENTS=/PAGE= file with the BODY= file. For example, ODS would build this link for a PROC UNIVARIATE table for Basic Measures:
<a href="body.html#IDX1" target="body">Basic Measures of Location and Variability</a> -- which would be completely wrong if you were dumping both the body output and the contents output into the same file....the body.html would be wrong and the target="body" would also be wrong -- you'd have some work to do to get what you want.

If an HTML frame is not appropriate, how about delivering a PDF file -- where the bookmark area in the PDF file would be the equivalent of the HTML contents file??? Most browsers these days have Acrobat Reader.

cynthia
Olivier
Pyrite | Level 9
I'm still stuck to my previous idea, how much clever and wise hints from Cynthia may be.
Here is an example of what I was referring to : IFRAME tagset in a data-step-generated main HTML page. [pre]
ODS HTML PATH = "c:\temp" (URL=NONE)
CONTENTS = "contents.htm"
FRAME = "with_frames.htm"
BODY = "body.htm"
STYLE = astronomy ;
PROC MEANS DATA = sashelp.prdsale MEAN MEDIAN ;
VAR actual ;
CLASS country product ;
WAYS 1 ;
RUN ;
ODS HTML CLOSE ;
DATA _NULL_ ;
FILE "c:\temp\no_frames.htm" ;
PUT "" ;
PUT "" ;
PUT "" ;
PUT "" ;
PUT "
" ;
PUT "" ;
PUT "
" ;
PUT "" ;
PUT "
" ;
RUN ;
[/pre]
It approximately looks like the framed main page produced by the ODS HTML statement, doesn't it ?
Regards,
Olivier
Cynthia_sas
SAS Super FREQ
Hi, Olivier...

I knew what you meant, but I took the first sentence
"Our web site does not allow frames."
to mean ALL frames, including inline-frames. If the web folks will allow in-line frames, then your method is indeed the better method.

If the web folks will NOT allow in-line frames, then there is a way to create BODY.HTM and CONTENTS.HTM and then essentially use a DATA _NULL_ step to concatenate the 2 files together.

The trick is to create the CONTENTS.HTM file WITH the TOP HTML tags, but WITHOUT the bottom HTML tags, and to create the BODY.HTM WITHOUT the TOP HTML tags, but WITH the bottom HTML tags. That way, when you concatenate the 2 files together, in a simple format, you have the TOC at the top, immediately followed by the BODY content..clicking on links at the top take you further down on the page.

This method doesn't use FRAMES or IFRAMES at all -- but like your program, does do some post-processing to get the 2 files concatenated together. (You could do some fancier processing in the DATA _NULL_ to get 2 tables side-by-side, but the example I have is a simple concatenate.

cynthia
JohnH
Fluorite | Level 6
Cynthia - You are correct. We cannot have inline frames either. I will try your ideas when I get a chance. Thanks to all of you for your ideas.
Cynthia_sas
SAS Super FREQ
John:
Here's the code sample I described. It was for someone who wanted the TOC info at the top of the BODY info. The key is to change target="body" from the TOC file into target="_self" (otherwise, you're popping up windows every time you click on a link) and to change the file name in the HREF from the ORIGINAL file name (BODY.HTML) to the NEW name (NEWBOTH.HTML). Then, you can get rid of the original HTML files you created and use the new HTML file (NEWBOTH.HTML) on your web site.

cynthia
[pre]
** create contents and body file only;
** do not even create a FRAME= file;
** keep
Eric_SAS
SAS Employee
I have a tagset that floats the table of contents either as a pulldown menu or as a tree in the upper
left corner of the body file.

I think that will do what you want. If you send me an email I will send it to you.

Eric.
Eric_SAS
SAS Employee
My email is Eric.Gebhart@sas.com...

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 8 replies
  • 887 views
  • 0 likes
  • 4 in conversation