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;
BASUG is hosting free webinars Next up: Mark Keintz presenting History Carried Forward, Future Carried Back: Mixing Time Series of Differing Frequencies on May 8. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
tianerhu
Pyrite | Level 9
Thank you very much.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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