addAllocation
public void addAllocation(java.lang.String allocation)
Add an allocation request to be sent to the Syncsort™ MFX invocation.
The allocation strings are expected to be in the syntax required by BPXWDYN.
Typically, Syncsort™ MFX may have allocations for the following DDs:
-
SORTIN – where Syncsort™ MFX gets sort/merge input.
-
SORTOUT – where Syncsort™ MFX writes sort/merge output
Example:
Syncsort syncsort = new Syncsort(); syncsort.addAllocation
("alloc fi(sortin) da('HLQ.MY.DATASET') reuse shr
msg(2)");
addControlStatement
public void addControlStatement(java.lang.String controlStatement)
Add a control statement to be sent to the Syncsort™ MFX invocation.
Example:
Syncsort syncsort = new Syncsort(); syncsort.addControlStatement("SORT
FIELDS=(1,80,CH,A)");
setInputStreamRecLen
public void setInputStreamRecLen(int reclen)
Set a fixed record length for the records that will be sent as input to Syncsort™ MFX. This length must match the record length expected by Syncsort™ MFX as specified by the RECORD control statement.
Parameters:
reclen – int the input record length for fixed records
setInputStreamHasRdws
public void setInputStreamHasRdws()
This method is mutually exclusive with setInputStreamRecLen(int) and disableInputStream().
disableInputStream
public void disableInputStream()
This method is mutually exclusive with setInputStreamRecLen(int) and setInputStreamHasRdws().
setOutputStreamRecLen
public void setOutputStreamRecLen(int reclen)
This method is mutually exclusive with setOutputStreamHasRdws() and disableOutputStream().
Parameters:
reclen – int the output record length for fixed records.
setOutputStreamHasRdws
public void setOutputStreamHasRdws()
This method is mutually exclusive with setOutputStreamRecLen(int) and disableOutputStream().
disableOutputStream
public void disableOutputStream()
This method is mutually exclusive with setOutputStreamRecLen(int) and setOutputStreamHasRdws().
getChildStdinStream
public java.io.OutputStream getChildStdinStream()
Returns a java.io.OutputStream that can be used to send records to the child Syncsort™ MFX process. This data stream is used to provide input to Syncsort™ MFX via a sort input exit as an alternative to DD:SORTIN.The data sent to this stream should be fixed length records if setInputStreamRecLen(int)() has been used, or RDW-prefixed records if setInputStreamHasRdws() has been used.
If however, disableInputStream() was set (the default), then this stream has no use, as input to Syncsort™ MFX will come from DD:SORTIN. For better performance, this OutputStream should be wrapped in a BufferedOutputStream.
Returns:
java.io.OutputStream
Throws:
java.lang.IllegalStateException – if called before execute()
getChildStdoutStream
public java.io.InputStream getChildStdoutStream()
Returns a java.io.InputStream that can be used to read output records from the child Syncsort™ MFX process. This data stream will contain sorted output data from Syncsort™ MFX via a sort output exit as an alternative to DD:SORTOUT. The data sent to this stream should be fixed length records if setOutputStreamRecLen(int)() has been used, or RDW-prefixed records if setOutputStreamHasRdws() has been used.
If however, disableOutputStream() was set (the default), then this stream has no use, as output from Syncsort™ MFX will go to DD:SORTOUT.
For better performance, this InputStream should be wrapped in a BufferedInputStream.
Returns:
java.io.InputStream
Throws:
java.lang.IllegalStateException – if called before execute().
getReturnCode
public int getReturnCode()
Wait for Syncsort™ MFX to complete. This method should be called after execute() and after I/O from the child’s stdin and/or stdout has been processed.
Returns:
int – the Syncsort™ MFX return code. Value unpredictable if called before execute().
Throws:
RcException –if the child process terminates abnormally without a return code.
getStderrLines
public java.util.List getStderrLines()
Return a list of stderr output lines (Strings) from the spawned Syncsort™ MFX process. This method only applies if isSameAddressSpace() = false. Otherwise, Syncsort™ MFX messages will be written to Java’s stderr.
Returns:
List – a list of strings.
setSameAddressSpace
public void setSameAddressSpace(boolean same)
Sets whether the child Syncsort™ MFX process will be spawned in the same address space as the Java JVM, or in a separate/new BPX address space.
Parameters:
same – flag to indicate whether the Syncsort™ MFX child invocation process should run in the same address space as the JVM. If true, run the Syncsort™ MFX child invocation process in the same address space as the JVM. If false, spawn a new address space.