Thus far, we've learned only the very basic function of the PRINT procedure as a way to print the data in a SAS data set. The reality is that the PRINT procedure is a powerful tool for creating quite informative, yet simple reports from SAS data sets. We'll spend most of this lesson, therefore, investigating the various features and options of the PRINT procedure. Because it is often helpful to present the data in reports in a particular order, we'll also get a brief introduction to the SORT procedure along the way.
Upon completing this lesson, you should be able to use the PRINT procedure to print a data set in various formats, including:
- apply a title or footnote to a printed page of SAS output
- use the FIRSTOBS= and OBS= options to print a subset of the observations in a SAS data set
- use the VAR statement to print a subset of the variables in a SAS data set
- use the NOOBS option to suppress the printing of the observation number
- use the LABEL option to print variable labels
- use the SPLIT= option to split labels used as variable headings
- use the ID statement to emphasize key variable(s)
- use the DOUBLE option to double-space your output
- use the FORMAT statement to print a variable in a previously specified format
- use the WHERE statement to print only a subset of the data, namely the subset meeting the condition specified in the WHERE statement
- use the SUM statement to specify the sum of certain variables
- use a BY statement to print observations in groups based on the values of the different BY groups
- use the UNIFORM option to make sure the columns of data line up from one report to the next
You should also be able to use the SORT procedure to sort the data in your SAS data sets.