The SAS Output Delivery System and reporting techniques

How to view HTML files in SaS studios

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

How to view HTML files in SaS studios

hey guys ,

 

sas newbie here , i have generated html files using ods but every time i want to open them instead opening in browser , they are downloaded , can i view them with out downloading ? 

 

 


Accepted Solutions
Solution
‎08-01-2016 05:15 AM
Esteemed Advisor
Posts: 5,989

Re: How to view HTML files in SaS studios

First, this:

ods html body='/home/umair/sasuser.v94/files/htmlfiles/body1.html'

is EXTREMELY bad practice IMO.

/home/username/sasuser.v94 is the directory for the SASUSER library. Nothing but the contents of the SASUSER library belong in there.

 

Second: your browser can either read files from the local filesystem, or files served by a remote HTTP server.

Your HTML result is

a) not on the local filesystem

b) not in a location where an eventual HTTP server process on the SAS system can see it; if you have a HTTP server there, putting files in

/home/username/public_html

can make them accessible by URL:

http://servername/~username/filename.html

in a browser. Since SAS Studio does not have all the information necessary for this handover to the local browser (your SAS workspace server instance may not have the same name as the HTTP server), it downloads the file for display using its own communication channel.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Esteemed Advisor
Posts: 5,989

Re: How to view HTML files in SaS studios

- Please let us have a look at the ODS HTML statement

- How do you open the files (selecting a result tab in EG, double-clicking in Explorer, ...)

- How does your SAS setup look like (do you work with Base SAS in Display Manager, or with EG, or SAS Studio? Is the Workspace Server in case of EG or Studio running on your desktop or a remote server? Or do you even use SAS UE?)

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
New Contributor
Posts: 3

Re: How to view HTML files in SaS studios

ods listing close;
ods html body='/home/umair/sasuser.v94/files/htmlfiles/body1.html' contents='/home/umair/sasuser.v94/files/htmlfiles/contents.html' frame='/home/umair/sasuser.v94/files/htmlfiles/main.html';

proc print data=demo_grf.badin39;
run;

proc print data=demo_grf.badin40;
run;

proc print data=demo_grf.dadu39;
run;

proc print data=demo_grf.dadu40;
run;

run;

ods html close;
ods listing;

1 ) used above code to generate html files 

2 ) using sas studios as dev enviorment in a remote server 

3)  am trying open by clicking on files in explorer tab .

4) using version9.4

Solution
‎08-01-2016 05:15 AM
Esteemed Advisor
Posts: 5,989

Re: How to view HTML files in SaS studios

First, this:

ods html body='/home/umair/sasuser.v94/files/htmlfiles/body1.html'

is EXTREMELY bad practice IMO.

/home/username/sasuser.v94 is the directory for the SASUSER library. Nothing but the contents of the SASUSER library belong in there.

 

Second: your browser can either read files from the local filesystem, or files served by a remote HTTP server.

Your HTML result is

a) not on the local filesystem

b) not in a location where an eventual HTTP server process on the SAS system can see it; if you have a HTTP server there, putting files in

/home/username/public_html

can make them accessible by URL:

http://servername/~username/filename.html

in a browser. Since SAS Studio does not have all the information necessary for this handover to the local browser (your SAS workspace server instance may not have the same name as the HTTP server), it downloads the file for display using its own communication channel.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Post a Question
Discussion Stats
  • 3 replies
  • 331 views
  • 0 likes
  • 2 in conversation