BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
umairAbro92
Calcite | Level 5

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 ? 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

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.

View solution in original post

3 REPLIES 3
Kurt_Bremser
Super User

- 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?)

umairAbro92
Calcite | Level 5
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

Kurt_Bremser
Super User

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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 3 replies
  • 3228 views
  • 0 likes
  • 2 in conversation