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

As I often add all the bells and whistles, at least at first, in procedure offerings, sometimes the total output is large.  Viewing the output from within SAS in Results Viewer goes well. 

 

All that output is placed in an .html file in the relevant library.  For later review.  Therein lies the rub.

 

It seems the .html file is too large to be handled subsequently by any web browser I've come across.  And the big .html file is not easily convertible to another format, by any means I've yet to find.

 

I'm thinking that it would be great to save all the output components separately.  Have any of you had a similar experience?

 

How does one save all output separately?

 

Thanks!

 

Nicholas Kormanik

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

That autoexec may be the cause of problems opening the file.

Where do you have and ODS HTML5 CLOSE; statement?

Until a CLOSE for an ODS destination is encountered then the output file is not complete and still open in SAS. HTML browsers are pretty flexible generally and don't mind other programs using it. But an incomplete file is very likely the issue unless you are extremely good about always executing a CLOSE before shutting down SAS.

 

Additionally when I search here: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/odsug/p0hcv8gpxqebnpn1is52we2enltx.htm   FILE= is not an option , likely you need BODY= (and a URL= may be needed to keep internal links pointing to correct location. Another possible issue may be your file extension of HTM, may not be telling your browser that an HTML5 document is expected and might cause additional behavior issues.

 

In a personal style note, I tend to keep as much stuff outside of an ODS destination and Close statement as practical. Mainly because I have found that some options such as Papersize and few others need to be set prior to the ODS destination open because changes inside either do not get applied or behave poorly. Also keeping data manipulation outside of ODS "sandwiches" means that possibly quite lengthy operations do not have to get repeated when I want to just generate output, such as changing appearance options or an "OOPS, missed that variable" .

View solution in original post

9 REPLIES 9
Reeza
Super User

1. Use a different output destination - PDF that doesn't have the file size issues - change output options in preferences or wrap code the code in ODS PFD/WORD.

2. Usually if you have that much output, selectively choose what is included and exclude unnecessary outputs using ODS SELECT/EXCLUDE.

3. Pipe results to a data set instead of trying to navigate HTML/PDF files and analyze it more systematically. ODS OUTPUT.

 

Here's some instructions and explanations on how to capture output that is shown.
https://blogs.sas.com/content/sastraining/2017/03/31/capturing-output-from-any-procedure-with-an-ods...

 


@NKormanik wrote:

As I often add all the bells and whistles, at least at first, in procedure offerings, sometimes the total output is large.  Viewing the output from within SAS in Results Viewer goes well. 

 

All that output is placed in an .html file in the relevant library.  For later review.  Therein lies the rub.

 

It seems the .html file is too large to be handled subsequently by any web browser I've come across.  And the big .html file is not easily convertible to another format, by any means I've yet to find.

 

I'm thinking that it would be great to save all the output components separately.  Have any of you had a similar experience?

 

How does one save all output separately?

 

Thanks!

 

Nicholas Kormanik

 


 

 

PaigeMiller
Diamond | Level 26

No, I have not run into this problem where the output is so large that it can't be handled by web browsers.

 

As always, much more detailed information and specific information is needed.

 

You may want to think about do you need all the options you have selected, and do you need all the outputs you have saved.

 

You can use ODS SELECT or ODS EXCLUDE to choose the parts of the output you want to keep, or choose the parts of the output you want to exclude. You can write output to multiple HTML files, so perhaps each PROC's output goes to its own HTML file. If you have ODS GRAPHICS turned on, you might want to turn it off for many PROCs (or EXCLUDE some of the graphs you won't be using)

 

If you are in the habit (as some people are) of doing a PROC PRINT of every data set, stop doing this. We had a thread recently where someone was trying to do a PROC PRINT on 180,000 records (or was it 180 million?) and over 5,000 variables, what is the purpose of PROC PRINT here? No one could look at that output and benefit, even if the web browser could possibly display it.

 

