Java Object Language Elements |
Category: | Method reference |
Syntax | |
Arguments | |
Details | |
Comparisons | |
Example | |
See Also |
Syntax |
object.CALLSTATICtypeMETHOD ("method-name", <method-argument-1 ..., method-argument-n>, <return value>); |
specifies the name of the java object.
specifies the result type for the static Java method. The type can be one of the following values:
specifies that the result type is BOOLEAN.
specifies that the result type is BYTE.
specifies that the result type is CHAR.
specifies that the result type is DOUBLE.
specifies that the result type is FLOAT.
specifies that the result type is INT.
specifies that the result type is LONG.
specifies that the result type is SHORT.
specifies that the result type is STRING.
specifies that the result type is VOID.
See Also: | Type Issues in SAS Language Reference: Concepts |
specifies the name of the static Java method.
Requirement: | The method name must be enclosed in either single or double quotation marks. |
specifies the parameters to pass to the method.
specifies the return value if the method returns one.
Details |
Once you instantiate a java object, you can access any static Java method through method calls on the java object by using the CALLSTATICtypeMETHOD method.
Note: type represents a Java data type. For more information about how Java data types relate to SAS data types, see Type Issues in SAS Language Reference: Concepts.
Comparisons |
Use the CALLSTATICtypeMETHOD method for static Java methods. If the Java method is not static, use the CALLtypeMETHOD method.
Example |
The following example creates a simple class that contains three static fields. The java object j is instantiated, the field values are set and then retrieved by using the CALLSTATICtypeFIELD method.
/* Java code */ import java.util.*; import java.lang.*; public class ttestc { public static double d; public static double dm() { return d; }
/* DATA step code */ data x; declare javaobj j("ttestc"); length d 8; j.SetStaticDoubleField("d", 3.14159); j.callStaticDoubleMethod("dm", d); put d=; run;
The following line is written to the SAS log:
d=3.14159
See Also |
Method: |
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.