Chapter 5 – SAS Procedures
Humphrey Brydon
Office 3.25
hbrydon@[Link]
Formatting Display Output
• Formatting the display output makes it easier to read.
• Only changes the output that is displayed.
• Raw data should not be formatted for display purposes.
• Assign formats in the proc format step and recall these formats in the
proc print step.
• Formats can be applied to a single variable or a range of variables.
Formatting Display Output
*[Link]
Titles and Footnotes
• The ‘Title’ statement places text at the top of each output.
• The ‘Footnote’ statement places text at the end of each output.
• To delete a title or footnote simply declare the ‘Title’ or ‘Footnote’
statement without any text.
*[Link]
Comments
• Add comments in your program as explanatory text
• Comments allow you to understand your code better
• Comments can be added in two ways:
o Placing text between /* and */ (e.g. /*My Comment*/ )
o Placing text between * and ; (e.g. *My Comment; )
• All commented text should be green
Modifying Proc Print
• Specify these options in the proc statement
o “double” – double spaces the output
o “label” – allows you to include any labels
o “N = “- Declares a heading and calculates a count for the number
of observations
o “OBS = “- Specifies a label for the observation number column
o “ROUND “– rounds the values
*[Link]
ODS Output
• Enhance your output using the ODS output statement
• Declare “ODS HTML; ” before the output you want to enhance
• Close the ODS output using the “ODS HTML close; ” directly after the
code for the output that you want to enhance
• You can replace “HTML” with PDF, RTF, etc. depending on the output
you want.
• HTML is the default format from SAS9.4 onwards.
*[Link]
READ THROUGH CHAPTER 5