If you are in the habit (as some people are) of running PROC CONTENTS on every (or most) data sets, stop doing this. (CONTENTS output can be sent to a DATA set so you won't see it in the HTML file).

--
Paige Miller
PaigeMiller
Diamond | Level 26

Adding: I have been doing this for probably 20 years now, so I didn't even think of it when I typed my answer above.

 

The default output location for all SAS output is HTML. I turn this off, so for me there is NO default output location and thus nothing gets written to HTML. I do this by placing this command into my AUTOEXEC file.

 

ods html close;

Then, output gets written to HTML only when I specifically turn on the HTML output. A usual program for me involves intermediate steps, that merge data sets, clean the data, perform some basic operations, where I do not need the results written to HTML; instead the results go to SAS data sets for later use. For example, if I have a list of 87000 customers, and I want to identify "risky" customers, somewhere along the way I have to determine average value of VAR1 and number of times VAR2 occurred and the maximum of VAR3 so on, I don't need the output of PROC MEANS to compute the averages sent to HTML. This is an intermediate step, no one is going to look at 87000 statistics and customer IDs. The results go to a DATA set, not to HTML.

 

Near the end of the program, I usually will then create some "final" output using PROC REPORT or SGPLOT or whatever, then I specifically turn on the HTML output.

--
Paige Miller
ballardw
Super User

@NKormanik wrote:

 

All that output is placed in an .html file in the relevant library.  For later review.  Therein lies the rub.

 


Since SAS has a very specific meaning for Library I doubt that reference to "library" is the same. So how do you place that html output into your library?

 

My output from multiple procedures gets placed into multiple html files while running. So any thing using that output would not be a single file and would not have links between multiple output runs that a browser could follow.

NKormanik
Barite | Level 11

@Reeza  All helpful advice.  Were yours the only response I'd mark this question as answered.

 

@PaigeMiller  Greatly appreciated explanation.  Thank you!

 

@ballardw   I'm still in the primitive phase, sadly.  All output from procedures is dumped into c:\sas_1.  That pretty much is THE library.  And there is generally one single .html file in there, always with the same little name, containing everything done.

 

A little lightbulb turns on in my brain to learn from you folks that things can be much, much more complicated.

 

 

ballardw
Super User

Proc document can be used with items in the Results window to rearrange, select and direct to another document.

 

Still wondering how you get one html file though.

 

NKormanik
Barite | Level 11

@ballardw 

autoexec.sas contents:

(open to suggestions, by the way....)

 

options
validvarname=any
linesize=max
pagesize=max
nonumber
nodate
nocenter
sasautos=(mymacros sasautos)
mautosource
lrecl=32767
;

libname SAS_1 'c:\0_SAS_1'
;

filename mymacros 'c:\SAS_Macros'
;

ods _all_ close
;

ods graphics on /
antialias=on
antialiasmax=1000000
attrpriority=color
border=on
dataskinmax=1000000
discretemax=1000000
groupmax=1000000
height=1080px
imagefmt=PNG
imagemap=on
imagename="graph_"
labelmax=1000000
labelplacement=sa
legendareamax=0
linepatternobsmax=1000000
loessobsmax=1000000
nbinsmax=1000000
noborder
nxybinsmax=1000000
obsmax=5000000
outputfmt=static
panelcellmax=1000000
scale=on
scalemarkers=off
stackdepthmax=1000000
subpixel=on
tipmax=1000000
totalcellmax=1000000
width=1920px
;

ods
html5
style=daisy
accessible_graph
path="c:\0_SAS_1"
image_dpi=300
file="ods.htm"
;

goptions
reset=all
accessible

colors=(CX000066 CX000080 CX000099 CX0000b3 CX0000cc CX0000e6 CX0000ff CX1a1aff CX3333ff CX4d4dff CX6666ff CX8080ff CX9999ff CXb3b3ff CXccccff CXe6e6ff CXffffff CXffe6e6 CXffcccc CXffb3b3 CXff9999 CXff8080 CXff6666 CXff4d4d CXff3333 CXff1a1a CXff0000 CXe60000 CXcc0000 CXb30000 CX990000 CX800000 CX660000) /* device=actximg */ device=PNG300 ftext="Albany AMT" /* ftext="HelveticaNeueforSAS" */ gsfmode=replace gsfname=grafout gunit=pct htext=2pct htitle=2pct noborder target=png xpixels=1920 ypixels=1080 ; x 'cd c:\0_SAS_1' ;
ballardw
Super User

That autoexec may be the cause of problems opening the file.

Where do you have and ODS HTML5 CLOSE; statement?

Until a CLOSE for an ODS destination is encountered then the output file is not complete and still open in SAS. HTML browsers are pretty flexible generally and don't mind other programs using it. But an incomplete file is very likely the issue unless you are extremely good about always executing a CLOSE before shutting down SAS.

 

Additionally when I search here: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/odsug/p0hcv8gpxqebnpn1is52we2enltx.htm   FILE= is not an option , likely you need BODY= (and a URL= may be needed to keep internal links pointing to correct location. Another possible issue may be your file extension of HTM, may not be telling your browser that an HTML5 document is expected and might cause additional behavior issues.

 

In a personal style note, I tend to keep as much stuff outside of an ODS destination and Close statement as practical. Mainly because I have found that some options such as Papersize and few others need to be set prior to the ODS destination open because changes inside either do not get applied or behave poorly. Also keeping data manipulation outside of ODS "sandwiches" means that possibly quite lengthy operations do not have to get repeated when I want to just generate output, such as changing appearance options or an "OOPS, missed that variable" .

PaigeMiller
Diamond | Level 26

You're welcome, @NKormanik .

 

I wish more users would ask about best practices. Even members of my own department seem unwilling to adopt methods that would allow them to get at results faster.

--
Paige Miller

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
  • 9 replies
  • 1153 views
  • 6 likes
  • 4 in conversation