Previous Page | Next Page

The Structure of SCL Programs

USECLASS Blocks in SCL Programs

USECLASS blocks contain method blocks. A USECLASS block binds the methods that are implemented within it to a class definition. This binding enables you to use the attributes and methods of the class within the methods that are implemented in your USECLASS block. However, your USECLASS block does not have to implement all of the methods defined in the class.

For example, the USECLASS block for the class defined in Defining Classes in SCL Programs would be stored in work.a.simMeth.scl and would contain the following code:

USECLASS Block for the addNums Method

useclass simple.class;
  addNums: public method n1:num n2:num return=num;
       total=n1+n2;
       return(total);
  endmethod; 
enduseclass;

Using USECLASS blocks to separate the class definition from the method implementations enables multiple programmers to work on method implementations simultaneously.

For more information, see SAS Object-Oriented Programming Concepts; The SCL USECLASS Statement; and USECLASS.

Previous Page | Next Page | Top of Page