Java output that is
directed to the SAS log is flushed when the DATA step terminates.
If you use the FLUSHJAVAOUTPUT method, the Java output will appear
after any output that was issued while the DATA step was running.
Example: Displaying Java Output
In the following example,
the “In Java class” lines are written after the DATA
step is complete.
/* Java code */
public class p
{
void p()
{
System.out.println("In Java class");
}
}
/* DATA step code */
data _null_;
dcl javaobj j('p');
do i = 1 to 3;
j.callVoidMethod('p');
put 'In DATA Step';
end;
run;
The following lines
are written to the SAS log:
In DATA Step
In DATA Step
In DATA Step
In Java class
In Java class
In Java class
If you use the FLUSHJAVAOUTPUT
method, the Java output is written to the SAS log in the order of
execution.
/* DATA step code */
data _null_;
dcl javaobj j('p');
do i = 1 to 3;
j.callVoidMethod('p');
j.flushJavaOutput();
put 'In DATA Step';
end;
run;
The following lines
are written to the SAS log:
In Java class
In DATA Step
In Java class
In DATA Step
In Java class
In DATA Step