BookmarkSubscribeRSS Feed
KevinC_
Fluorite | Level 6
Hello,

The below code works but I don't understand how. It uses ODS to create an output .html file. What I don't understand is why is it using ODS HTML with ODS PDF CLOSE? I was expecting to see ods html with ods html close.

Thanks for your input.


ODS Listing CLOSE;
ODS HTML style=barrettsblue

body="V:\TMT\\Output\MAP_&campaign_id._Excl_Waterfall.html";
proc report
.......
.......
run;

ODS PDF CLOSE;
ODS LISTING;
4 REPLIES 4
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Uhhh - can you share with us who wrote the code? And I expect you will not see any SAS-generated diagnostic message when the PDF destination is closed, even if not open. Keep in mind that your open ODS destination(s) will be closed automatically at the end of your session/job.

Are you just curious to see the SAS code in your program or are you attempting to debug a "perceived" problem symptom?

Scott Barry
SBBWorks, Inc.
KevinC_
Fluorite | Level 6
Hi sbb,

I am just curious to see why this works. The person who wrote this code has moved on elsewhere.

The code works and I don't see any errors associated with this ODS code. Is 'ods html close' the proper way to close the destination ?

Thanks.
Cynthia_sas
SAS Super FREQ
Hi:
This will not put any error messages in your log, but it is a problem. For one thing, the HTML file is left open and any subsequent ODS HTML statement will clobber this file. The ODS PDF CLOSE should be corrected to either:
[pre]
ODS _ALL_ CLOSE or ODS HTML CLOSE;
[/pre]

To me, it looks like this might have been an ODS PDF job to start that possibly got used as a model for an ODS HTML job and someone just forgot, or did not know a SAS programmer's mother's best ODS advice:
"If you open it (an ODS destination), you must close it (the SAME ODS destination)."

cynthia
KevinC_
Fluorite | Level 6
Hi Cynthia,

Thanks for your explanation.

So looks like the HTML file is left open.. that makes sense because I have noticed all of the proc freq's that come after this ODS step is included in the HTML document.. I was wondering how those proc freq's got into the HTML document. Now I see..

Thanks to all of you!

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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