From the course: SAS® 9.4 Cert Prep: Part 10 Manipulating Data with Functions
Unlock this course with a free trial
Join today to access over 22,600 courses taught by industry experts.
Using a CALL routine to modify data - SAS Tutorial
From the course: SAS® 9.4 Cert Prep: Part 10 Manipulating Data with Functions
Using a CALL routine to modify data
- [Instructor] Now let's talk about call routines. Like functions, call routines perform a computation or a system manipulation based on the input you provide in arguments. However, a call routine does not return a value. Instead, it alters column values or performs other system functions. For a call routine to modify the value of an argument, those arguments must be supplied as column names. Constants and expressions are not valid. All SAS call routines are invoked with call statements. In other words, the name of the routine must appear after the keyword call in the call statement. Let's look at an example of using a call routine. Suppose we have students who have taken five quizzes and we want to drop each student's lowest two quiz scores and base their grade on the average of the top three scores. The call sortn routine takes the columns provided as arguments and reorders the numeric values for each student from low to high.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.