DATA Step, Macro, Functions and more

ODS HTML - Frame file not working as expected

Reply
Contributor s_m
Contributor
Posts: 22

ODS HTML - Frame file not working as expected

[ Edited ]

 

I got three html files.I am able to see table of contents and body file seperatly in a browser. But when I opened frame file I dint see anything.  It looks like a blank page when I opened it in IE. I am supposed to see body as well as table of contents embeded int it together. Why frame file is not working as expected in this case.

Please some one help me with it.

 

libname learn xlsx '/folders/myshortcuts/s2/college.xlsx';

ods html body='body_sample.html'
              contents='content_sample.html'
               frame='frame_sample.html'
               path='/folders/myshortcuts/s2/ODSOutput';
 
proc print data=learn.sheet1;
run;
 
proc means data=learn.sheet1 n mean min max;
run;
 
ods html close;
Super User
Posts: 19,772

Re: ODS HTML - Frame file not working as expected

I know why its happening but not howing to fix it. 

 

When you create the file the paths to the body/contents file are '/folders/myfolders/' but that doesn't apply once you're out of the VM. It makes sense from SAS perspective and anyone working with SAS on a server will have the same issue. 

 

You could manually fix the frame page but that's not a good fix. 

Super User
Posts: 11,343

Re: ODS HTML - Frame file not working as expected

Try:

ods html body='body_sample.html'
              contents='content_sample.html'
               frame='frame_sample.html'
               path='/folders/myshortcuts/s2/ODSOutput';
 
   ods html body='Print.html';
   proc print data=learn.sheet1;
   run;
   ods html body='means.html'; 
   proc means data=learn.sheet1 n mean min max;
   run;

ods html close;

Your main Body file likely doesn't contain any of the output. Create a separate html file for each group of tables/output you wish to see with a reference in the contents.

 

Super User
Posts: 19,772

Re: ODS HTML - Frame file not working as expected

The paths in the file end up being /folders/my shortcuts/.... which doesn't exist on your computer, when using SAS UE, so the body/content files aren't found.  

Occasional Contributor
Posts: 6

Re: ODS HTML - Frame file not working as expected

[ Edited ]

I got the same problem because I'm using SAS Studio. As I can't open my html files directly with a web broswer, I have to download them, but then the reference to the 2 html files in the frame.html are wrong. 
What's working for SAS Studio is the use of the URL suboption, allowing to use relative URLs. So as long as the files are in the same directory or storage location, it should work. 

ods html FILE='/home/yourUsername/myfolder/data.html' (url = 'data.html')
	 CONTENTS='/home/yourUsername/myfolder/tabOfContent.html' (url = 'tabOfContent.html')


FRAME='/home/yourUsername/myfolder/frame.html';

 

Ask a Question
Discussion stats
  • 4 replies
  • 184 views
  • 0 likes
  • 4 in conversation