BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
tianerhu
Pyrite | Level 9
libname learn 'C:\SAS data and program\data\data set used in Textbook\SAS data set';
ods html file = 'C:\SAS data and program\data\data set used in Textbook';
title "Listing of TEST_SCORES";
proc print data = learn.test_scores;
title2 "Sample of HTML Output - all defaults";
id ID;

run;


title "descriptive Statistics";
proc means data = learn.test_scores n mean min max;
var Score1-Score3;
run;
ods html close;

information of log :

236 libname learn 'C:\SAS data and program\data\data set used in Textbook\SAS data set';
NOTE: Libref LEARN refers to the same physical library as TMP1.
NOTE: Libref LEARN was successfully assigned as follows:
Engine: V9
Physical Name: C:\SAS data and program\data\data set used in Textbook\SAS data set
237 ods html file = 'C:\SAS data and program\data\data set used in Textbook';
NOTE: Writing HTML Body file: C:\SAS data and program\data\data set used in Textbook
ERROR: A component of C:\Users\LIAODO~1\AppData\Local\Temp\SAS Temporary
Files\_TD21160_DESKTOP-VL03550_\C:\SAS data and program\data\data set used in Textbook is
not a directory.
ERROR: No body file. HTML output will not be created.
238 title "Listing of TEST_SCORES";
239 proc print data = learn.test_scores;
240 title2 "Sample of HTML Output - all defaults";
241 id ID;
242
243 run;

WARNING: No output destinations active.
NOTE: There were 3 observations read from the data set LEARN.TEST_SCORES.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds


244
245
246 title "descriptive Statistics";
247 proc means data = learn.test_scores n mean min max;
248 var Score1-Score3;
249 run;

WARNING: No output destinations active.
NOTE: There were 3 observations read from the data set LEARN.TEST_SCORES.
NOTE: PROCEDURE MEANS used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds

 

 

please give me a help , thank you .

1 ACCEPTED SOLUTION

Accepted Solutions
ger15xxhcker
Quartz | Level 8

First, check the path in your SAS code to make sure the file is located in the correct folder. Make sure that the path is specified with forward slashes ("/") instead of backslashes ("\"). If the path is correct, then check to make sure that the filename is correct and that you have the correct file permissions to open the file. If both of these are correct, try running the code again and make sure that the output file appears in the folder where you specified.

 

try this maybe:

 

libname learn 'C:\SAS data and program\data\data set used in Textbook\SAS data set';
ods html file = 'C:\SAS data and program\data\data set used in Textbook';
title "Listing of TEST_SCORES";
proc print data = learn.test_scores;
title2 "Sample of HTML Output - all defaults";
id ID;

run;


title "descriptive Statistics";
proc means data = learn.test_scores n mean min max;
var Score1-Score3;
run;
ods html close;

View solution in original post

6 REPLIES 6
ger15xxhcker
Quartz | Level 8

The main problem in the SAS code is that the HTML output is not being created, because the ODS HTML FILE statement is attempting to create a file in a path, which contains the token 'C:\Users\LIAODO~1\AppData\Local\Temp\' which is not a directory.
Consequently, the HTML file cannot be written and the error is generated. The statement should use a directory path that is valid on the system.

tianerhu
Pyrite | Level 9
could you give me more detail about how to correct my path?
ger15xxhcker
Quartz | Level 8

First, check the path in your SAS code to make sure the file is located in the correct folder. Make sure that the path is specified with forward slashes ("/") instead of backslashes ("\"). If the path is correct, then check to make sure that the filename is correct and that you have the correct file permissions to open the file. If both of these are correct, try running the code again and make sure that the output file appears in the folder where you specified.

 

try this maybe:

 

libname learn 'C:\SAS data and program\data\data set used in Textbook\SAS data set';
ods html file = 'C:\SAS data and program\data\data set used in Textbook';
title "Listing of TEST_SCORES";
proc print data = learn.test_scores;
title2 "Sample of HTML Output - all defaults";
id ID;

run;


title "descriptive Statistics";
proc means data = learn.test_scores n mean min max;
var Score1-Score3;
run;
ods html close;

ballardw
Super User
ods html file = 'C:\SAS data and program\data\data set used in Textbook';

 

That is a folder not a FILE. A file would look something like:

ods html file = 'C:\SAS data and program\data\data set used in Textbook\outputfilename.html';

What may have happened was SAS tried create a file without any extension such as the following but failed because the "optional" parts of the file name "set used in Textbook" are not valid options for a file. Just one of several reasons not to have spaces in folder names.

ods html file = 'C:\SAS data and program\data\data';

 

Quentin
Super User

Wow, I really thought that code would work.  But when I checked the docs, ODS HTML doesn't have a file= option documented. 

 

I think file= might be an alias for body=.  

 

It works for me if I use path= to specify the directory, and then use only the filename in file=.  Suggest you try:

 

libname learn 'C:\SAS data and program\data\data set used in Textbook\SAS data set';

ods html path='C:\SAS data and program\data\data set used in Textbook\SAS data set' file = 'myhtmlfile.htm';
title "Listing of TEST_SCORES";
proc print data = learn.test_scores;
title2 "Sample of HTML Output - all defaults";
id ID;
run;

ods html close;
The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
tianerhu
Pyrite | Level 9
Thank you very much.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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
  • 6 replies
  • 1460 views
  • 0 likes
  • 4 in conversation