SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Producing HTML Output
Specifying a Path for Output


The PATH= Option

So far, we've specified the full path name for HTML files with the BODY=, CONTENTS=, and FRAME= specifications. To streamline your ODS HTML statement, you can also use the PATH= option to specify the location where you want to store your HTML output. When you use the PATH= option, you don't need to specify the full path name for the body, contents, or frame files.


General form, PATH= option:

PATH=file-specification
            <(URL='Uniform-Resource-Locator' | NONE)>

where

  • file-specification is one of the following:
    • the physical name of an external file
    • a fileref (file shortcut) that has been assigned to an external file
    • a SAS catalog (libname.catalog).

  • Uniform-Resource-Locator provides a URL for file-specification. ODS uses this URL instead of the file name in all the links and references that it creates to the file. If you specify the keyword NONE, no information from the PATH= option appears in the links or references.

Tip: If you plan to move your HTML files, you can specify URL=NONE in the PATH= option to prevent information from the PATH= option from creating URLs that are invalid or incorrect.

Caution:

In the CMS operating environment, you must use URL= in the PATH= option because CMS file names do not form valid URLs.

Caution:

In the OS/390 operating environment, if you store your HTML files as members in a partitioned data set, the PATH= value must be a PDSE, not a PDS. You can allocate a PDSE within SAS as shown in this example:
     filename pdsehtml '.example.htm'
dsntype=library dsorg=po
disp=(new, catlg, delete);

Also, you should specify valid member names for the HTML files (without extensions).


Both of the programs shown below direct the files data.html, toc.html, and frame.html to the C:\Records directory in the Windows operating environment.


Examples with the PATH= Option

In these two examples, the URLs for the body and contents files are data.html and toc.html. No information from the PATH= option appears in the links or references.

     ods listing close;
     ods html path='c:\records'(url=none)
              body='data.html'(url='data.html') 
              contents='toc.html'(url='toc.html')
              frame='frame.html'
              style=brick;
     proc print data=clinic.admit label;
        var id sex age height weight actlevel;
        label actlevel='Activity Level';
     run;
     proc print data=clinic.stress2;
        var id resthr maxhr rechr;
     run;
     ods html close;
     ods listing;


     ods listing close;
ods html path='c:\records'(url=none)
body='data.html' contents='toc.html' frame='frame.html' style=brick; proc print data=clinic.admit label; var id sex age height weight actlevel; label actlevel='Activity Level'; run; proc print data=clinic.stress2; var id resthr maxhr rechr; run; ods html close; ods listing;

Example without the PATH= Option

Without the PATH= option or the URL= suboption in the file specifications, the URLs for the body and contents files in this example are c:\records\data.html and c:\records\toc.html.

     ods listing close;   
     ods html body='c:\records\data.html'
              contents='c:\records\toc.html'
              frame='c:\records\frame.html'
              style=brick;
     proc print data=clinic.admit label;
        var id sex age height weight actlevel;
        label actlevel='Activity Level';
     run;
     proc print data=clinic.stress2;
        var id resthr maxhr rechr;
     run;
     ods html close;
     ods listing;

 

back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.
Terms of Use & Legal Information | Privacy Statement