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

Hi all SAS Users,

When running the code below, I face an error:

 

PROC IMPORT OUT= WORK.PARM  DATAFILE= "C:\Users\pnguyen\OneDrive - Massey University\PhD JOURNEY\leniency & operating\test_present\parm.xls"  DBMS=EXCEL REPLACE;
  RANGE="parm";
  GETNAMES=YES;
  MIXED=NO;
  SCANTEXT=YES;
  USEDATE=YES;
  SCANTIME=YES;
RUN;
/*write a dataset with standard error on the same column of coefficient*/
data parm2;
set parm;
if not missing(stderr) and variable not in ('R-square','Adj.R-sq','N. Obs.') then do; 
value=estimate; type='coefficient'; output; end;
if not missing(stderr) then do; value=stderr; type='stderr' ;output; end;
if variable in ('R-square','Adj.R-sq','N. Obs.') then do; value=estimate; type=variable ;output; end; 
run;


proc format;           
	picture stderrf (round)       
     	low-high=' 9.9999)' (prefix='(')                                
            .=' ';                                                  
run;



ods html close;
ods html;
title;
64         ods html close;
65         ods html;
NOTE: Writing HTML Body file: sashtml16.htm
ERROR: Insufficient authorization to access C:\WINDOWS\system32\sashtml16.htm.
ERROR: No body file. HTML output will not be created.

I did a search and see the solution from @Reeza  in this discussion but I do not understand the solution, therefore do not know how to apply in my case.

 

Apart from that, I also follow @Damo in this post to add "ods listing close;" at the top of my code but it still does not work.

34 ods listing close;
35 ods html close;
36 ods html;

NOTE: Writing HTML Body file: sashtml22.htm

ERROR: Insufficient authorization to access C:\WINDOWS\system32\sashtml22.htm.

ERROR: No body file. HTML output will not be created.ods listing close; ods html close; ods html; title;

In this post, @Damo also mentioned that we can use PRINT System option Window to write the output to another folder but it is only for lst file, not htm.

 

I much appreciate if you can have a look on that?

Warm regards and thanks.

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

You need to specify a folder and file location on your ODS "open" statements to avoid writing to a default location you don't have access to:

ods html file="c:\temp\MyHTMLfile.htm";

 

View solution in original post

4 REPLIES 4
ballardw
Super User

What is most likely happening is your ODS Html has no file listed as an actual destination. So SAS is using an unexpected location :C:\windows\system32 and you don't have write permissions in that folder.

 

If you explicitly use an ODS destination it is a good idea to specify where that location will be and it needs to be one you know you have write access.

Phil_NZ
Barite | Level 11

Thank you @ballardw  for your explanation, but I am really naive regarding operating system thing.

 

If you explicitly use an ODS destination it is a good idea to specify where that location will be and it needs to be one you know you have write access.

I am ambiguous about this sentence, I much appreciate it if you can explain to me, what should I do to know which location I have write access to, please? I am using the desktop from my school. 

 

Thank you.

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
SASKiwi
PROC Star

You need to specify a folder and file location on your ODS "open" statements to avoid writing to a default location you don't have access to:

ods html file="c:\temp\MyHTMLfile.htm";

 

Phil_NZ
Barite | Level 11

Many thanks and warm regards, @SASKiwi 

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 5937 views
  • 7 likes
  • 3 in conversation