SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Producing HTML Output
Creating a Linked Table of Contents


Specifying a URL

As you've seen, frame and contents files use information in file specifications to display related files. For example, the frame specified in the ODS HTML statement below displays C:\Records\toc.html and C:\Records\data.html. In turn, the contents file contains links to C:\Records\data.html.

      ods html body='c:\records\data.html'
               contents='c:\records\toc.html'
               frame='c:\records\frame.html';

Frame with TOC and Body File

 
But suppose that you want to display these files from a Web server. For example, you may want to use the URLs shown below for the body and contents files:


Frame with TOC and Body File


The URL= Option

By specifying the URL= option in the file specification, you can provide a URL that ODS uses in all the links that it creates to the file.

Caution: In the CMS operating environment, you must use URL= in the file specifications for any file that is linked to or referenced in another HTML file, because CMS file names do not form valid URLs.


General form, URL= option in a file specification:
HTML-file-specification(URL=' Uniform-Resource-Locator')

where

  • HTML-file-specification opens the HTML destination and specifies the file to write to. Use the URL= option in any ODS file specification except FRAME= (because no ODS file references the frame file).

  • Uniform-Resource-Locator provides a URL for HTML-file-specification. ODS uses this URL instead of the file name in all the links and references that it creates that point to the file.

Tip: URL= is useful for building HTML files that may be moved from one location to another. If the links from the contents and page files are constructed with a simple URL (one name), they work as long as the contents, page, and body files are all in the same location.


Example: Relative URLs

In this ODS HTML statement, URL= specifies simple URLs (one name). These files must be stored in the same location.

 
     ods html body='c:\records\data.html' (url='data.html')
              contents='c:\records\toc.html' (url='toc.html')
              frame='c:\records\frame.html';
Example: Absolute URLs

Alternately, in this ODS HTML statement, the URL= options specify complete URLs using the HTTP protocol. These files can be stored in the same or different locations.

 
      ods html body='c:\records\data.html'
(url='http://mysite.com/myreports/data.html')
contents='c:\records\toc.html' (url='http://mysite.com/mycontents/toc.html') frame='c:\records\frame.html';


back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement