Can someone please explain why we need a close statement in Output Delivery System in SAS. The sample code is below:
ods html close;
This statement closes the file (ends access by the SAS process), but more importantly, it writes information that is needed to get structural integrity. In HTML, this means that ending tags like
</BODY> </HTML>
are written.
Hi:
With interfaces like Enterprise Guide and SAS Studio, it frequently appears as if no ODS statements are needed at all in your code. However, you will notice that most of the code in our book also has a beginning ODS statement --
ODS HTML path="..." file="...";
*** more SAS code;
ODS HTML CLOSE;
So that the close statement always "matches" an open statement for the destination.
When you are taking full control over the output -- such that you control the output location and file name, then it's like your Mom said -- if you open it you should close it. So any ODS "open" statement needs a matching ODS "close" statement or uses the universal
ODS _ALL_ CLOSE;
Hope this helps,
Cynthia
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.