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 2: Object-Oriented Programming for SAS Programmers

Background and Definition

Dog Class

An Example of OOP

Moving Forward

Background and Definition

Object-oriented programming (OOP) is a programming style based on data structures that contain data in fields, which are commonly called attributes. There is also code in the form of procedures, which are commonly called methods. This combination of a data structure and code is called a class. An object is a particular instantiation of a class. All interaction with the data in an object and the program that created the object is controlled through the object’s methods.

Many explanations and definitions of OOP try to clarify the concept with a concrete example, such as a dog:

Dog Class

Attributes ...

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