O'Reilly logo

The DS2 Procedure: SAS Programming Methods at Work by Peter Eberhardt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5: Methods

Defining Methods

System-Defined Methods

User-Defined Methods

Recursion

Defining Methods

Methods are the home of executable DS2 code. Executable statements in DS2 look like executable statements in the DATA step. That is, you add, subtract, multiply, divide, and so on, the same way in both. The important difference in DS2 is that you can put code into logical groupings called methods.

Methods act like SAS functions. A method can take arguments (parameters) and return an answer (result). Like SAS functions, methods can be saved and used in other DS2 programs.

In DS2, there are two fundamental types of methods:

•   System-defined methods

•   User-defined methods

System-Defined Methods

Because all executable code resides in methods ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required