BookmarkSubscribeRSS Feed
ani
Calcite | Level 5 ani
Calcite | Level 5

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

5 REPLIES 5
Reeza
Super User

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.

OS2Rules
Obsidian | Level 7

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).

Cynthia_sas
SAS Super FREQ

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
ezetina
Calcite | Level 5

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_;

Cynthia_sas
SAS Super FREQ

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.

sas-innovate-2024.png

Today is the last day to save with the early bird rate! Register today for just $695 - $100 off the standard rate.

 

Plus, 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
  • 5 replies
  • 7727 views
  • 0 likes
  • 5 in conversation