Scenario 1

Directions

This scenario uses the Certadv.All data set. Write a SAS program that does the following:
  • In a PROC FCMP step, create a temporary custom function called Adding with a numeric argument named Val. The function itself returns the value of Final, which is the value of 38 added to the value of Val. Store the function in the output library Work with the table name of Function and the package name of Add.
  • In a global statement, add the appropriate option so that SAS knows where to search for the custom function.
  • In a DATA step, create the temporary data set named Work.StudentCost by reading in the data set Certadv.All. Create a custom function for the Fee variable to create a variable named Final_Cost.
  • In a PROC PRINT step, create a report based on Work.StudentCost with the following variables displayed: Student_Name, Course_Code, Fee, and Final_Cost.

Test Your Code

  1. What is the value of Final_Cost for observation 144?
  2. What is the value of Final_Cost for observation 282?

Exam Objective

Create custom functions with the FCMP procedure.
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
13.58.6.202