BookmarkSubscribeRSS Feed
bryn41
Calcite | Level 5

I'm trying to use ods graphics, but every time I try to specify the html file, it gives the same error. I've looked at a few sas help pages but nothing comes up.

ods _ALL_ close;

ods html file="c:\temp\MyHTMLfile.htm"; (Note: even with .html it gives the error term.

ERROR: Physical file does not exist, c:\temp\MyHTMLfile.htm.

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

3 REPLIES 3
SASKiwi
PROC Star

You need to tell us about the type of SAS session you are using. Are you connecting to a remote SAS server or SAS OnDemand for example? If so the SAS session is quite likely running on a server that doesn't have a C drive. Also you can't reference the C drive on your own computer from a remote SAS server normally.

Ksharp
Super User
ods html path="c:\temp\" body="MyHTMLfile.htm"; 
proc print data=sashelp.class ;
run;
ods html close;
Patrick
Opal | Level 21

Because your SAS session likely executes on a SAS server you need to provide a path that's accessible by the SAS server.

 

With below code the .htm file will get written to the SAS WORK location. 

ods html
  path="%sysfunc(pathname(work))" 
  body="MyHTMLfile.htm"
  ; 
proc print data=sashelp.class ;
run;
ods html close;

 

 

If using SAS EG you will see below in your result window. The path to WORK will give you a clear indication where your SAS actually executes. 
I've used a local SAS installation under Windows so I've got a Windows path.

Patrick_0-1679795392697.png

 

 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1315 views
  • 0 likes
  • 4 in conversation