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

 

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1213 views
  • 0 likes
  • 4 in conversation