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?
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.
Can you try using:
ODS LISTING CLOSE;
ODS HTML FILE="mypath.html";
proc print data=sashelp.class;
run;
ODS LISTING;
ODS HTML CLOSE;
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:
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:
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:
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.
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!
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.
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!
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.