BookmarkSubscribeRSS Feed
Obsidian | Level 7

I need an instruction how to save html report from results. All posts i have read didnt helped. If I export then I get html only with table but no graphs in it. If I use:

ods html path = ""
gpath = "" (url="png/")
file = ".html"



filename grafout '';

goptions reset=all device=png
gsfname=grafout gsfmode=replace;

goptions reset=goptions device=png;

ods listing close;



ods html path='' (url=none) file='sastest.html';

ods html body='drug1.htm' newfile=page style=HTMLBlue;


I get nothing but errors.

Obsidian | Level 7

I have a directory servers\SASApp\Files\Validation

I know its impossible to write on local drive (on Windows),

so i decided to write to SAS server instead.


23 ods html path = "Files/Validation"
24 gpath = "Files/Validation/png" (url="png/")
25 file = "filename.html"
26 ;
NOTE: Writing HTML Body file: filename.html
ERROR: Physical file does not exist, /sas/config/Lev1/SASApp/Files/Validation/filename.html.
ERROR: No body file. HTML output will not be created.


What does it mean  "does not exist"? Yes, I want sas to create file.

Super User

There are two ways to specify a path on any UNIX system:

  • relative; the path does not start witha forward slash; this means that the system will prepend this path with the current working directory, which is /sas/config/Lev1/SASApp, the location from which the SAS process was started
  • absolute: the path starts with a forward slash, instructing the system to search from the root directory

So if you know there is a directory Files/Validation in the root of the UNIX system, use /Files/Validation to access it.

Further, be aware that UNIX is case sensitive throughout, so you can have Validation and validation in the same place specifying two different objects. Most (all) UNIX admins that I know prefer to only use lowercase letters in path names, for ease of typing and keeping the sort order (since "Z" comes before "a" in the ASCII sequence). Capitals are used for special purposes only (eg a README file that will always show up first in a directory listing)


Your error message means that the path does not exist, you also do not have the necessary permissions to create it, the file could therefore not be created, and when SAS tried to write to it, it did not exist.

Obsidian | Level 7

I cant figure this out, for sure.

Then, How to export html from results containing all graphs? All I get are just tables.

Obsidian | Level 7

The problem halfway solved:

Tools-> Options -> results (results general) tick the box "html",

however some labels, graphs and legend I get are  a bit  distorted 

Meteorite | Level 14

Are you using Enterprise Guide?

Super User

When starting your ods output, specify all necessary physical and logical paths:

ods html file=outfile1

In this example (taken from one of our batchjobs), path and gpath contain the physical file/path names where the files are written, while the url= options name the logical paths that are written into the files when creating the links to sub-pages and graphics. This makes sure that all graphics show up correctly when the main page is accessed by browser.

So imagine we want to create a HTML report called myreport, and the job is run by user itsme on server

%let outpath=$HOME/public_html/myreport;
%let graphbase=graphics;
%let urlpath=myreport;

filename outfile1 "&outpath./myreport.html";

/* ods statement with resolved values */

ods html file="/home/itsme/public_html/myreport/myreport.html"

When you now access, all graphics will appear nicely, and links to sub-pages (eg from proc report) will also work.



SAS is headed back to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team.

Interested in speaking? Content from our attendees is one of the reasons that makes SAS Innovate such a special event!

Submit your idea!

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.

Get the $99 certification deal.jpg



Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 3 in conversation