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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.