| /* Load up the table */ h.callVoidMethod("put", "key1", "data1"); h.callVoidMethod("put", "key2", "data2"); h.callVoidMethod("put", "key3", "data3"); h.callVoidMethod("put", "key4", "data4"); h.callVoidMethod("put", "key5", "data5"); /* Retrieve a value */ h.callStringMethod("get", "key3", s); put s=; run; |
数组使用
| data step数组能直接传到java对象中,如 import java.util.*; import java.lang.*; class jtest { public void dbl(double args[]) { for(int i = 0; i < args.length; i++) System.out.println(args[i]); } public void str(String args[]) { for(int i = 0; i < args.length; i++) System.out.println(args[i]); } } data _null_; dcl javaobj j("jtest"); array s[3] $20 ("abc", "def", "ghi"); array d[10] (1:10); j.callVoidMethod("dbl", d); j.callVoidMethod("str", s); run; |
|