The SAS Output Delivery System and reporting techniques

ODS html issue

Reply
Occasional Contributor ani
Occasional Contributor
Posts: 10

ODS html issue

Hello,

I am using sas9.2 in wimdows environment. When i am writing 'ODS html' code the output html is generated and saved in the following path:

Tools->Options->Preference->Results(tab).. in the results thre is a field to specify the local path.

The outputput is not saved in my path which i am specified in the code.

Need ur help at ur earliest.

Thanks!

Anir

Super User
Posts: 17,784

Re: ODS html issue

I think you need to post your code, if you say its not working.

FROM THE DOCS:

If you are using the HTML destination, the individual graphs are created as PNG files by default. You can use the PATH= and GPATH= options in the ODS HTML statement to specify the directory where your HTML and graphics files are saved, respectively. This also gives you more control over your graphs. For example, if you want to save your HTML file named test.htm in the C:myfiles directory, but you want to save your graphics image files in C:myfilespng, then you can specify the following:

ods html path  ="C:\myfiles"
         gpath = "C:\myfiles\png"
         file  = "test.htm";

When you specify the URL= suboption with the GPATH= option, SAS creates relative paths for the links and references to the graphics image files in the HTML file. This is useful for building output files that are easily moved from one location to another. For example, the following statements create a relative path to the png directory in all the links and references contained in test.htm:

ods html path  = "C:\myfiles"
         gpath = "C:\myfiles\png" (url="png/")
         file  = "test.htm";

If you do not specify the URL= suboption, SAS creates absolute paths that are hard-coded in the HTML file. These can cause broken links if you move the files. For more information, see the ODS HTML statement in the SAS Output Delivery System: User's Guide.

Super Contributor
Posts: 358

ODS html issue

Hi:

I've always used:

ODS HTML BODY='fully.qualified.file.name.html';

when I just want to output simple html (without links or images).

SAS Super FREQ
Posts: 8,742

Re: ODS html issue

Hi:

  are you seeing any error messages in the log. Usually, my most common mistake is doing something like this:

ODS HTML body='c:\wombat\something.html' style=sasweb;

...more code..

ODS HTML CLOSE;

and the error I get when c:\wombat does not exist is:

5    ods html file='c:\wombat\something.html' style=sasweb;

NOTE: Writing HTML Body file: c:\wombat\something.html

ERROR: Physical file does not exist, c:\wombat\something.html.

WARNING: No body file. HTML output will not be created.

The error message says that physical file does not exist because the directory doesn't exist for SAS to create the file in. And, if you do have a directory already created, I think you also have to have WRITE permissions to the location, as well, in order to write your output to the location.

I don't usually see an instance where FILE= or BODY= doesn't work with a fully qualified file name. You might want to open a track with Tech Support on this. Without a high level path in the BODY= or FILE=  option, SAS writes to your current working directory, as shown here on my system (a folder in C:\Documents and Settings).

cynthia


current_working_directory.jpg
New Contributor
Posts: 4

Re: ODS html issue

This has worked for me.

FILENAME _TEMP_ "c:\wombat\something.html";

ODS NORESULTS;

ODS LISTING CLOSE;

ODS CHTML FILE =_TEMP_ RS=NONE;

PROC PRINT data = mydir.mydataset N noobs label;

RUN;

ODS CHTML CLOSE;

ODS RESULTS;

ODS LISTING;

FILENAME _TEMP_;

SAS Super FREQ
Posts: 8,742

ODS html issue

Hi:

  Yes, you are correct. IF c:\wombat exists, that would be an acceptable solution. IF, however, c:\wombat directory did NOT exist, then you would get the same error message.

cynthia

1    FILENAME _TEMP_ "c:\wombat\something.html";

2

3    ODS LISTING CLOSE;

4

5    ODS CHTML FILE =_TEMP_ RS=NONE;

NOTE: Writing CHTML Body file: _TEMP_

ERROR: Physical file does not exist, c:\wombat\something.html.

WARNING: No body file. CHTML output will not be created.

Ask a Question
Discussion stats
  • 5 replies
  • 3338 views
  • 0 likes
  • 5 in conversation