Date: Thu, 30 May 2002 10:33:07 -0700
Reply-To: mmurphy@livebridge.com
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Mike Murphy <mmurphy@LIVEBRIDGE.COM>
Subject: FW: call java method from within SAS/BASE
Content-Type: text/plain; charset="iso-8859-1"
I have just started to learn Java, so I was curious how this would work.
I successfully complied the java code and it works. (I put it in my c:\junk
directory.)
However when I tried to run the SAS code, I got the following log results.
What did I do wrong?
7 filename javaout pipe "java c:\junk\HelloSAS";
8 data _null_;
9 infile javaout;
10 input;
11 put _infile_;
12 run;
NOTE: The infile JAVAOUT is:
Unnamed Pipe Access Device,
PROCESS=java c:\junk\HelloSAS,RECFM=V,
LRECL=256
Stderr output:
java.lang.NoClassDefFoundError: c:\junk\HelloSAS
Exception in thread "main"
NOTE: 0 records were read from the infile JAVAOUT.
NOTE: DATA statement used:
real time 0.25 seconds
cpu time 0.01 seconds
Michael F. Murphy
Corporate Data Analyst
Voice: (503) 652-6000, X2056
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of
Richard A. DeVenezia
Sent: Thursday, May 30, 2002 9:45 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: call java method from within SAS/BASE
"Karl Ruertenberg" <karl________@HOTMAIL.COM> wrote in message
news:F88y5KINzq6xEfhzL1f00013818@hotmail.com...
> For SAS~java heads:
>
> How can I call getRuntime method of java.lang class Runtime from within
> SAS/Base, and direct all the returned value to the SAS LOG?
>
> Karl
Something like this ?
HelloSAS.java
---
class HelloSAS
{
public static void main( String args[] )
{
System.out.println("Hello SAS\n");
}
}
filename javaout pipe "java HelloSAS";
data _null_;
infile javaout;
input;
put _infile_;
run;
--
Richard A. DeVenezia
http://www.devenezia.com/downloads/sas/macros/#sas2xls
Use Perl to create an Excel file containing one worksheet per SAS dataset