Scenario 4

Code Solution

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
Partial Results: PROC PRINT Output of Work.Laguardia
Output A2.5 Partial Results: PROC PRINT Output of Work.Laguardia
Partial Results: PROC PRINT Output of Work.Laguardia
Output A2.6 Partial Output: PDF Output: LGA Airport
Partial Output: PDF Output: LGA Airport

Test Your Code Solution

  1. Correct Answer: 189KB – 199KB. You might get a slightly different answer, depending on your hardware, operating system, and software version. On the actual exam, all candidates work from the same cloned virtual machine, so the results will be consistent for grading.
  2. Correct Answer: 129
  3. Correct Answer: PAR
If your answers are not correct, verify that you used a BY statement in your PROC PRINT statement.
Last updated: February 14, 2019
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset