Introduction to Packages for the TSMODEL Procedure

The DECLARE OBJECT Statement

You use the DECLARE OBJECT statement in your custom SAS code to create one or more unique instances of package objects. Instances of the same object are completely independent from each other, and there is no limit on how many instances of an object you can create in your program. You can access package functions by simply invoking them directly from your custom SAS code, but you must declare instances of package objects in order to use them in your custom SAS code. You interact with instances of objects by invoking their methods, as is illustrated in the following statements:

  • DECLARE OBJECT name-1 (class );

  • DECLARE OBJECT name-2 (class );

  • rc1=name1.SomeMethod (Argument-1 …Argument-n );

  • rc2=name2.SomeMethod (Argument-1 …Argument-n );

These statements declare two unique instances of the class object: name1 and name2. You can interact with these two instances independently by invoking their SomeMethod method and passing in the required arguments. Method calls always return a numeric status code (rc) to indicate successful or failure. By convention, the objects in the TSMODEL procedure packages return a negative number to indicate that a computational failure has occurred.

Last updated: July 09, 2026