SAS Component Language Dictionary |
Category: | System Variable |
Details | |
Example | |
See Also |
Details |
_METHOD_ is a character system variable that is provided automatically by the FRAME entry in SAS/AF. However, the SCL compiler does not automatically create a space for it in the SCL data vector. As a result, you get a warning when you compile a FRAME or SCL entry that uses _METHOD_, because the variable is being referenced at compile time but is not assigned a value until run time. You can safely ignore this warning. If you prefer to prevent the warning message from being generated, use the following assignment statement at the top of your program:
_method_=_method_;
_METHOD_ is useful when you have one or more methods that share the same section of code but which require a CALL SUPER.
In order to use _METHOD_, you must use the DECLARE or LENGTH statement to declare it as a character variable.
_METHOD_ has a valid value only when a method is executing.
Example |
For a window control, you may define the _update and _bupdate methods to execute the same section of code if they perform similar functions:
length _method_ $40; BUPDATE: UPDATE: method; ...code for _update and _bupdate methods... call super(_self_, _method_); endmethod;
Without _METHOD_, you would not know which method to do a CALL SUPER on, so you would have to code the above as
BUPDATE: method; methodName = '_bupdate'; link update1; endmethod; UPDATE: method; methodName = '_update'; link update1; endmethod; UPDATE1: ...code for _update and _bupdate goes here... call super(_self_, methodName); return;
See Also |
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.