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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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