Dot Notation and 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 either the DECLARE statement by itself or the DECLARE statement and the _NEW_ operator together. For PROC FCMP component objects, use only the DECLARE statement by itself. and SAS Viya Logging Facility for SAS Programs and Jobs.
Syntax
The syntax for dot notation is as follows:
or
The arguments are defined as follows:
- object
-
specifies the variable name for the 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 the method contains argument tags.
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 nonzero value indicates failure. If you do not supply a return code variable for the method call and the method fails, an appropriate error message is printed to the log.
- value
-
specifies the argument value.