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.
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?
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:
ODS _ALL_ CLOSE or ODS HTML CLOSE;
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)."
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..