Scenario 4

Code Solution

Note: On the live exam, you will be evaluated both on the results of your code and the code itself. Your code should be similar to the following example code, but does not need to match exactly :
footnote 'Printed on
                      %sysfunc(today(),worddate.)';  /*1*/
%macro test (dsn=, vars=);                           /*2*/
   proc print data=&dsn;
   where begin_date=21774;
   var &vars;
   run;
%mend test;                                          /*3*/
%test(dsn=certadv.all, vars=course_code fee);        /*4*/
1 The %SYSFUNC function executes the SAS function TODAY and formats the value Worddate. using the macro facility.
2 The %MACRO statement defines the macro Test, which accepts the keyword parameters Vars and Dsn. The macro generates a PROC PRINT step.
3 The %MEND statement ends the macro definition of Test.
4 The %test statement calls the macro Test with a Dsn parameter value of Certadv.All and Vars parameter values of Course_Code and Fee. When executed, it generates a PROC PRINT step that reads the Certadv.All data set and prints only the columns Course_Code and Fee.
Output 17.5 PROC PRINT of Certadv.All (partial output)
Partial Output: PROC PRINT of Certadv.All

Test Your Code Solution

  1. Correct Answer: 23
  2. Correct Answer: Yes
Last updated: October 16, 2019
..................Content has been hidden....................

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