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.
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.
ods html path="c:\temp\" body="MyHTMLfile.htm";
proc print data=sashelp.class ;
run;
ods html close;
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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
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.
Ready to level-up your skills? Choose your own adventure.