BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Riya2
Fluorite | Level 6

Hello! I am very new to SAS Programming and it has been a struggle to understand ODS. I added my code and I also added a picture of all the errors I have gotten. the frustrating thing is that it is straight from the practice guide I got. I realize this may be super simple but I think maybe I am just missing something trivial?

SAS 2021-02-09 9_41_13 PM.png

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

Try adding the path= option in the first ODS statement. This contain the path,

The other options contain the file names.

Because you haven't specified the path, SAS adds the default path to the "filenames" you gave, generating the error message you can see.

 

View solution in original post

5 REPLIES 5
qoit
Pyrite | Level 9

Can you try using:

 

ODS LISTING CLOSE;
ODS HTML FILE="mypath.html";


proc print data=sashelp.class;
run;

ODS LISTING;
ODS HTML CLOSE;
Riya2
Fluorite | Level 6
Yes. I put it in and now that error I am given is "ERROR: A component of C:\Users\riyaz\AppData\Local\Temp\SAS Temporary Files\_TD14948_DESKTOP-OAN97GB_\C:\Users\riyaz\Documents\My SAS Files\cert\data.html is not a directory.
ERROR: No body file. HTML output will not be created.

qoit
Pyrite | Level 9

Can you try the below:

 

The error messages below might be written to the SAS® log when you use certain ODS statements, including the ODS HTML statement and the ODS TAGSETS.EXCELXP statement:

Error: A component of c:\users\userid\appdata\local\temp\C:\temp\sastest.html is not a directory.
Error: No body file. HTML output will not be created.

The errors occur when additional directory information is incorrectly appended by SAS in front of the directory path that you specify in your code. For example, the errors above might occur with the following ODS HTML statement:

ods html file='c:\temp\sastest.html';

To circumvent the problem, modify the syntax of the ODS statement to use both the PATH and FILE options instead of using only the FILE option.  For example, the ODS HTML statement above should now look like this:

ods html path='c:\temp' (url=none) file='sastest.html';   

Make sure that the PATH option points to the directory to which you want to write the ODS output and that the FILE option specifies only the name of the HTML file that you want to create.

Riya2
Fluorite | Level 6

Ok. Yes, that worked. However, now I am a bit confused as to how I add in the contents and frame under this. The problem I am facing now is that when I use path and file in ODS HTML at the beginning, it says that the physical file does not exist.No body file. Then when I use body='mypath' I get the other error which is that a component of my path is not in the directory and there is no body file therefore no HTML output is created.

 Sorry for so many questions I am VERY new to this. Thank you for your help, very much appreciated!

ChrisNZ
Tourmaline | Level 20

Try adding the path= option in the first ODS statement. This contain the path,

The other options contain the file names.

Because you haven't specified the path, SAS adds the default path to the "filenames" you gave, generating the error message you can see.

 

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!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 5645 views
  • 2 likes
  • 3 in conversation