Skip to Main Content
SAS 9.4 Language Reference, Second Edition
book

SAS 9.4 Language Reference, Second Edition

by SAS Institute
December 2013
Intermediate to advanced content levelIntermediate to advanced
824 pages
24h 21m
English
SAS Institute
Content preview from SAS 9.4 Language Reference, Second Edition
private Hashtable table;
public shash()
{
table = new Hashtable ();
}
public void put(double key, String value)
{
table.put(new Double(key), value);
}
public String get(double key)
{
return table.get(new Double(key));
}
}
/* DATA step code */
data _null_;
dcl javaobj sh('shash');
dcl javaobj dh('dhash');
length d 8;
length s $20;
do i = 1 to 10;
dh.callvoidmethod('vput', i, i * 2);
end;
do i = 1 to 10;
sh.callvoidmethod('put', i, 'abc' || left(trim(i))); end;
do i = 1 to 10;
dh.calldoublemethod('get', i, d);
sh.callstringmethod('get', i, s);
put d= s=;
end;
run;
The following lines are written to the SAS log:
d=2 s=abc1
d=4 s=abc2
d=6 s=abc3
d=8 s=abc4
d=10 s=abc5
d=12 s=abc6
d=14 s=abc7
d=16 s=abc8
d=18 s=abc9
d=20 s=abc10
Java Objects and Arrays
You can ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

What's New in SAS 9.4

What's New in SAS 9.4

SAS Institute
Fiber Optic Cabling, 2nd Edition

Fiber Optic Cabling, 2nd Edition

Barry Elliott, Mike Gilmore

Publisher Resources

ISBN: 9781629590004