Learning SAS? Welcome to the exclusive online community for all SAS learners.

ODS HTML error after ODS HTML CLOSE

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

ODS HTML error after ODS HTML CLOSE

Hi All,

 

I am using SAS University Edition 9.4 on MacOS Sierra, which as probably everyone knows, uses SAS Studio 3.6.

Going through the Base Programming Cert Guide, I learned in chapter 9 that supposedly it is a good practice

to reset the ODS HTML output device to its default state (open) after invoking ODS HTML CLOSE.

 

However, when I run the following code in my environment I get an error.

 

* redirect sasuser libref to use certprep example data ;
libname sasuser '/folders/myfolders/certprep';

 

* Producing ODS HTML output to file with table of contents ;
* The option (URL=none) creates relative links ;
ods html path='/folders/myfolders/Base Prog/Ch 9' (URL=none)
   body='out3_body.html'
   contents='out3_contents.html'
   frame='out3_frame.html';

 

proc print data=sasuser.admit label;
   var sex age height weight actlevel;
   label actlevel='Activity Level';
run;

 

proc print data=sasuser.stress2;
   var id resthr maxhr rechr;
run;

 

* Closing ODS HTML output ;
ods html close;

 

* Reset HTML output device to default state (open) ;
ods html;
* ^^^^^^^^ This gives an error for some reason;

 

Commenting the last ODS HTML statement gives no error and writes all files as expected.

What did I not understand correctly?

 

Many thanks!


Accepted Solutions
Solution
3 weeks ago
Super Contributor
Posts: 330

Re: ODS HTML error after ODS HTML CLOSE

In SAS Studio the default output location is HTML5 whereas OFS HTML is HTML4 (confusing I know). Therefore in University Edition you don't need to do ODD HTML - I suspect the course the OP is following was written for SAS Display Manager prior to the introduction of HTML5.

View solution in original post


All Replies
Super User
Posts: 10,890

Re: ODS HTML error after ODS HTML CLOSE

Please show the code and error from the log. Best is to paste into a code box using the forum {i} menu icon as the message windows will reformat text and may move indicators that SAS often places into the log showing error locations.

 

 

New Contributor
Posts: 3

Re: ODS HTML error after ODS HTML CLOSE

Hi,

 

Many thanks for your reply. Here is the code:

 

* redirect sasuser liberef to use certprep example data ;
libname sasuser '/folders/myfolders/certprep';

* Producing ODS HTML output to file with table of contents ;
* The option (URL=none) creates relative links ;
ods html path='/folders/myfolders/Base Prog/Ch 9' (URL=none)
	body='out3_body.html'
	contents='out3_contents.html'
	frame='out3_frame.html';

proc print data=sasuser.admit label;
	var sex age height weight actlevel;
	label actlevel='Activity Level';
run;

proc print data=sasuser.stress2;
	var id resthr maxhr rechr;
run;

* Closing ODS HTML output ;
ods html close;

* Reset HTML output device to default state (open) ;
ods html;
* ^^^^^^^^ This gives an error for some reason;

 

And here is the error I get:

 

84         
 85         * Reset HTML output device to default state (open) ;
 86         ods html;
 NOTE: Writing HTML Body file: sashtml74.htm
 ERROR: Insufficient authorization to access /opt/sasinside/SASConfig/Lev1/SASApp/sashtml74.htm.
 ERROR: No body file. HTML output will not be created.
 87         * ^^^^^^^^ This gives an error for some reason;
 88         
 89         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 102  
Super User
Posts: 10,890

Re: ODS HTML error after ODS HTML CLOSE

You apparently are using one of the server versions. When you use a plain ODS HTML; the "path" is assigned by the system and is defaulting to a location you do not have write privileges. So the reset follow the pattern for you output:

 

ods html path='/folders/myfolders/'; perhaps

Super User
Posts: 7,124

Re: ODS HTML error after ODS HTML CLOSE

Any ODS HTML statement will open a file for output; if you don't specify a path name, the location for the output will default to the working directory of the SAS process, which is /opt/sasinside/SASConfig/Lev1/SASApp/ in the case of SAS UE.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Solution
3 weeks ago
Super Contributor
Posts: 330

Re: ODS HTML error after ODS HTML CLOSE

In SAS Studio the default output location is HTML5 whereas OFS HTML is HTML4 (confusing I know). Therefore in University Edition you don't need to do ODD HTML - I suspect the course the OP is following was written for SAS Display Manager prior to the introduction of HTML5.
New Contributor
Posts: 3

Re: ODS HTML error after ODS HTML CLOSE

Thanks everyone for your informative replies!

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 241 views
  • 0 likes
  • 4 in conversation