The solution listed
below is one example of a program that could be used to accomplish
each task within the scenario. Your code can be different, as long
as it results in the same answers.
proc sort data=cert.laguardia out=work.laguardia; /*#1*/
by dest;
run;
title 'Laguardia Flights'; /*#2*/
ods pdf file='LGA Airport' style=FestivalPrinter; /*#3*/
proc print data=work.laguardia; /*#4*/
by dest; /*#5*/
run;
ods pdf close; /*#6*/
1 |
When using the SORT procedure,
the DATA= option specifies the input data set, and the OUT= option
specifies the output data set. The required BY statement specifies
the sorting variables.
|
2 |
The TITLE statement specifies title
lines for SAS output. In this example, the TITLE statement titles
the output Laguardia Flights.
|
3 |
The ODS PDF statement opens the
PDF destination, which produces a PDF output. The PDF file is named
LGA Airport, and FestivalPrinter is used as the style template with
a .pdf extension.
|
4 |
The PROC PRINT statement prints
the observations of Work.Laguardia using all of the variables. See Partial Results: PROC PRINT Output of Work.Laguardia. |
5 |
The BY statement in the PRINT procedure
produces a separate section in the report for each BY group. As there
are four destinations in Work.Laguardia, four separate sections are
produced.
|
6 |
The ODS PDF CLOSE statement closes
the PDF destination.
|
Output A2.4 Partial Results: PROC PRINT Output of Work.Laguardia
Output A2.5 Partial Results: PROC PRINT Output of Work.Laguardia
Output A2.6 Partial Output: PDF Output: LGA Airport