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

 

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 3 replies
  • 491 views
  • 0 likes
  • 4 in conversation