Created
December 6, 2012 08:35
-
-
Save Benjit87/4222767 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Use SAS to call Java Object * | |
* http://benjithian.sg/2012/12/sas-with-java/ */ | |
/* Sample Data from Google Chart API*/ | |
data Work.test; | |
infile datalines missover; | |
input Topping $ Slices $; | |
datalines; | |
Mushroom 3 | |
Onions 1 | |
Olives 1 | |
Zucchini 1 | |
Pepperoni 2 | |
; | |
run; | |
data _null_; | |
declare javaobj j("Chart");*create the Chart object; | |
do i = 1 to RowCount; *use direct access to get all the rows; | |
set Work.test Point=i nobs=RowCount; | |
*call the put method in Chart class to put the data; | |
j.callVoidMethod("put",Topping,Slices); | |
end; | |
j.callvoidmethod("write"); *write it out to a file; | |
stop;*need to use stop if u are using Point= else it will loop endlessly; | |
run; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment