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.
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";
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.
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.
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";
Many thanks and warm regards, @SASKiwi
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.