Introduction to ODS!!!


                       One of the most important changes in SAS, starting with Version 7, was the introduction of the Output Delivery System, abbreviated as ODS. Prior to ODS, each SAS procedure
produced its own unique output, usually featuring a non-proportional font.

                       Each SAS procedure creates output objects that can be sent to such destinations as HTML, RTF, PDF, and SAS data sets.There is now a separation between the results produced by each procedure and the delivery of this information. Not only can you send your SAS output to all of these formats, you can, if you are brave enough, customize the output’s fonts, colors, size, and
layout. Finally, you can now capture virtually every piece of SAS output to a SAS data
set for further processing.

#Problem:

                         Run the following program, sending the output to an HTML file. Issue the appropriate commands to prevent SAS from creating a listing file.

title "Sending Output to an HTML File";
proc print data=learn.college(obs=8) noobs;
run;
proc means data=learn.college n mean maxdec=2;
var GPA ClassRank;
run;


#Solution:


options fmtsearch=(A15028);
ods listing close;
ods html file = '/folders/myfolders/prob19_1.html';
title "Sending Output to an HTML File";
proc print data=A15028.A28_college(obs=8) noobs;
run;
proc means data=A15028.A28_college n mean maxdec=2;
var GPA ClassRank;
run;
ods html close;
ods listing;

#Output:





#Explanation:

                            In the above example we tried to get the output as HTML page rather than the normal listing output. If you do not want a listing style output, use the ODS statement before the
ODS HTML FILE statement. Next. to get the output as an HTML file, we use the ODS html statement to give a local path so that tho output can be saved in that place as an HTML file. Finally, If you want to reinstate the listing output, use "ods listing" which will reinstate the listing output.

No comments:

Post a Comment