Modifies the value of a static field for a Java object.
Category: | Field Reference |
Applies to: | Java object |
specifies the name of a Java object.
specifies the type for the Java field. The type can be one of the following values:
specifies that the field type is BOOLEAN.
specifies that the field type is BYTE.
specifies that the field type is CHAR.
specifies that the field type is DOUBLE.
specifies that the field type is FLOAT.
specifies that the field type is INT.
specifies that the field type is LONG.
specifies that the field type is SHORT.
specifies that the field type is STRING.
See | Type Issues in SAS Language Reference: Concepts |
specifies the Java field name.
Requirement | The field name must be enclosed in either single or double quotation marks. |
specifies the value for the field.
j
is instantiated, the field
values are set using the SETSTATICtypeFIELD
method, and then the field values are retrieved.
/* 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 _null_; dcl javaobj j("ttest"); length val 8; length str $20; j.setStaticIntField("i", 100); j.setStaticDoubleField("d", 3.14159); j.setStaticStringField("s", "abc"); j.getStaticIntField("i", val); put val=; j.getStaticDoubleField("d", val); put val=; j.getStaticStringField("s", str); put str=; run;
val=100 val=3.14159 str=abc