Dot Notation and DATA Step Component Objects


Definition

Dot notation provides a shortcut for invoking methods and for setting and querying attribute values. Using dot notation makes your SAS programs easier to read.

To use dot notation with a DATA step component object, you must declare and instantiate the component object by using the DECLARE and _NEW_ statements. For more information about creating DATA step component objects, see Using DATA Step Component Objects in SAS Language Reference: Concepts .

Syntax

The syntax for dot notation is as follows :

 object.attribute 

or

 object.method(<argument_tag-1: value-1<, ...argument_tag-n: value-n>>); 

Where

object

  • specifies the variable name for the DATA step component object

attribute

  • specifies an object attribute to assign or query.

  • When you set an attribute for an object, the code takes this form:

     object.attribute = value; 
  • When you query an object attribute, the code takes this form:

     value = object.attribute; 

method

  • specifies the name of the method to invoke.

argument_tag

  • identifies the arguments that are passed to the method. Enclose the argument tag in parentheses. The parentheses are required whether or not the method contains argument tags.

    All DATA step component object methods take this form:

     return_code = object.method(<argument_tag-1: value-1<, ...argument_tag-n: value-n>>); 

    The return code indicates method success or failure. A return code of zero indicates success; a non-zero value indicates failure. If you do not supply a return code variable for the method call and the method fails, an appropriate error message will be printed to the log.

value

  • specifies the argument value.




SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 704

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net