Previous Page | Next Page

Java Object Language Elements

FLUSHJAVAOUTPUT Method



Specifies that the Java output is sent to its destination.
Category: Output

Syntax
Arguments
Details
Example
See Also

Syntax

object.FLUSHJAVAOUTPUT( );


Arguments

object

specifies the name of the java object.


Details

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

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


See Also

Java Standard Output in SAS Language Reference: Concepts

Previous Page | Next Page | Top of Page