Java run REXX. Sample failed.

General discussion on the JZOS batch launcher and toolkit
Post Reply
curious_man
Posts: 9
Joined: Thu Jul 10, 2014 6:21 am

Java run REXX. Sample failed.

Post by curious_man » Thu Jul 10, 2014 6:40 am

Hi! I have some troubles, when run on mainframe a IBM java-sample code-> jzos_sample_2.4.0(com\ibm\jzos\sample\MvsJobOutput).
But,I have error.See below:
SYSOUT:

parse: /u/DAINEK/MvsSubmitJob2/jobStatus 1: FSUM7351 not found
/u/DAINEK/MvsSubmitJob2/jobStatus 5: FSUM7332 syntax error: got EOF, expecting then

FSUM7351:
not found
Explanation
You attempted to execute a command that could not be found.
User response
Ensure that the command exists and that the PATH environment variable is valid.

FSUM7332:
syntax error: got string1 expecting string2
Explanation
When processing your input, the shell encountered string1 when it was expecting string2.
User response
Check the description of sh in z/OS UNIX System Services Command Reference for the correct syntax for various shell commands. Reenter your input with the correct syntax.

Help me,please! What wrong?
Sorry For My Bad English)

Source:
-----------------------------------------------------------------------------------------------------------------------------------
JCL:
//IASOUT JOB '9999','Run Hello World',
// CLASS=A,MSGCLASS=H,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//JAVA EXEC PROC=JVMPRC61,
// JAVACLS='MvsJobOutput',
// ARGS='IASOUT JOB05434',
// LOGLVL='+T'
//IN1 DD DSN=DAINEK.TAPE,DISP=SHR
//STDENV DD *
. /etc/profile
export JAVA_HOME=/usr/lpp/Java601_31/J6.0.1
export PATH=/bin:"${JAVA_HOME}"/bin
LIBPATH=/lib:/usr/lib:"${JAVA_HOME}"/bin
LIBPATH="$LIBPATH":"${JAVA_HOME}"/lib/s390
LIBPATH="$LIBPATH":"${JAVA_HOME}"/lib/s390/j9vm
LIBPATH="$LIBPATH":"${JAVA_HOME}"/bin/classic
export LIBPATH="$LIBPATH":
APP_HOME=$JAVA_HOME
CLASSPATH=$APP_HOME:"${JAVA_HOME}"/lib:"${JAVA_HOME}"/lib/ext
for i in "${APP_HOME}"/*.jar; do
CLASSPATH="$CLASSPATH":"$i"
done
export CLASSPATH="$CLASSPATH":
IJO="-Xms16m -Xmx128m"
export IBM_JAVA_OPTIONS="$IJO "
export CLASSPATH="$CLASSPATH":/u/DAINEK/MvsSubmitJob2
-Djzos.script.path=/u/DAINEK/MvsSubmitJob2 // jobStatus and jobOutput REXX scripts

MvsJobOutput.class:
/*
* %Z%%W% %I%
*
* =========================================================================
* Licensed Materials - Property of IBM
* "Restricted Materials of IBM"
* (C) Copyright IBM Corp. 2011. All Rights Reserved
*
* DISCLAIMER:
* The following [enclosed] code is sample code created by IBM
* Corporation. This sample code is not part of any standard IBM product
* and is provided to you solely for the purpose of assisting you in the
* development of your applications. The code is provided 'AS IS',
* without warranty of any kind. IBM shall not be liable for any damages
* arising out of your use of the sample code, even if they have been
* advised of the possibility of such damages.
* =========================================================================
*/
//package com.ibm.jzos.sample;

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import java.util.StringTokenizer;

import com.ibm.jzos.Exec;
import com.ibm.jzos.RcException;
import com.ibm.jzos.ZUtil;

/**
* Sample program which reads all sysout data for a MvsJob (jobname and jobid),
* and writes the output to a specified Writer.
*
* The class relies on the sample REXX script "jobOutput", spawned as a child process
* via the {@link com.ibm.jzos.Exec} class.
*
* @since 2.1.0
*/
public class MvsJobOutput {

public static final String JOB_STATUS_CMD = "jobStatus";
public static final String JOB_OUTPUT_CMD = "jobOutput";

/**
* A sample main method that writes sysout output for
* a job to System.out (STDOUT).
*
* The first argument is the jobname, and the second argument
* is the jobid (JOBnnnnn).
*/
public static void main(String[] args) throws IOException {

if (args.length < 2 ) {
throw new IllegalArgumentException("Missing arguments: jobname jobid");
}

MvsJob mvsJob = new MvsJob(args[0], args[1]);

// print out the status of the job
// this will throw an exception if there is no such job
System.out.println("JOB " + mvsJob + " " + getStatus(mvsJob));

BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));
writeJobOutput(mvsJob, writer);
writer.close();
}

/**
* Returns the job status using the TSO "status" command, which
* is invoked via the "jobStatus" REXX USS script.
*
* @return String the TSO "STATUS" command status
* @throws IOException if there was an error communicating with the child REXX script process
*/
public static String getStatus(MvsJob job) throws IOException {
Exec exec = new Exec(getStatusCommand(job), getEnvironment());
//exec.run();

//start test
try{
//exec.setTimeout(60000);
exec.run();
}catch(Exception e){
System.out.println("now occured exeptions, when exec.run!!!");
e.printStackTrace();
System.exit(8);
}

//System.out.println("after exec.run");
//System.out.println("getStatus MvsJobOutput");
//*
//exec.setTimeout(5000);
//exec.run();
System.out.println("String line = exec.readLine();");
String line1 = null;
try{
line1 = exec.readLine();
System.out.println("length content =" + line1);
System.out.println("exec.getReturnCode() =" + exec.getReturnCode());

}catch(Exception e){
System.out.println("error String line = exec.readLine();");
e.printStackTrace();
System.exit(8);
}
///*
//System.out.println("after run");
//String line1 = exec.readLine();
//System.out.println("line ="+line1);
List lst = exec.getErrorLines();
Iterator it=lst.iterator();
while(it.hasNext())
{
String value=(String)it.next();

System.out.println("Value :"+value);
}//*/
//end test
String line = exec.readLine();
if (line == null) throw new IOException("No output from jobStatus child process");

// close the stream which is connected
// to the stdin input of the external process
BufferedWriter wdr = exec.getStdinWriter();
wdr.close();

// slurp other output
while (exec.readLine() != null) {};

int rc = exec.getReturnCode();
if (rc != 0) {
throw new RcException("REXX 'jobStatus' process failed: " + line, rc);
}

StringTokenizer tok = new StringTokenizer(line);
if (tok.countTokens() < 3 ) {
throw new IOException("Invalid output from jobStatus child process: " + line);
}

String next = tok.nextToken();

// skip over message id
if (next.startsWith("IKJ")) {
next = tok.nextToken();
}

if (!next.equalsIgnoreCase("JOB")) {
throw new IOException("Invalid output from jobStatus child process: " + line);
}

// skip jobname(jobid)
tok.nextToken();
String answer = "";

// concat remaining words
while (tok.hasMoreTokens()) {
answer += tok.nextToken();

if (tok.hasMoreTokens()) {
answer += " ";
}
}

return answer;
}

/**
* Returns the command to be executed via Runtime.exec().
* This is the REXX script 'jobStatus' followed by the jobname and jobid.
* By default, this script needs to be present in the current PATH.
* However, if the System variable jzos.script.path is defined, it will
* be used to prefix 'jobStatus'.
*/
protected static String getStatusCommand(MvsJob job) {
String cmdPath = System.getProperty("jzos.script.path", "/u/DAINEK/MvsSubmitJob2");
if (cmdPath.length() > 0 && !cmdPath.endsWith("/")) {
cmdPath = cmdPath + "/";
}

cmdPath = cmdPath + JOB_STATUS_CMD
+ " "
+ job.getJobname()
+ " ";

if (job.getJobid() != null) {
cmdPath = cmdPath + job.getJobid();
}
System.out.println("cmdPath= " + cmdPath);
return cmdPath;
}

/**
* Writes all of the output for a given job to a writer.
* Note: this method flushes the writer, but does not close it.
* It is the caller's responsibility to close the writer.
*/
public static void writeJobOutput(MvsJob mvsJob, Writer writer) throws IOException {
Exec exec = new Exec(getJobOutputCommand(mvsJob), getEnvironment());
//exec.run();

//start add
List lst = exec.getErrorLines();
Iterator it=lst.iterator();
while(it.hasNext())
{
String value=(String)it.next();
System.out.println("Value :"+value);
}
//end add

try {
String line;
while ((line = exec.readLine()) != null) {
writer.write(line);
writer.write('\n');
};

writer.flush();
}
finally {
int rc = exec.getReturnCode();
if (rc != 0) {
throw new RcException("REXX 'jobOutput' process failed", rc);
}
}
}

/**
* Returns the command to be executed via Runtime.exec().
* This is the REXX script 'jobOutput'.
* By default, this script needs to be present in the current PATH.
* However, if the System variable jzos.script.path is defined, it will be
* used to prefix 'jobOutput'.
*/
protected static String getJobOutputCommand(MvsJob mvsJob) {
String cmdPath = System.getProperty("jzos.script.path", "");
if (cmdPath.length() > 0 && !cmdPath.endsWith("/")) {
cmdPath = cmdPath + "/";
}

return cmdPath + JOB_OUTPUT_CMD
+ " "
+ mvsJob.getJobname()
+ " "
+ mvsJob.getJobid();
}

/**
* Returns the environment to use for the child process.
* This is the current environment with _BPX_SHAREAS and _BPX_SPAWN_SCRIPT
* set to "YES", so that the child process will execute in the same
* address space.
*/
protected static String[] getEnvironment() {
Properties p = ZUtil.getEnvironment();
p.put("_BPX_SHAREAS", "YES");
p.put("_BPX_SPAWN_SCRIPT", "YES");

String[] environ = new String[p.size()];
int i = 0;

for (Iterator<Object> iter = p.keySet().iterator(); iter.hasNext();) {
String key = (String)iter.next();
environ[i++] = key + "=" + p.getProperty(key);
System.out.println("environ(" + (i-1) + ")=" + environ[i-1]);
}

return environ;
}
}

jobStatus REXX script:
EDIT /u/DAINEK/MvsSubmitJob2/jobStatus
000001 parse arg jobname jobid
000002 if jobid <> '' then
000003 jobname = jobname'('jobid')'
000004 address tso "STATUS" jobname
000005 exit 0


jobStatus REXX script when HEX ON:
EDIT /u/DAINEK/MvsSubmitJob2/jobStatus Columns 00001 00072
Command ===> Scroll ===> CSR
****** ***************************** Top of Data ******************************
==MSG> -Warning- The UNDO command is not available until you change
==MSG> your edit profile using the command RECOVERY ON.
000001 parse arg jobname jobid
989A84898499898984998884444444444444444444444444444444444444444444444444
719250197016251450162940000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000002 if jobid <> '' then
884998884464774A88944444444444444444444444444444444444444444444444444444
960162940CE0DD0385500000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000003 jobname = jobname'('jobid')'
444499898984749989898747998887574444444444444444444444444444444444444444
000016251450E01625145DDD16294DDD0000000000000000000000000000000000000000
------------------------------------------------------------------------------
000004 address tso "STATUS" jobname
88898AA4AA947EECEEE74998989844444444444444444444444444444444444444444444
144952203260F231342F0162514500000000000000000000000000000000000000000000
------------------------------------------------------------------------------
000005 exit 0
8A8A4F444444444444444444444444444444444444444444444444444444444444444444
579300000000000000000000000000000000000000000000000000000000000000000000
------------------------------------------------------------------------------


Protocols SYSOUT:
JVMJZBL2004N Log level has been set to: T
JVMJZBL2999T -> JzosVM()
JVMJZBL1001N JZOS batch Launcher Version: 2.4.0 2010-11-16
JVMJZBL1002N Copyright (C) IBM Corp. 2005. All rights reserved.
JVMJZBL2999T <- JzosVM()
JVMJZBL2999T -> run()
JVMJZBL1029I Region requested = 0K, Actual below/above limit = 11M / 1719M
JVMJZBL1053I OS Release R23.00 Machine 2827
JVMJZBL2999T -> adoptEnvironment()
JVMJZBL2999T -> spawnChild()
JVMJZBL1036D Spawned child shell process with PID: 65588
JVMJZBL2999T <- spawnChild()
JVMJZBL2999T Writing shell script to child's stdin:
JVMJZBL2999T # This is a shell script which configures
JVMJZBL2999T # any environment variables for the Java JVM.
JVMJZBL2999T # Variables must be exported to be seen by the launcher.
JVMJZBL2999T
JVMJZBL2999T . /etc/profile
JVMJZBL2999T export JAVA_HOME=/usr/lpp/Java601_31/J6.0.1
JVMJZBL2999T
JVMJZBL2999T export PATH=/bin:"${JAVA_HOME}"/bin
JVMJZBL2999T
JVMJZBL2999T LIBPATH=/lib:/usr/lib:"${JAVA_HOME}"/bin
JVMJZBL2999T LIBPATH="$LIBPATH":"${JAVA_HOME}"/lib/s390
JVMJZBL2999T LIBPATH="$LIBPATH":"${JAVA_HOME}"/lib/s390/j9vm
JVMJZBL2999T LIBPATH="$LIBPATH":"${JAVA_HOME}"/bin/classic
JVMJZBL2999T export LIBPATH="$LIBPATH":
JVMJZBL2999T
JVMJZBL2999T # Customize your CLASSPATH here
JVMJZBL2999T APP_HOME=$JAVA_HOME
JVMJZBL2999T CLASSPATH=$APP_HOME:"${JAVA_HOME}"/lib:"${JAVA_HOME}"/lib/ext
JVMJZBL2999T
JVMJZBL2999T # Add Application required jars to end of CLASSPATH
JVMJZBL2999T for i in "${APP_HOME}"/*.jar; do
JVMJZBL2999T CLASSPATH="$CLASSPATH":"$i"
JVMJZBL2999T done
JVMJZBL2999T export CLASSPATH="$CLASSPATH":
JVMJZBL2999T
JVMJZBL2999T # Set JZOS specific options
JVMJZBL2999T # Use this variable to specify encoding for DD STDOUT and STDERR
JVMJZBL2999T #export JZOS_OUTPUT_ENCODING=Cp1047
JVMJZBL2999T # Use this variable to prevent JZOS from handling MVS operator commands
JVMJZBL2999T #export JZOS_ENABLE_MVS_COMMANDS=false
JVMJZBL2999T # Use this variable to supply additional arguments to main
JVMJZBL2999T #export JZOS_MAIN_ARGS=""
JVMJZBL2999T
JVMJZBL2999T # Configure JVM options
JVMJZBL2999T IJO="-Xms16m -Xmx128m"
JVMJZBL2999T # Uncomment the following to aid in debugging "Class Not Found" problems
JVMJZBL2999T #IJO="$IJO -verbose:class"
JVMJZBL2999T # Uncomment the following if you want to run with Ascii file encoding..
JVMJZBL2999T #IJO="$IJO -Dfile.encoding=ISO8859-1"
JVMJZBL2999T export IBM_JAVA_OPTIONS="$IJO "
JVMJZBL2999T export CLASSPATH="$CLASSPATH":/u/DAINEK/MvsSubmitJob2
JVMJZBL2999T -Djzos.script.path=/u/DAINEK/MvsSubmitJob2
JVMJZBL1005I Output from DD:STDENV config shell script:
JVMJZBL2999T -Djzos.script.path=/u/DAINEK/MvsSubmitJob2: FSUM7351 not found
JVMJZBL2999T Found environment start string
JVMJZBL2999T ___JZOS_ENV_START___
JVMJZBL1006I MAIL = /usr/mail/
JVMJZBL1006I PATH = /bin:/usr/lpp/Java601_31/J6.0.1/bin
JVMJZBL1006I IBM_JAVA_OPTIONS = -Xms16m -Xmx128m
JVMJZBL1006I PS1 = $LOGNAME:$PWD: >
JVMJZBL1006I _BPX_SPAWN_SCRIPT = YES
JVMJZBL1006I _ = /bin/env
JVMJZBL1006I CLASSPATH = /usr/lpp/Java601_31/J6.0.1:/usr/lpp/Java601_31/J6.0.1/lib:/usr/lpp/Java601_31/J6.0.1/lib/ext:/u
sr/lpp/Java601_31/J6.0.1/*.jar::/u/DAINEK/MvsSubmitJob2
JVMJZBL1006I STEPLIB = DSNA10.IAS.SDSNEXIT:DSNA10.SDSNLOAD:DSNA10.SDSNLOD2:
JVMJZBL1006I LANG = C
JVMJZBL1006I LIBPATH = /lib:/usr/lib:/usr/lpp/Java601_31/J6.0.1/bin:/usr/lpp/Java601_31/J6.0.1/lib/s390:/usr/lpp/Java601
_31/J6.0.1/lib/s390/j9vm:/usr/lpp/Java601_31/J6.0.1/bin/classic:
JVMJZBL1006I _BPX_SHAREAS = YES
JVMJZBL1006I JAVA_HOME = /usr/lpp/Java601_31/J6.0.1
JVMJZBL1006I TZ = GMT-3
JVMJZBL1006I MANPATH = /usr/lpp/Printsrv/man/%L:/usr/man/%L
JVMJZBL1006I NLSPATH = /usr/lpp/Printsrv/%L/%N:/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
JVMJZBL1006I PWD = /u/DAINEK
JVMJZBL2999T Setting current working dir to: "/u/DAINEK"
JVMJZBL2999T Found environment stop string
JVMJZBL2999T waiting for child shell process to complete
JVMJZBL2999T -> waitChild()
JVMJZBL2999T child shell process exited with exit code 0
JVMJZBL2999T <- waitChild()
JVMJZBL2999T <- adoptEnvironment()
JVMJZBL2999T argvг2…: MvsJobOutput
JVMJZBL2999T argvг3…: IASOUT
JVMJZBL2999T argvг4…: JOB05434
JVMJZBL2999T -> processExtraArgs()
JVMJZBL2999T No JZOS_MAIN_ARGS found
JVMJZBL2999T NO //DD:MAINARGS found
JVMJZBL2999T mainArgsBuf=""
JVMJZBL2999T <- processExtraArgs()
JVMJZBL2999T -> initializeVMArgs()
JVMJZBL2999T vm_args.version: 10004
JVMJZBL2999T Getting CLASSPATH
JVMJZBL2999T Classpath option string: '-Djava.class.path=/usr/lpp/Java601_31/J6.0.1:/usr/lpp/Java601_31/J6.0.1/lib:/usr/
lpp/Java601_31/J6.0.1/lib/ext:/usr/lpp/Java601_31/J6.0.1/*.jar::/u/DAINEK/MvsSubmitJob2'
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T <- initializeVMArgs()
JVMJZBL2999T -> createJvm()
JVMJZBL2999T JNI_CreateJavaVM elapsed time=0.295764 seconds, cpu time=0.229858 seconds
JVMJZBL2999T <- createJvm()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> StaticMethod.invoke()
JVMJZBL2999T com.ibm.jzos.ZUtil.getJavaVersionInfo
JVMJZBL2999T method invocation elapsed time=0.003901 seconds, cpu time=0.009045 seconds
JVMJZBL2999T <- StaticMethod.invoke()
JVMJZBL1012I Java Virtual Machine created. Version information follows:
java version "1.6.0"
Java(TM) SE Runtime Environment (build 20110418_80450)
IBM J9 VM (build 2.6, JRE 1.6.0 z/OS s390-31 20110418_80450 (JIT enabled, AOT enabled)
J9VM - R26_Java626_GA_FP1_20110418_1915_B80450
JIT - r11_20110215_18645ifx8
GC - R26_Java626_GA_FP1_20110418_1915_B80450
J9CL - 20110418_80450)
JVMJZBL2999T -> checkVersions()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> StaticMethod.invoke()
JVMJZBL2999T com.ibm.jzos.ZUtil.getJzosJarVersion
JVMJZBL2999T method invocation elapsed time=0.000359 seconds, cpu time=0.000786 seconds
JVMJZBL2999T <- StaticMethod.invoke()
JVMJZBL2999T Build versions match: 2.4.0 2010-11-16
JVMJZBL2999T <- checkVersions()
JVMJZBL2999T -> redirectStandardStreams()
JVMJZBL2999T No JZOS_OUTPUT_ENCODING found, using the default codeset 'IBM-1047'
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> StaticMethod.invoke()
JVMJZBL2999T com.ibm.jzos.ZUtil.redirectStandardStreams
JVMJZBL2999T method invocation elapsed time=0.009127 seconds, cpu time=0.008786 seconds
JVMJZBL2999T <- StaticMethod.invoke()
JVMJZBL1027I Using output encoding: IBM-1047
JVMJZBL2999T <- redirectStandardStreams()
JVMJZBL2999T -> establishMvsCommandListener()
JVMJZBL1016I MVS commands are ENABLED
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> StaticMethod.invoke()
JVMJZBL2999T com.ibm.jzos.MvsConsole.startMvsCommandListener
JVMJZBL2999T method invocation elapsed time=0.000463 seconds, cpu time=0.001074 seconds
JVMJZBL2999T <- StaticMethod.invoke()
JVMJZBL2999T <- establishMvsCommandListener()
JVMJZBL2999T -> invokeMain()
JVMJZBL2999T javaClassName: 'MvsJobOutput'
JVMJZBL2999T Arg 1='IASOUT'
JVMJZBL2999T Arg 2='JOB05434'
JVMJZBL1023N Invoking MvsJobOutput.main()...
JVMJZBL1056I Arguments to main...
JVMJZBL1057I IASOUT
JVMJZBL1057I JOB05434
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> StaticMethod.invoke()
JVMJZBL2999T MvsJobOutput.main
JVMJZBL2999T method invocation elapsed time=0.039423 seconds, cpu time=0.016867 seconds
JVMJZBL2010E Exception occurred invoking MvsJobOutput.main()
JVMJZBL2999T -> JniUtil.writeStackTrace()
JVMJZBL2007E Stack trace follows:
java.io.IOException: No output from jobStatus child process
at MvsJobOutput.getStatus(MvsJobOutput.java:124)
at MvsJobOutput.main(MvsJobOutput.java:65)
JVMJZBL2999T <- JniUtil.writeStackTrace()


JVMJZBL2999T <- StaticMethod.invoke()
JVMJZBL2999T invokeMain caught exception rc=1
JVMJZBL2999T <- invokeMain()
JVMJZBL2999T <- run()
JVMJZBL2999T -> cleanup()
JVMJZBL1014I Waiting for non-deamon Java threads to finish before exiting...
JVMJZBL2999T JvmExitHook entered with exitCode=0, javaMainReturnedOrThrewException=1
JVMJZBL2999T DestroyJavaVM elapsed time=0.003200 seconds, cpu time=0.002568 seconds
JVMJZBL2999I JZOS batch launcher elapsed time=0 seconds, cpu time=0.550000 seconds
JVMJZBL1047W JZOS batch launcher completed with Java exception, return code=100
JVMJZBL2999T <- cleanup()
JVMJZBL2999T -> ~JzosVM()
JVMJZBL2999T <- ~JzosVM()

Protocols STDOUT:
cmdPath= /u/DAINEK/MvsSubmitJob2/jobStatus IASOUT JOB05434
environ(0)=LANG=C
environ(1)=JAVA_HOME=/usr/lpp/Java601_31/J6.0.1
environ(2)=PWD=/u/DAINEK
environ(3)=STEPLIB=DSNA10.IAS.SDSNEXIT:DSNA10.SDSNLOAD:DSNA10.SDSNLOD2:
environ(4)=_BPX_SPAWN_SCRIPT=YES
environ(5)=_EDC_PTHREAD_YIELD=-2
environ(6)=NLSPATH=/usr/lpp/Printsrv/%L/%N:/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
environ(7)=MAIL=/usr/mail/
environ(8)=PS1=$LOGNAME:$PWD: >
environ(9)=_BPX_SHAREAS=YES
environ(10)=IBM_JAVA_OPTIONS=-Xms16m -Xmx128m
environ(11)=MANPATH=/usr/lpp/Printsrv/man/%L:/usr/man/%L
environ(12)=LIBPATH=/usr/lpp/Java601_31/J6.0.1/lib/s390/default:/lib:/usr/lib:/usr/lpp/Java601_31/J6.0.1/bin:/usr/lpp/Java601_31/J6.
0.1/lib/s390:/usr/lpp/Java601_31/J6.0.1/lib/s390/j9vm:/usr/lpp/Java601_31/J6.0.1/bin/classic::/usr/lpp/Java601_31/J6.0.1/lib/s390/de
fault:/usr/lpp/Java601_31/J6.0.1/lib/s390
environ(13)=CLASSPATH=/usr/lpp/Java601_31/J6.0.1:/usr/lpp/Java601_31/J6.0.1/lib:/usr/lpp/Java601_31/J6.0.1/lib/ext:/usr/lpp/Java601_
31/J6.0.1/*.jar::/u/DAINEK/MvsSubmitJob2
environ(14)=TZ=GMT-3
environ(15)=_=/bin/env
environ(16)=PATH=/bin:/usr/lpp/Java601_31/J6.0.1/bin
String line = exec.readLine();
length content =null
exec.getReturnCode() =1
Value :parse: /u/DAINEK/MvsSubmitJob2/jobStatus 1: FSUM7351 not found
Value :/u/DAINEK/MvsSubmitJob2/jobStatus 5: FSUM7332 syntax error: got EOF, expecting then

dovetail
Site Admin
Posts: 1848
Joined: Thu Jul 29, 2004 12:12 pm

Re: Java run REXX. Sample failed.

Post by dovetail » Thu Jul 10, 2014 1:50 pm

What about STDERR? the Java exceptions should be there.

Nevertheless, it appears that you are having the problem that the REXX script is not in the current PATH.

Please read the comment for the getJobStatusCommand() method.

dovetail
Site Admin
Posts: 1848
Joined: Thu Jul 29, 2004 12:12 pm

Re: Java run REXX. Sample failed.

Post by dovetail » Thu Jul 10, 2014 1:53 pm

Oh, I see. What is this line in your STDENV script supposed to be?

Code: Select all

-Djzos.script.path=/u/DAINEK/MvsSubmitJob2 // jobStatus and jobOutput REXX scripts
The FSUM7351 is an error from the z/OS UNIX Shell complaining about this line. It is not a valid shell command

curious_man
Posts: 9
Joined: Thu Jul 10, 2014 6:21 am

Re: Java run REXX. Sample failed.

Post by curious_man » Fri Jul 11, 2014 5:09 am

1.
What about STDERR?
Not created..

2.read the comment for the getJobStatusCommand() method
/**
* Returns the command to be executed via Runtime.exec().
* This is the REXX script 'jobStatus' followed by the jobname and jobid.
* By default, this script needs to be present in the current PATH.
* However, if the System variable jzos.script.path is defined, it will
* be used to prefix 'jobStatus'.
*/
Add in JCL:
export PATH=$PATH:/u/DAINEK/MvsSubmitJob2, where MvsSubmitJob2 - folder with REXX scripts + MvsJobOutput.class
Then run JCL, but error to remain.

3.
What is this line in your STDENV script supposed to be?
Yes, this is error. I correct:

OPTS="$OPTS -Djzos.script.path=/u/DAINEK/MvsSubmitJob2"
export JZOS_JVM_OPTIONS="$OPTS"

and in method add path: String cmdPath = System.getProperty("jzos.script.path", "/u/DAINEK/MvsSubmitJob2");
but error above to remain.

moral
Posts: 7
Joined: Thu Aug 08, 2013 2:24 am

Re: Java run REXX. Sample failed.

Post by moral » Fri Jul 11, 2014 6:55 am

Do you try change the permissions for the REXX script? Try chmod 755 REXX_name.

curious_man
Posts: 9
Joined: Thu Jul 10, 2014 6:21 am

Re: Java run REXX. Sample failed.

Post by curious_man » Fri Jul 11, 2014 8:27 am

I get the command "getfacl" :
DAINEK:/u/DAINEK/MvsSubmitJob2: >getfacl jobStatus
#file: jobStatus
#owner: DAINEK
#group: SYSASOUP
user::rwx
group::rwx
other::rwx

dovetail
Site Admin
Posts: 1848
Joined: Thu Jul 29, 2004 12:12 pm

Re: Java run REXX. Sample failed.

Post by dovetail » Fri Jul 11, 2014 8:34 am

You said that you corrected the shell script error but that the "error above to remain". You are going to have to post the output for me to see the new error.
Please add "set -x" to beginning of the STDENV shell script so that it will trace your script.

curious_man
Posts: 9
Joined: Thu Jul 10, 2014 6:21 am

Re: Java run REXX. Sample failed.

Post by curious_man » Fri Jul 11, 2014 9:48 am

dovetail wrote:You said that you corrected the shell script error but that the "error above to remain". You are going to have to post the output for me to see the new error.
Please add "set -x" to beginning of the STDENV shell script so that it will trace your script.
JCL:
//IASOUT JOB
//JAVA EXEC PROC=JVMPRC61,
// JAVACLS='MvsJobOutput',
// ARGS='BBOS001 STC05206',
// LOGLVL='+T'
//IN1 DD DSN=DAINEK.TAPE,DISP=SHR
//STDENV DD *
set -x
. /etc/profile
export JAVA_HOME=/usr/lpp/Java601_31/J6.0.1
export PATH=/bin:"${JAVA_HOME}"/bin
LIBPATH=/lib:/usr/lib:"${JAVA_HOME}"/bin
LIBPATH="$LIBPATH":"${JAVA_HOME}"/lib/s390
LIBPATH="$LIBPATH":"${JAVA_HOME}"/lib/s390/j9vm
LIBPATH="$LIBPATH":"${JAVA_HOME}"/bin/classic
export LIBPATH="$LIBPATH":
APP_HOME=$JAVA_HOME
CLASSPATH=$APP_HOME:"${JAVA_HOME}"/lib:"${JAVA_HOME}"/lib/ext
for i in "${APP_HOME}"/*.jar; do
CLASSPATH="$CLASSPATH":"$i"
done
export CLASSPATH="$CLASSPATH":
IJO="-Xms16m -Xmx128m"
export IBM_JAVA_OPTIONS="$IJO "
export CLASSPATH="$CLASSPATH":/u/DAINEK/MvsSubmitJob2


JCL.SYSOUT:
1
JVMJZBL2004N Log level has been set to: T
JVMJZBL2999T -> JzosVM()
JVMJZBL1001N JZOS batch Launcher Version: 2.4.0 2010-11-16
JVMJZBL1002N Copyright (C) IBM Corp. 2005. All rights reserved.
JVMJZBL2999T <- JzosVM()
JVMJZBL2999T -> run()
JVMJZBL1029I Region requested = 0K, Actual below/above limit = 11M / 1719M
JVMJZBL1053I OS Release R23.00 Machine 2827
JVMJZBL2999T -> adoptEnvironment()
JVMJZBL2999T -> spawnChild()
JVMJZBL1036D Spawned child shell process with PID: 65607
JVMJZBL2999T <- spawnChild()
JVMJZBL2999T Writing shell script to child's stdin:
JVMJZBL2999T set -x
JVMJZBL2999T # This is a shell script which configures
JVMJZBL2999T # any environment variables for the Java JVM.
JVMJZBL2999T # Variables must be exported to be seen by the launcher.
JVMJZBL2999T
JVMJZBL2999T . /etc/profile
JVMJZBL2999T export JAVA_HOME=/usr/lpp/Java601_31/J6.0.1
JVMJZBL2999T
JVMJZBL2999T export PATH=/bin:"${JAVA_HOME}"/bin
JVMJZBL2999T #export PATH=/u/DAINEK/MvsSubmitJob2:${PATH}
JVMJZBL2999T
JVMJZBL2999T LIBPATH=/lib:/usr/lib:"${JAVA_HOME}"/bin
JVMJZBL2999T LIBPATH="$LIBPATH":"${JAVA_HOME}"/lib/s390
JVMJZBL2999T LIBPATH="$LIBPATH":"${JAVA_HOME}"/lib/s390/j9vm
JVMJZBL2999T LIBPATH="$LIBPATH":"${JAVA_HOME}"/bin/classic
JVMJZBL2999T export LIBPATH="$LIBPATH":
JVMJZBL2999T
JVMJZBL2999T # Customize your CLASSPATH here
JVMJZBL2999T APP_HOME=$JAVA_HOME
JVMJZBL2999T CLASSPATH=$APP_HOME:"${JAVA_HOME}"/lib:"${JAVA_HOME}"/lib/ext
JVMJZBL2999T
JVMJZBL2999T # Add Application required jars to end of CLASSPATH
JVMJZBL2999T for i in "${APP_HOME}"/*.jar; do
JVMJZBL2999T CLASSPATH="$CLASSPATH":"$i"
JVMJZBL2999T done
JVMJZBL2999T export CLASSPATH="$CLASSPATH":
JVMJZBL2999T
JVMJZBL2999T # Set JZOS specific options
JVMJZBL2999T # Use this variable to specify encoding for DD STDOUT and STDERR
JVMJZBL2999T #export JZOS_OUTPUT_ENCODING=Cp1047
JVMJZBL2999T # Use this variable to prevent JZOS from handling MVS operator commands
JVMJZBL2999T #export JZOS_ENABLE_MVS_COMMANDS=false
JVMJZBL2999T # Use this variable to supply additional arguments to main
JVMJZBL2999T #export JZOS_MAIN_ARGS=""
JVMJZBL2999T
JVMJZBL2999T # Configure JVM options
JVMJZBL2999T IJO="-Xms16m -Xmx128m"
JVMJZBL2999T # Uncomment the following to aid in debugging "Class Not Found" problems
JVMJZBL2999T #IJO="$IJO -verbose:class"
JVMJZBL2999T # Uncomment the following if you want to run with Ascii file encoding..
JVMJZBL2999T #IJO="$IJO -Dfile.encoding=ISO8859-1"
JVMJZBL2999T export IBM_JAVA_OPTIONS="$IJO "
JVMJZBL2999T export CLASSPATH="$CLASSPATH":/u/DAINEK/MvsSubmitJob2
JVMJZBL1005I Output from DD:STDENV config shell script:
JVMJZBL2999T + . /etc/profile
JVMJZBL2999T + PS1=$LOGNAME:$PWD: >
JVMJZBL2999T + export PS1
JVMJZBL2999T + TZ=GMT-3
JVMJZBL2999T + export TZ
JVMJZBL2999T + LANG=C
JVMJZBL2999T + export LANG
JVMJZBL2999T + readonly LOGNAME
JVMJZBL2999T + PATH=/bin:.
JVMJZBL2999T + export PATH
JVMJZBL2999T + export PATH=/usr/lpp/Printsrv/bin:/bin:.
JVMJZBL2999T + LIBPATH=/lib:/usr/lib:.
JVMJZBL2999T + export LIBPATH
JVMJZBL2999T + export LIBPATH=/usr/lpp/Printsrv/lib:/lib:/usr/lib:.
JVMJZBL2999T + NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
JVMJZBL2999T + export NLSPATH
JVMJZBL2999T + export NLSPATH=/usr/lpp/Printsrv/%L/%N:/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
JVMJZBL2999T + MANPATH=/usr/man/%L
JVMJZBL2999T + export MANPATH
JVMJZBL2999T + export MANPATH=/usr/lpp/Printsrv/man/%L:/usr/man/%L
JVMJZBL2999T + MAIL=/usr/mail/
JVMJZBL2999T + export MAIL
JVMJZBL2999T + umask 022
JVMJZBL2999T + export PATH=/usr/local/bin:/usr/lpp/Printsrv/bin:/bin:.
JVMJZBL2999T + export JAVA_HOME=/usr/lpp/Java601_31
JVMJZBL2999T + export STEPLIB=DSNA10.IAS.SDSNEXIT:DSNA10.SDSNLOAD:DSNA10.SDSNLOD2:
JVMJZBL2999T + export PATH=/usr/lpp/db2810/jcc/bin:/usr/local/bin:/usr/lpp/Printsrv/bin:/bin:.
JVMJZBL2999T + export LIBPATH=/usr:/usr/lib:/usr/lpp/db2810/jcc/lib:/usr/lpp/Printsrv/lib:/lib:/usr/lib:.
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip:/usr/lpp/db2810/jcc/classes/db2jcc_license_cisuz.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip:/usr/lpp/db2810/jcc/classes/db2jcc_license_cisuz.jar:/usr/
lpp/mqm/V6R0M0/
java/lib/com.ibm.mq.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip:/usr/lpp/db2810/jcc/classes/db2jcc_license_cisuz.jar:/usr/
lpp/mqm/V6R0M0/
java/lib/com.ibm.mq.jar:/usr/lpp/mqm/V6R0M0/java/lib/com.ibm.mqjms.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip:/usr/lpp/db2810/jcc/classes/db2jcc_license_cisuz.jar:/usr/
lpp/mqm/V6R0M0/
java/lib/com.ibm.mq.jar:/usr/lpp/mqm/V6R0M0/java/lib/com.ibm.mqjms.jar:/usr/lpp/mqm/V6R0M0/java/lib/connector.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip:/usr/lpp/db2810/jcc/classes/db2jcc_license_cisuz.jar:/usr/
lpp/mqm/V6R0M0/
java/lib/com.ibm.mq.jar:/usr/lpp/mqm/V6R0M0/java/lib/com.ibm.mqjms.jar:/usr/lpp/mqm/V6R0M0/java/lib/connector.jar:/usr/l
pp/mqm/V6R0M0/java/lib/jms.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip:/usr/lpp/db2810/jcc/classes/db2jcc_license_cisuz.jar:/usr/
lpp/mqm/V6R0M0/
java/lib/com.ibm.mq.jar:/usr/lpp/mqm/V6R0M0/java/lib/com.ibm.mqjms.jar:/usr/lpp/mqm/V6R0M0/java/lib/connector.jar:/usr/l
pp/mqm/V6R0M0/java/lib/jms.jar:/usr/lpp/mqm/V6R0M0/java/lib/rmm.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip:/usr/lpp/db2810/jcc/classes/db2jcc_license_cisuz.jar:/usr/
lpp/mqm/V6R0M0/
java/lib/com.ibm.mq.jar:/usr/lpp/mqm/V6R0M0/java/lib/com.ibm.mqjms.jar:/usr/lpp/mqm/V6R0M0/java/lib/connector.jar:/usr/l
pp/mqm/V6R0M0/java/lib/jms.jar:/usr/lpp/mqm/V6R0M0/java/lib/rmm.jar:/usr/lpp/mqm/V6R0M0/java/lib/providerutil.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip:/usr/lpp/db2810/jcc/classes/db2jcc_license_cisuz.jar:/usr/
lpp/mqm/V6R0M0/
java/lib/com.ibm.mq.jar:/usr/lpp/mqm/V6R0M0/java/lib/com.ibm.mqjms.jar:/usr/lpp/mqm/V6R0M0/java/lib/connector.jar:/usr/l
pp/mqm/V6R0M0/java/lib/jms.jar:/usr/lpp/mqm/V6R0M0/java/lib/rmm.jar:/usr/lpp/mqm/V6R0M0/java/lib/providerutil.jar:/usr/l
pp/mqm/V6R0M0/j
ava/lib/jta.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip:/usr/lpp/db2810/jcc/classes/db2jcc_license_cisuz.jar:/usr/
lpp/mqm/V6R0M0/
java/lib/com.ibm.mq.jar:/usr/lpp/mqm/V6R0M0/java/lib/com.ibm.mqjms.jar:/usr/lpp/mqm/V6R0M0/java/lib/connector.jar:/usr/l
pp/mqm/V6R0M0/java/lib/jms.jar:/usr/lpp/mqm/V6R0M0/java/lib/rmm.jar:/usr/lpp/mqm/V6R0M0/java/lib/providerutil.jar:/usr/l
pp/mqm/V6R0M0/j
ava/lib/jta.jar:/usr/lpp/mqm/V6R0M0/java/lib/fscontext.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip:/usr/lpp/db2810/jcc/classes/db2jcc_license_cisuz.jar:/usr/
lpp/mqm/V6R0M0/
java/lib/com.ibm.mq.jar:/usr/lpp/mqm/V6R0M0/java/lib/com.ibm.mqjms.jar:/usr/lpp/mqm/V6R0M0/java/lib/connector.jar:/usr/l
pp/mqm/V6R0M0/java/lib/jms.jar:/usr/lpp/mqm/V6R0M0/java/lib/rmm.jar:/usr/lpp/mqm/V6R0M0/java/lib/providerutil.jar:/usr/l
pp/mqm/V6R0M0/j
ava/lib/jta.jar:/usr/lpp/mqm/V6R0M0/java/lib/fscontext.jar:/usr/lpp/mqm/V6R0M0/java/lib/dhbcore.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip:/usr/lpp/db2810/jcc/classes/db2jcc_license_cisuz.jar:/usr/
lpp/mqm/V6R0M0/
java/lib/com.ibm.mq.jar:/usr/lpp/mqm/V6R0M0/java/lib/com.ibm.mqjms.jar:/usr/lpp/mqm/V6R0M0/java/lib/connector.jar:/usr/l
pp/mqm/V6R0M0/java/lib/jms.jar:/usr/lpp/mqm/V6R0M0/java/lib/rmm.jar:/usr/lpp/mqm/V6R0M0/java/lib/providerutil.jar:/usr/l
pp/mqm/V6R0M0/j
ava/lib/jta.jar:/usr/lpp/mqm/V6R0M0/java/lib/fscontext.jar:/usr/lpp/mqm/V6R0M0/java/lib/dhbcore.jar:/usr/lpp/mqm/V6R0M0/
java/lib/CL3Nonexport.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip:/usr/lpp/db2810/jcc/classes/db2jcc_license_cisuz.jar:/usr/
lpp/mqm/V6R0M0/
java/lib/com.ibm.mq.jar:/usr/lpp/mqm/V6R0M0/java/lib/com.ibm.mqjms.jar:/usr/lpp/mqm/V6R0M0/java/lib/connector.jar:/usr/l
pp/mqm/V6R0M0/java/lib/jms.jar:/usr/lpp/mqm/V6R0M0/java/lib/rmm.jar:/usr/lpp/mqm/V6R0M0/java/lib/providerutil.jar:/usr/l
pp/mqm/V6R0M0/j
ava/lib/jta.jar:/usr/lpp/mqm/V6R0M0/java/lib/fscontext.jar:/usr/lpp/mqm/V6R0M0/java/lib/dhbcore.jar:/usr/lpp/mqm/V6R0M0/
java/lib/CL3Nonexport.jar:/usr/lpp/mqm/V6R0M0/java/lib/CL3Export.jar
JVMJZBL2999T + export JAVA_HOME=/usr/lpp/Java601_31/J6.0.1
JVMJZBL2999T + export PATH=/bin:/usr/lpp/Java601_31/J6.0.1/bin
JVMJZBL2999T + LIBPATH=/lib:/usr/lib:/usr/lpp/Java601_31/J6.0.1/bin
JVMJZBL2999T + LIBPATH=/lib:/usr/lib:/usr/lpp/Java601_31/J6.0.1/bin:/usr/lpp/Java601_31/J6.0.1/lib/s390
JVMJZBL2999T + LIBPATH=/lib:/usr/lib:/usr/lpp/Java601_31/J6.0.1/bin:/usr/lpp/Java601_31/J6.0.1/lib/s390:/usr/lpp/Java601
_31/J6.0.1/lib/s390/j9vm
JVMJZBL2999T + LIBPATH=/lib:/usr/lib:/usr/lpp/Java601_31/J6.0.1/bin:/usr/lpp/Java601_31/J6.0.1/lib/s390:/usr/lpp/Java601
_31/J6.0.1/lib/s390/j9vm:/usr/lpp/Java601_31/J6.0.1/bin/classic
JVMJZBL2999T + export LIBPATH=/lib:/usr/lib:/usr/lpp/Java601_31/J6.0.1/bin:/usr/lpp/Java601_31/J6.0.1/lib/s390:/usr/lpp/
Java601_31/J6.0.1/lib/s390/j9vm:/usr/lpp/Java601_31/J6.0.1/bin/classic:
JVMJZBL2999T + APP_HOME=/usr/lpp/Java601_31/J6.0.1
JVMJZBL2999T + CLASSPATH=/usr/lpp/Java601_31/J6.0.1:/usr/lpp/Java601_31/J6.0.1/lib:/usr/lpp/Java601_31/J6.0.1/lib/ext
JVMJZBL2999T + CLASSPATH=/usr/lpp/Java601_31/J6.0.1:/usr/lpp/Java601_31/J6.0.1/lib:/usr/lpp/Java601_31/J6.0.1/lib/ext:/u
sr/lpp/Java601_31/J6.0.1/*.jar
JVMJZBL2999T + export CLASSPATH=/usr/lpp/Java601_31/J6.0.1:/usr/lpp/Java601_31/J6.0.1/lib:/usr/lpp/Java601_31/J6.0.1/lib
/ext:/usr/lpp/Java601_31/J6.0.1/*.jar:
JVMJZBL2999T + IJO=-Xms16m -Xmx128m
JVMJZBL2999T + export IBM_JAVA_OPTIONS=-Xms16m -Xmx128m
JVMJZBL2999T + export CLASSPATH=/usr/lpp/Java601_31/J6.0.1:/usr/lpp/Java601_31/J6.0.1/lib:/usr/lpp/Java601_31/J6.0.1/lib
/ext:/usr/lpp/Java601_31/J6.0.1/*.jar::/u/DAINEK/MvsSubmitJob2
JVMJZBL2999T + echo ___JZOS_ENV_START___
JVMJZBL2999T Found environment start string
JVMJZBL2999T ___JZOS_ENV_START___
JVMJZBL2999T Ignored line: + env

JVMJZBL1006I MAIL = /usr/mail/
JVMJZBL1006I PATH = /bin:/usr/lpp/Java601_31/J6.0.1/bin
JVMJZBL1006I IBM_JAVA_OPTIONS = -Xms16m -Xmx128m
JVMJZBL1006I PS1 = $LOGNAME:$PWD: >
JVMJZBL1006I _BPX_SPAWN_SCRIPT = YES
JVMJZBL1006I _ = /bin/env
JVMJZBL1006I CLASSPATH = /usr/lpp/Java601_31/J6.0.1:/usr/lpp/Java601_31/J6.0.1/lib:/usr/lpp/Java601_31/J6.0.1/lib/ext:/u
sr/lpp/Java601_31/J6.0.1/*.jar::/u/DAINEK/MvsSubmitJob2
JVMJZBL1006I STEPLIB = DSNA10.IAS.SDSNEXIT:DSNA10.SDSNLOAD:DSNA10.SDSNLOD2:
JVMJZBL1006I LANG = C
JVMJZBL1006I LIBPATH = /lib:/usr/lib:/usr/lpp/Java601_31/J6.0.1/bin:/usr/lpp/Java601_31/J6.0.1/lib/s390:/usr/lpp/Java601
_31/J6.0.1/lib/s390/j9vm:/usr/lpp/Java601_31/J6.0.1/bin/classic:
JVMJZBL1006I _BPX_SHAREAS = YES
JVMJZBL1006I JAVA_HOME = /usr/lpp/Java601_31/J6.0.1
JVMJZBL1006I TZ = GMT-3
JVMJZBL1006I MANPATH = /usr/lpp/Printsrv/man/%L:/usr/man/%L
JVMJZBL1006I NLSPATH = /usr/lpp/Printsrv/%L/%N:/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
JVMJZBL1006I + echo PWD = /u/DAINEK
JVMJZBL1006I PWD = /u/DAINEK
JVMJZBL2999T Setting current working dir to: "/u/DAINEK"
JVMJZBL2999T Ignored line: + echo ___JZOS_ENV_STOP___

JVMJZBL2999T Found environment stop string
JVMJZBL2999T + exit
JVMJZBL2999T waiting for child shell process to complete
JVMJZBL2999T -> waitChild()
JVMJZBL2999T child shell process exited with exit code 0
JVMJZBL2999T <- waitChild()
JVMJZBL2999T <- adoptEnvironment()
JVMJZBL2999T argvг2…: MvsJobOutput
JVMJZBL2999T argvг3…: BBOS001
JVMJZBL2999T argvг4…: STC05206
JVMJZBL2999T -> processExtraArgs()
JVMJZBL2999T No JZOS_MAIN_ARGS found
JVMJZBL2999T NO //DD:MAINARGS found
JVMJZBL2999T mainArgsBuf=""
JVMJZBL2999T <- processExtraArgs()
JVMJZBL2999T -> initializeVMArgs()
JVMJZBL2999T vm_args.version: 10004
JVMJZBL2999T Getting CLASSPATH
JVMJZBL2999T Classpath option string: '-Djava.class.path=/usr/lpp/Java601_31/J6.0.1:/usr/lpp/Java601_31/J6.0.1/lib:/usr/
lpp/Java601_31/J6.0.1/lib/ext:/usr/lpp/Java601_31/J6.0.1/*.jar::/u/DAINEK/MvsSubmitJob2'
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T <- initializeVMArgs()
JVMJZBL2999T -> createJvm()
JVMJZBL2999T JNI_CreateJavaVM elapsed time=0.314680 seconds, cpu time=0.231061 seconds
JVMJZBL2999T <- createJvm()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> StaticMethod.invoke()
JVMJZBL2999T com.ibm.jzos.ZUtil.getJavaVersionInfo
JVMJZBL2999T method invocation elapsed time=0.003868 seconds, cpu time=0.008959 seconds
JVMJZBL2999T <- StaticMethod.invoke()
JVMJZBL1012I Java Virtual Machine created. Version information follows:
java version "1.6.0"
Java(TM) SE Runtime Environment (build 20110418_80450)
IBM J9 VM (build 2.6, JRE 1.6.0 z/OS s390-31 20110418_80450 (JIT enabled, AOT enabled)
J9VM - R26_Java626_GA_FP1_20110418_1915_B80450
JIT - r11_20110215_18645ifx8
GC - R26_Java626_GA_FP1_20110418_1915_B80450
J9CL - 20110418_80450)
JVMJZBL2999T -> checkVersions()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> StaticMethod.invoke()
JVMJZBL2999T com.ibm.jzos.ZUtil.getJzosJarVersion
JVMJZBL2999T method invocation elapsed time=0.000353 seconds, cpu time=0.000780 seconds
JVMJZBL2999T <- StaticMethod.invoke()
JVMJZBL2999T Build versions match: 2.4.0 2010-11-16
JVMJZBL2999T <- checkVersions()
JVMJZBL2999T -> redirectStandardStreams()
JVMJZBL2999T No JZOS_OUTPUT_ENCODING found, using the default codeset 'IBM-1047'
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> StaticMethod.invoke()
JVMJZBL2999T com.ibm.jzos.ZUtil.redirectStandardStreams
JVMJZBL2999T method invocation elapsed time=0.009725 seconds, cpu time=0.008806 seconds
JVMJZBL2999T <- StaticMethod.invoke()
JVMJZBL1027I Using output encoding: IBM-1047
JVMJZBL2999T <- redirectStandardStreams()
JVMJZBL2999T -> establishMvsCommandListener()
JVMJZBL1016I MVS commands are ENABLED
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> StaticMethod.invoke()
JVMJZBL2999T com.ibm.jzos.MvsConsole.startMvsCommandListener
JVMJZBL2999T method invocation elapsed time=0.000470 seconds, cpu time=0.001088 seconds
JVMJZBL2999T <- StaticMethod.invoke()
JVMJZBL2999T <- establishMvsCommandListener()
JVMJZBL2999T -> invokeMain()
JVMJZBL2999T javaClassName: 'MvsJobOutput'
JVMJZBL2999T Arg 1='BBOS001'
JVMJZBL2999T Arg 2='STC05206'
JVMJZBL1023N Invoking MvsJobOutput.main()...
JVMJZBL1056I Arguments to main...
JVMJZBL1057I BBOS001
JVMJZBL1057I STC05206
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> StaticMethod.invoke()
JVMJZBL2999T MvsJobOutput.main
JVMJZBL2999T method invocation elapsed time=0.048616 seconds, cpu time=0.016712 seconds
JVMJZBL2010E Exception occurred invoking MvsJobOutput.main()
JVMJZBL2999T -> JniUtil.writeStackTrace()
JVMJZBL2007E Stack trace follows:
java.io.IOException: No output from jobStatus child process
at MvsJobOutput.getStatus(MvsJobOutput.java:145)
at MvsJobOutput.main(MvsJobOutput.java:67)
JVMJZBL2999T <- JniUtil.writeStackTrace()

JVMJZBL2999T <- StaticMethod.invoke()
JVMJZBL2999T invokeMain caught exception rc=1
JVMJZBL2999T <- invokeMain()
JVMJZBL2999T <- run()
JVMJZBL2999T -> cleanup()
JVMJZBL1014I Waiting for non-deamon Java threads to finish before exiting...
JVMJZBL2999T JvmExitHook entered with exitCode=0, javaMainReturnedOrThrewException=1
JVMJZBL2999T DestroyJavaVM elapsed time=10.969802 seconds, cpu time=0.003758 seconds
JVMJZBL2999I JZOS batch launcher elapsed time=11 seconds, cpu time=0.520000 seconds
JVMJZBL1047W JZOS batch launcher completed with Java exception, return code=100
JVMJZBL2999T <- cleanup()
JVMJZBL2999T -> ~JzosVM()
JVMJZBL2999T <- ~JzosVM()

JCL.STDOUT:
1
cmdPath= /u/DAINEK/MvsSubmitJob2/jobStatus BBOS001 STC05206
environ(0)=LIBPATH=/usr/lpp/Java601_31/J6.0.1/lib/s390/default:/lib:/usr/lib:/usr/lpp/Java601_31/J6.0.1/bin:/usr/lpp/Java601_31/J6.0
.1/lib/s390:/usr/lpp/Java601_31/J6.0.1/lib/s390/j9vm:/usr/lpp/Java601_31/J6.0.1/bin/classic::/usr/lpp/Java601_31/J6.0.1/lib/s390/def
ault:/usr/lpp/Java601_31/J6.0.1/lib/s390
environ(1)=_BPX_SHAREAS=YES
environ(2)=JAVA_HOME=/usr/lpp/Java601_31/J6.0.1
environ(3)=NLSPATH=/usr/lpp/Printsrv/%L/%N:/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
environ(4)=LANG=C
environ(5)=_BPX_SPAWN_SCRIPT=YES
environ(6)=MANPATH=/usr/lpp/Printsrv/man/%L:/usr/man/%L
environ(7)=PWD=/u/DAINEK
environ(8)=PS1=$LOGNAME:$PWD: >
environ(9)=MAIL=/usr/mail/
environ(10)=TZ=GMT-3
environ(11)=CLASSPATH=/usr/lpp/Java601_31/J6.0.1:/usr/lpp/Java601_31/J6.0.1/lib:/usr/lpp/Java601_31/J6.0.1/lib/ext:/usr/lpp/Java601_
31/J6.0.1/*.jar::/u/DAINEK/MvsSubmitJob2
environ(12)=_EDC_PTHREAD_YIELD=-2
environ(13)=STEPLIB=DSNA10.IAS.SDSNEXIT:DSNA10.SDSNLOAD:DSNA10.SDSNLOD2:
environ(14)=IBM_JAVA_OPTIONS=-Xms16m -Xmx128m
environ(15)=PATH=/bin:/usr/lpp/Java601_31/J6.0.1/bin
environ(16)=+ echo PWD=/u/DAINEK
environ(17)=_=/bin/env
after exec.run]
com.ibm.jzos.Exec Time out detected]

MvsJobOutput.java:
/*
* %Z%%W% %I%
*
* =========================================================================
* Licensed Materials - Property of IBM
* "Restricted Materials of IBM"
* (C) Copyright IBM Corp. 2011. All Rights Reserved
*
* DISCLAIMER:
* The following [enclosed] code is sample code created by IBM
* Corporation. This sample code is not part of any standard IBM product
* and is provided to you solely for the purpose of assisting you in the
* development of your applications. The code is provided 'AS IS',
* without warranty of any kind. IBM shall not be liable for any damages
* arising out of your use of the sample code, even if they have been
* advised of the possibility of such damages.
* =========================================================================
*/
//package com.ibm.jzos.sample;

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import java.util.StringTokenizer;

import com.ibm.jzos.Exec;
import com.ibm.jzos.RcException;
import com.ibm.jzos.ZUtil;


/**
* Sample program which reads all sysout data for a MvsJob (jobname and jobid),
* and writes the output to a specified Writer.
*
* The class relies on the sample REXX script "jobOutput", spawned as a child process
* via the {@link com.ibm.jzos.Exec} class.
*
* @since 2.1.0
*/
public class MvsJobOutput {

public static final String JOB_STATUS_CMD = "jobStatus";
public static final String JOB_OUTPUT_CMD = "jobOutput";

/**
* A sample main method that writes sysout output for
* a job to System.out (STDOUT).
*
* The first argument is the jobname, and the second argument
* is the jobid (JOBnnnnn).
*/
public static void main(String[] args) throws IOException {

if (args.length < 2 ) {
throw new IllegalArgumentException("Missing arguments: jobname jobid");
}

MvsJob mvsJob = new MvsJob(args[0], args[1]);

// print out the status of the job
// this will throw an exception if there is no such job

System.out.println("JOB " + mvsJob + " " + getStatus(mvsJob));

BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));
writeJobOutput(mvsJob, writer);
writer.close();
}

/**
* Returns the job status using the TSO "status" command, which
* is invoked via the "jobStatus" REXX USS script.
*
* @return String the TSO "STATUS" command status
* @throws IOException if there was an error communicating with the child REXX script process
*/
public static String getStatus(MvsJob job) throws IOException {
Exec exec = new Exec(getStatusCommand(job), getEnvironment());
//exec.run();

//start test
List lst = exec.getErrorLines();
Iterator it=lst.iterator();
while(it.hasNext())
{
String value=(String)it.next();
System.out.println("Value ="+value);
}
try{
//exec.setTimeout(60000);
exec.run();
System.out.println("after exec.run!");
}catch(Exception e){
System.out.println("exec.run catch failed!");
e.printStackTrace();
//System.exit(8);
}
lst = exec.getErrorLines();
it=lst.iterator();
while(it.hasNext())
{
String value=(String)it.next();
System.out.println("Value ="+value);
}
//start test
/*
System.out.println("String getErrorLines");
List lst = exec.getErrorLines();
Iterator it=lst.iterator();
while(it.hasNext())
{
String value=(String)it.next();
System.out.println("Value ="+value);
}

*/
//end test

//start test
/*
System.out.println("String line = exec.readLine();");
String line1 = null;
try{
line1 = exec.readLine();
System.out.println("length content =" + line1);
System.out.println("exec.getReturnCode() =" + exec.getReturnCode());

}catch(Exception e){
System.out.println("error String line = exec.readLine();");
e.printStackTrace();
System.exit(8);
}
*/
//end test
///*
//System.out.println("after run");
//String line1 = exec.readLine();
//System.out.println("line ="+line1);
//*/
//end test
String line = exec.readLine();
if (line == null) throw new IOException("No output from jobStatus child process");

// close the stream which is connected
// to the stdin input of the external process
BufferedWriter wdr = exec.getStdinWriter();
wdr.close();

// slurp other output
while (exec.readLine() != null) {};

int rc = exec.getReturnCode();
if (rc != 0) {
throw new RcException("REXX 'jobStatus' process failed: " + line, rc);
}

StringTokenizer tok = new StringTokenizer(line);
if (tok.countTokens() < 3 ) {
throw new IOException("Invalid output from jobStatus child process: " + line);
}

String next = tok.nextToken();

// skip over message id
if (next.startsWith("IKJ")) {
next = tok.nextToken();
}

if (!next.equalsIgnoreCase("JOB")) {
throw new IOException("Invalid output from jobStatus child process: " + line);
}

// skip jobname(jobid)
tok.nextToken();
String answer = "";

// concat remaining words
while (tok.hasMoreTokens()) {
answer += tok.nextToken();

if (tok.hasMoreTokens()) {
answer += " ";
}
}

return answer;
}

/**
* Returns the command to be executed via Runtime.exec().
* This is the REXX script 'jobStatus' followed by the jobname and jobid.
* By default, this script needs to be present in the current PATH.
* However, if the System variable jzos.script.path is defined, it will
* be used to prefix 'jobStatus'.
*/
protected static String getStatusCommand(MvsJob job) {
//String cmdPath = System.getProperty("jzos.script.path", "/u/DAINEK/MvsSubmitJob2");
String cmdPath = System.getProperty("jzos.script.path", "/u/DAINEK/MvsSubmitJob2");
if (cmdPath.length() > 0 && !cmdPath.endsWith("/")) {
cmdPath = cmdPath + "/";
}

cmdPath = cmdPath + JOB_STATUS_CMD
+ " "
+ job.getJobname()
+ " ";

if (job.getJobid() != null) {
cmdPath = cmdPath + job.getJobid();
}
System.out.println("cmdPath= " + cmdPath);
return cmdPath;
}

/**
* Writes all of the output for a given job to a writer.
* Note: this method flushes the writer, but does not close it.
* It is the caller's responsibility to close the writer.
*/
public static void writeJobOutput(MvsJob mvsJob, Writer writer) throws IOException {
Exec exec = new Exec(getJobOutputCommand(mvsJob), getEnvironment());
//exec.run();

//start add
List lst = exec.getErrorLines();
Iterator it=lst.iterator();
while(it.hasNext())
{
String value=(String)it.next();
System.out.println("Value :"+value);
}
//end add

try {
String line;
while ((line = exec.readLine()) != null) {
writer.write(line);
writer.write('\n');
};

writer.flush();
}
finally {
int rc = exec.getReturnCode();
if (rc != 0) {
throw new RcException("REXX 'jobOutput' process failed", rc);
}
}
}

/**
* Returns the command to be executed via Runtime.exec().
* This is the REXX script 'jobOutput'.
* By default, this script needs to be present in the current PATH.
* However, if the System variable jzos.script.path is defined, it will be
* used to prefix 'jobOutput'.
*/
protected static String getJobOutputCommand(MvsJob mvsJob) {
String cmdPath = System.getProperty("jzos.script.path", "");
if (cmdPath.length() > 0 && !cmdPath.endsWith("/")) {
cmdPath = cmdPath + "/";
}

return cmdPath + JOB_OUTPUT_CMD
+ " "
+ mvsJob.getJobname()
+ " "
+ mvsJob.getJobid();
}

/**
* Returns the environment to use for the child process.
* This is the current environment with _BPX_SHAREAS and _BPX_SPAWN_SCRIPT
* set to "YES", so that the child process will execute in the same
* address space.
*/
protected static String[] getEnvironment() {
Properties p = ZUtil.getEnvironment();
p.put("_BPX_SHAREAS", "YES");
p.put("_BPX_SPAWN_SCRIPT", "YES");

String[] environ = new String[p.size()];
int i = 0;

for (Iterator<Object> iter = p.keySet().iterator(); iter.hasNext();) {
String key = (String)iter.next();
environ[i++] = key + "=" + p.getProperty(key);
System.out.println("environ(" + (i-1) + ")=" + environ[i-1]);
}

return environ;
}
}

In this java code I edit the line:
String cmdPath = System.getProperty("jzos.script.path", "/u/DAINEK/MvsSubmitJob2");
before EDIT it was:
String cmdPath = System.getProperty("jzos.script.path", "");

dovetail
Site Admin
Posts: 1848
Joined: Thu Jul 29, 2004 12:12 pm

Re: Java run REXX. Sample failed.

Post by dovetail » Fri Jul 11, 2014 10:16 am

I notice that you also commented out the key part that actually does something:

//exec.run();

without this, the child process will not be executed, which is why you are getting:

java.io.IOException: No output from jobStatus child process

curious_man
Posts: 9
Joined: Thu Jul 10, 2014 6:21 am

Re: Java run REXX. Sample failed.

Post by curious_man » Sat Jul 12, 2014 9:29 am

yes,in this code is commented. But, see above and find code included exec.run():
...
//start test
try{
//exec.setTimeout(60000);
exec.run();
}catch(Exception e){
System.out.println("now occured exeptions, when exec.run!!!");
e.printStackTrace();
System.exit(8);
}
...
List lst = exec.getErrorLines();
Iterator it=lst.iterator();
while(it.hasNext())
{
String value=(String)it.next();

System.out.println("Value :"+value);
}

curious_man
Posts: 9
Joined: Thu Jul 10, 2014 6:21 am

Re: Java run REXX. Sample failed.

Post by curious_man » Tue Jul 15, 2014 6:57 am

I wrote simple programm to run REXX script across Java:

import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
import com.ibm.jzos.Exec;
import com.ibm.jzos.RcException;
import com.ibm.jzos.ZUtil;

public class CallRexx {
public static final String JOB_STATUS_CMD = "jobStatus";
public static void main(String[] args) {
Exec exec=null;
try{
exec = new Exec("/u/DAINEK/MvsSubmitJob2/jobStatus TCPIP STC05618", getEnvironment());
exec.run();
String line = exec.readLine();
System.out.println("line=" + line);
List lst = exec.getErrorLines();
Iterator it=lst.iterator();
while(it.hasNext())
{
String value=(String)it.next();
System.out.println("Value ="+value);
}
int rc = exec.getReturnCode();
if (rc != 0) {
System.out.println("RC ="+rc);
}
}catch(Exception e){
System.out.println("exec.run catch failed!");
e.printStackTrace();
//System.exit(8);
}
}
protected static String[] getEnvironment() {
Properties p = ZUtil.getEnvironment();
p.put("_BPX_SHAREAS", "YES");
p.put("_BPX_SPAWN_SCRIPT", "YES");

String[] environ = new String[p.size()];
int i = 0;

for (Iterator<Object> iter = p.keySet().iterator(); iter.hasNext();) {
String key = (String)iter.next();
environ[i++] = key + "=" + p.getProperty(key);
System.out.println("environ(" + (i-1) + ")=" + environ[i-1]);
}
return environ;
}

}

And create JCL:
//IASOUT JOB
//JAVA EXEC PROC=JVMPRC61,
// JAVACLS='CallRexx',
// LOGLVL='+T'
//IN1 DD DSN=DAINEK.TAPE,DISP=SHR
//STDENV DD *
set -x
. /etc/profile
export JAVA_HOME=/usr/lpp/Java601_31/J6.0.1
export PATH=$PATH:/bin:"${JAVA_HOME}"/bin:/u/DAINEK/MvsSubmitJob2 //Try to find Rexx script jobStatus.
LIBPATH=/lib:/usr/lib:"${JAVA_HOME}"/bin
LIBPATH="$LIBPATH":"${JAVA_HOME}"/lib/s390
LIBPATH="$LIBPATH":"${JAVA_HOME}"/lib/s390/j9vm
LIBPATH="$LIBPATH":"${JAVA_HOME}"/bin/classic
export LIBPATH="$LIBPATH":
APP_HOME=$JAVA_HOME
CLASSPATH=$APP_HOME:"${JAVA_HOME}"/lib:"${JAVA_HOME}"/lib/ext
for i in "${APP_HOME}"/*.jar; do
CLASSPATH="$CLASSPATH":"$i"
done
export CLASSPATH="$CLASSPATH":
IJO="-Xms16m -Xmx128m"
export IBM_JAVA_OPTIONS="$IJO "
export CLASSPATH="$CLASSPATH":/u/DAINEK/MvsSubmitJob2

And create REXX script:
say 555

Then I submit JCL and get SYSOUT:
JVMJZBL2004N Log level has been set to: T
JVMJZBL2999T -> JzosVM()
JVMJZBL1001N JZOS batch Launcher Version: 2.4.0 2010-11-16
JVMJZBL1002N Copyright (C) IBM Corp. 2005. All rights reserved.
JVMJZBL2999T <- JzosVM()
JVMJZBL2999T -> run()
JVMJZBL1029I Region requested = 0K, Actual below/above limit = 11M / 1719M
JVMJZBL1053I OS Release R23.00 Machine 2827
JVMJZBL2999T -> adoptEnvironment()
JVMJZBL2999T -> spawnChild()
JVMJZBL1036D Spawned child shell process with PID: 65711
JVMJZBL2999T <- spawnChild()
JVMJZBL2999T Writing shell script to child's stdin:
JVMJZBL2999T set -x
JVMJZBL2999T . /etc/profile
JVMJZBL2999T export JAVA_HOME=/usr/lpp/Java601_31/J6.0.1
JVMJZBL2999T export PATH=$PATH:/bin:"${JAVA_HOME}"/bin:/u/DAINEK/MvsSubmitJob2
JVMJZBL2999T LIBPATH=/lib:/usr/lib:"${JAVA_HOME}"/bin
JVMJZBL2999T LIBPATH="$LIBPATH":"${JAVA_HOME}"/lib/s390
JVMJZBL2999T LIBPATH="$LIBPATH":"${JAVA_HOME}"/lib/s390/j9vm
JVMJZBL2999T LIBPATH="$LIBPATH":"${JAVA_HOME}"/bin/classic
JVMJZBL2999T export LIBPATH="$LIBPATH":
JVMJZBL2999T APP_HOME=$JAVA_HOME
JVMJZBL2999T CLASSPATH=$APP_HOME:"${JAVA_HOME}"/lib:"${JAVA_HOME}"/lib/ext
JVMJZBL2999T for i in "${APP_HOME}"/*.jar; do
JVMJZBL2999T CLASSPATH="$CLASSPATH":"$i"
JVMJZBL2999T done
JVMJZBL2999T export CLASSPATH="$CLASSPATH":
JVMJZBL2999T IJO="-Xms16m -Xmx128m"
JVMJZBL2999T export IBM_JAVA_OPTIONS="$IJO "
JVMJZBL2999T export CLASSPATH="$CLASSPATH":/u/DAINEK/MvsSubmitJob2
JVMJZBL1005I Output from DD:STDENV config shell script:
JVMJZBL2999T + . /etc/profile
JVMJZBL2999T + PS1=$LOGNAME:$PWD: >
JVMJZBL2999T + export PS1
JVMJZBL2999T + TZ=GMT-3
JVMJZBL2999T + export TZ
JVMJZBL2999T + LANG=C
JVMJZBL2999T + export LANG
JVMJZBL2999T + readonly LOGNAME
JVMJZBL2999T + PATH=/bin:.
JVMJZBL2999T + export PATH
JVMJZBL2999T + export PATH=/usr/lpp/Printsrv/bin:/bin:.
JVMJZBL2999T + LIBPATH=/lib:/usr/lib:.
JVMJZBL2999T + export LIBPATH
JVMJZBL2999T + export LIBPATH=/usr/lpp/Printsrv/lib:/lib:/usr/lib:.
JVMJZBL2999T + NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
JVMJZBL2999T + export NLSPATH
JVMJZBL2999T + export NLSPATH=/usr/lpp/Printsrv/%L/%N:/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
JVMJZBL2999T + MANPATH=/usr/man/%L
JVMJZBL2999T + export MANPATH
JVMJZBL2999T + export MANPATH=/usr/lpp/Printsrv/man/%L:/usr/man/%L
JVMJZBL2999T + MAIL=/usr/mail/
JVMJZBL2999T + export MAIL
JVMJZBL2999T + umask 022
JVMJZBL2999T + export PATH=/usr/local/bin:/usr/lpp/Printsrv/bin:/bin:.
JVMJZBL2999T + export JAVA_HOME=/usr/lpp/Java601_31
JVMJZBL2999T + export STEPLIB=DSNA10.IAS.SDSNEXIT:DSNA10.SDSNLOAD:DSNA10.SDSNLOD2:
JVMJZBL2999T + export PATH=/usr/lpp/db2810/jcc/bin:/usr/local/bin:/usr/lpp/Printsrv/bin:/bin:.
JVMJZBL2999T + export LIBPATH=/usr:/usr/lib:/usr/lpp/db2810/jcc/lib:/usr/lpp/Printsrv/lib:/lib:/usr/lib:.
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip:/usr/lpp/db2810/jcc/classes/db2jcc_license_cisuz.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip:/usr/lpp/db2810/jcc/classes/db2jcc_license_cisuz.jar:/usr/
lpp/mqm/V6R0M0/
java/lib/com.ibm.mq.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip:/usr/lpp/db2810/jcc/classes/db2jcc_license_cisuz.jar:/usr/
lpp/mqm/V6R0M0/
java/lib/com.ibm.mq.jar:/usr/lpp/mqm/V6R0M0/java/lib/com.ibm.mqjms.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip:/usr/lpp/db2810/jcc/classes/db2jcc_license_cisuz.jar:/usr/
lpp/mqm/V6R0M0/
java/lib/com.ibm.mq.jar:/usr/lpp/mqm/V6R0M0/java/lib/com.ibm.mqjms.jar:/usr/lpp/mqm/V6R0M0/java/lib/connector.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip:/usr/lpp/db2810/jcc/classes/db2jcc_license_cisuz.jar:/usr/
lpp/mqm/V6R0M0/
java/lib/com.ibm.mq.jar:/usr/lpp/mqm/V6R0M0/java/lib/com.ibm.mqjms.jar:/usr/lpp/mqm/V6R0M0/java/lib/connector.jar:/usr/l
pp/mqm/V6R0M0/java/lib/jms.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip:/usr/lpp/db2810/jcc/classes/db2jcc_license_cisuz.jar:/usr/
lpp/mqm/V6R0M0/
java/lib/com.ibm.mq.jar:/usr/lpp/mqm/V6R0M0/java/lib/com.ibm.mqjms.jar:/usr/lpp/mqm/V6R0M0/java/lib/connector.jar:/usr/l
pp/mqm/V6R0M0/java/lib/jms.jar:/usr/lpp/mqm/V6R0M0/java/lib/rmm.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip:/usr/lpp/db2810/jcc/classes/db2jcc_license_cisuz.jar:/usr/
lpp/mqm/V6R0M0/
java/lib/com.ibm.mq.jar:/usr/lpp/mqm/V6R0M0/java/lib/com.ibm.mqjms.jar:/usr/lpp/mqm/V6R0M0/java/lib/connector.jar:/usr/l
pp/mqm/V6R0M0/java/lib/jms.jar:/usr/lpp/mqm/V6R0M0/java/lib/rmm.jar:/usr/lpp/mqm/V6R0M0/java/lib/providerutil.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip:/usr/lpp/db2810/jcc/classes/db2jcc_license_cisuz.jar:/usr/
lpp/mqm/V6R0M0/
java/lib/com.ibm.mq.jar:/usr/lpp/mqm/V6R0M0/java/lib/com.ibm.mqjms.jar:/usr/lpp/mqm/V6R0M0/java/lib/connector.jar:/usr/l
pp/mqm/V6R0M0/java/lib/jms.jar:/usr/lpp/mqm/V6R0M0/java/lib/rmm.jar:/usr/lpp/mqm/V6R0M0/java/lib/providerutil.jar:/usr/l
pp/mqm/V6R0M0/j
ava/lib/jta.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip:/usr/lpp/db2810/jcc/classes/db2jcc_license_cisuz.jar:/usr/
lpp/mqm/V6R0M0/
java/lib/com.ibm.mq.jar:/usr/lpp/mqm/V6R0M0/java/lib/com.ibm.mqjms.jar:/usr/lpp/mqm/V6R0M0/java/lib/connector.jar:/usr/l
pp/mqm/V6R0M0/java/lib/jms.jar:/usr/lpp/mqm/V6R0M0/java/lib/rmm.jar:/usr/lpp/mqm/V6R0M0/java/lib/providerutil.jar:/usr/l
pp/mqm/V6R0M0/j
ava/lib/jta.jar:/usr/lpp/mqm/V6R0M0/java/lib/fscontext.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip:/usr/lpp/db2810/jcc/classes/db2jcc_license_cisuz.jar:/usr/
lpp/mqm/V6R0M0/
java/lib/com.ibm.mq.jar:/usr/lpp/mqm/V6R0M0/java/lib/com.ibm.mqjms.jar:/usr/lpp/mqm/V6R0M0/java/lib/connector.jar:/usr/l
pp/mqm/V6R0M0/java/lib/jms.jar:/usr/lpp/mqm/V6R0M0/java/lib/rmm.jar:/usr/lpp/mqm/V6R0M0/java/lib/providerutil.jar:/usr/l
pp/mqm/V6R0M0/j
ava/lib/jta.jar:/usr/lpp/mqm/V6R0M0/java/lib/fscontext.jar:/usr/lpp/mqm/V6R0M0/java/lib/dhbcore.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip:/usr/lpp/db2810/jcc/classes/db2jcc_license_cisuz.jar:/usr/
lpp/mqm/V6R0M0/
java/lib/com.ibm.mq.jar:/usr/lpp/mqm/V6R0M0/java/lib/com.ibm.mqjms.jar:/usr/lpp/mqm/V6R0M0/java/lib/connector.jar:/usr/l
pp/mqm/V6R0M0/java/lib/jms.jar:/usr/lpp/mqm/V6R0M0/java/lib/rmm.jar:/usr/lpp/mqm/V6R0M0/java/lib/providerutil.jar:/usr/l
pp/mqm/V6R0M0/j
ava/lib/jta.jar:/usr/lpp/mqm/V6R0M0/java/lib/fscontext.jar:/usr/lpp/mqm/V6R0M0/java/lib/dhbcore.jar:/usr/lpp/mqm/V6R0M0/
java/lib/CL3Nonexport.jar
JVMJZBL2999T + export CLASSPATH=:/usr/lpp/db2810/jcc/classes:/usr/lpp/db2810/jcc/classes/db2jcc.jar:/usr/lpp/db2810/jcc/
classes/db2jcc_javax.jar:/usr/lpp/db2810/jcc/classes/sqlj.zip:/usr/lpp/db2810/jcc/classes/db2jcc_license_cisuz.jar:/usr/
lpp/mqm/V6R0M0/
java/lib/com.ibm.mq.jar:/usr/lpp/mqm/V6R0M0/java/lib/com.ibm.mqjms.jar:/usr/lpp/mqm/V6R0M0/java/lib/connector.jar:/usr/l
pp/mqm/V6R0M0/java/lib/jms.jar:/usr/lpp/mqm/V6R0M0/java/lib/rmm.jar:/usr/lpp/mqm/V6R0M0/java/lib/providerutil.jar:/usr/l
pp/mqm/V6R0M0/j
ava/lib/jta.jar:/usr/lpp/mqm/V6R0M0/java/lib/fscontext.jar:/usr/lpp/mqm/V6R0M0/java/lib/dhbcore.jar:/usr/lpp/mqm/V6R0M0/
java/lib/CL3Nonexport.jar:/usr/lpp/mqm/V6R0M0/java/lib/CL3Export.jar
JVMJZBL2999T + export JAVA_HOME=/usr/lpp/Java601_31/J6.0.1
JVMJZBL2999T + export PATH=/usr/lpp/db2810/jcc/bin:/usr/local/bin:/usr/lpp/Printsrv/bin:/bin:.:/bin:/usr/lpp/Java601_31/
J6.0.1/bin:/u/DAINEK/MvsSubmitJob2
JVMJZBL2999T + LIBPATH=/lib:/usr/lib:/usr/lpp/Java601_31/J6.0.1/bin
JVMJZBL2999T + LIBPATH=/lib:/usr/lib:/usr/lpp/Java601_31/J6.0.1/bin:/usr/lpp/Java601_31/J6.0.1/lib/s390
JVMJZBL2999T + LIBPATH=/lib:/usr/lib:/usr/lpp/Java601_31/J6.0.1/bin:/usr/lpp/Java601_31/J6.0.1/lib/s390:/usr/lpp/Java601
_31/J6.0.1/lib/s390/j9vm
JVMJZBL2999T + LIBPATH=/lib:/usr/lib:/usr/lpp/Java601_31/J6.0.1/bin:/usr/lpp/Java601_31/J6.0.1/lib/s390:/usr/lpp/Java601
_31/J6.0.1/lib/s390/j9vm:/usr/lpp/Java601_31/J6.0.1/bin/classic
JVMJZBL2999T + export LIBPATH=/lib:/usr/lib:/usr/lpp/Java601_31/J6.0.1/bin:/usr/lpp/Java601_31/J6.0.1/lib/s390:/usr/lpp/
Java601_31/J6.0.1/lib/s390/j9vm:/usr/lpp/Java601_31/J6.0.1/bin/classic:
JVMJZBL2999T + APP_HOME=/usr/lpp/Java601_31/J6.0.1
JVMJZBL2999T + CLASSPATH=/usr/lpp/Java601_31/J6.0.1:/usr/lpp/Java601_31/J6.0.1/lib:/usr/lpp/Java601_31/J6.0.1/lib/ext
JVMJZBL2999T + CLASSPATH=/usr/lpp/Java601_31/J6.0.1:/usr/lpp/Java601_31/J6.0.1/lib:/usr/lpp/Java601_31/J6.0.1/lib/ext:/u
sr/lpp/Java601_31/J6.0.1/*.jar
JVMJZBL2999T + export CLASSPATH=/usr/lpp/Java601_31/J6.0.1:/usr/lpp/Java601_31/J6.0.1/lib:/usr/lpp/Java601_31/J6.0.1/lib
/ext:/usr/lpp/Java601_31/J6.0.1/*.jar:
JVMJZBL2999T + IJO=-Xms16m -Xmx128m
JVMJZBL2999T + export IBM_JAVA_OPTIONS=-Xms16m -Xmx128m
JVMJZBL2999T + export CLASSPATH=/usr/lpp/Java601_31/J6.0.1:/usr/lpp/Java601_31/J6.0.1/lib:/usr/lpp/Java601_31/J6.0.1/lib
/ext:/usr/lpp/Java601_31/J6.0.1/*.jar::/u/DAINEK/MvsSubmitJob2
JVMJZBL2999T + echo ___JZOS_ENV_START___
JVMJZBL2999T Found environment start string
JVMJZBL2999T ___JZOS_ENV_START___
JVMJZBL2999T Ignored line: + env

JVMJZBL1006I MAIL = /usr/mail/
JVMJZBL1006I PATH = /usr/lpp/db2810/jcc/bin:/usr/local/bin:/usr/lpp/Printsrv/bin:/bin:.:/bin:/usr/lpp/Java601_31/J6.0.1/
bin:/u/DAINEK/MvsSubmitJob2
JVMJZBL1006I IBM_JAVA_OPTIONS = -Xms16m -Xmx128m
JVMJZBL1006I PS1 = $LOGNAME:$PWD: >
JVMJZBL1006I _BPX_SPAWN_SCRIPT = YES
JVMJZBL1006I _ = /bin/env
JVMJZBL1006I CLASSPATH = /usr/lpp/Java601_31/J6.0.1:/usr/lpp/Java601_31/J6.0.1/lib:/usr/lpp/Java601_31/J6.0.1/lib/ext:/u
sr/lpp/Java601_31/J6.0.1/*.jar::/u/DAINEK/MvsSubmitJob2
JVMJZBL1006I STEPLIB = DSNA10.IAS.SDSNEXIT:DSNA10.SDSNLOAD:DSNA10.SDSNLOD2:
JVMJZBL1006I LANG = C
JVMJZBL1006I LIBPATH = /lib:/usr/lib:/usr/lpp/Java601_31/J6.0.1/bin:/usr/lpp/Java601_31/J6.0.1/lib/s390:/usr/lpp/Java601
_31/J6.0.1/lib/s390/j9vm:/usr/lpp/Java601_31/J6.0.1/bin/classic:
JVMJZBL1006I _BPX_SHAREAS = YES
JVMJZBL1006I JAVA_HOME = /usr/lpp/Java601_31/J6.0.1
JVMJZBL1006I TZ = GMT-3
JVMJZBL1006I MANPATH = /usr/lpp/Printsrv/man/%L:/usr/man/%L
JVMJZBL1006I NLSPATH = /usr/lpp/Printsrv/%L/%N:/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
JVMJZBL1006I + echo PWD = /u/DAINEK
JVMJZBL1006I PWD = /u/DAINEK
JVMJZBL2999T Setting current working dir to: "/u/DAINEK"
JVMJZBL2999T Ignored line: + echo ___JZOS_ENV_STOP___

JVMJZBL2999T Found environment stop string
JVMJZBL2999T + exit
JVMJZBL2999T waiting for child shell process to complete
JVMJZBL2999T -> waitChild()
JVMJZBL2999T child shell process exited with exit code 0
JVMJZBL2999T <- waitChild()
JVMJZBL2999T <- adoptEnvironment()
JVMJZBL2999T argvг2…: CallRexx
JVMJZBL2999T argvг3…: BBOS001
JVMJZBL2999T argvг4…: STC05206
JVMJZBL2999T -> processExtraArgs()
JVMJZBL2999T No JZOS_MAIN_ARGS found
JVMJZBL2999T NO //DD:MAINARGS found
JVMJZBL2999T mainArgsBuf=""
JVMJZBL2999T <- processExtraArgs()
JVMJZBL2999T -> initializeVMArgs()
JVMJZBL2999T vm_args.version: 10004
JVMJZBL2999T Getting CLASSPATH
JVMJZBL2999T Classpath option string: '-Djava.class.path=/usr/lpp/Java601_31/J6.0.1:/usr/lpp/Java601_31/J6.0.1/lib:/usr/
lpp/Java601_31/J6.0.1/lib/ext:/usr/lpp/Java601_31/J6.0.1/*.jar::/u/DAINEK/MvsSubmitJob2'
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T <- initializeVMArgs()
JVMJZBL2999T -> createJvm()
JVMJZBL2999T JNI_CreateJavaVM elapsed time=0.316160 seconds, cpu time=0.229972 seconds
JVMJZBL2999T <- createJvm()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> StaticMethod.invoke()
JVMJZBL2999T com.ibm.jzos.ZUtil.getJavaVersionInfo
JVMJZBL2999T method invocation elapsed time=0.004090 seconds, cpu time=0.008901 seconds
JVMJZBL2999T <- StaticMethod.invoke()
JVMJZBL1012I Java Virtual Machine created. Version information follows:
java version "1.6.0"
Java(TM) SE Runtime Environment (build 20110418_80450)
IBM J9 VM (build 2.6, JRE 1.6.0 z/OS s390-31 20110418_80450 (JIT enabled, AOT enabled)
J9VM - R26_Java626_GA_FP1_20110418_1915_B80450
JIT - r11_20110215_18645ifx8
GC - R26_Java626_GA_FP1_20110418_1915_B80450
J9CL - 20110418_80450)
JVMJZBL2999T -> checkVersions()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> StaticMethod.invoke()
JVMJZBL2999T com.ibm.jzos.ZUtil.getJzosJarVersion
JVMJZBL2999T method invocation elapsed time=0.000323 seconds, cpu time=0.000713 seconds
JVMJZBL2999T <- StaticMethod.invoke()
JVMJZBL2999T Build versions match: 2.4.0 2010-11-16
JVMJZBL2999T <- checkVersions()
JVMJZBL2999T -> redirectStandardStreams()
JVMJZBL2999T No JZOS_OUTPUT_ENCODING found, using the default codeset 'IBM-1047'
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> StaticMethod.invoke()
JVMJZBL2999T com.ibm.jzos.ZUtil.redirectStandardStreams
JVMJZBL2999T method invocation elapsed time=0.011800 seconds, cpu time=0.009094 seconds
JVMJZBL2999T <- StaticMethod.invoke()
JVMJZBL1027I Using output encoding: IBM-1047
JVMJZBL2999T <- redirectStandardStreams()
JVMJZBL2999T -> establishMvsCommandListener()
JVMJZBL1016I MVS commands are ENABLED
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> StaticMethod.invoke()
JVMJZBL2999T com.ibm.jzos.MvsConsole.startMvsCommandListener
JVMJZBL2999T method invocation elapsed time=0.001133 seconds, cpu time=0.001118 seconds
JVMJZBL2999T <- StaticMethod.invoke()
JVMJZBL2999T <- establishMvsCommandListener()
JVMJZBL2999T -> invokeMain()
JVMJZBL2999T javaClassName: 'CallRexx'
JVMJZBL1023N Invoking CallRexx.main()...
JVMJZBL1056I Arguments to main...

JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T -> StaticMethod.invoke()
JVMJZBL2999T CallRexx.main
JVMJZBL2999T method invocation elapsed time=0.041121 seconds, cpu time=0.015940 seconds
JVMJZBL2999T <- StaticMethod.invoke()
JVMJZBL1024N CallRexx.main() completed.
JVMJZBL2999T <- invokeMain()
JVMJZBL2999T <- run()
JVMJZBL2999T -> cleanup()
JVMJZBL1014I Waiting for non-deamon Java threads to finish before exiting...
JVMJZBL2999T JvmExitHook entered with exitCode=0, javaMainReturnedOrThrewException=1
JVMJZBL2999T DestroyJavaVM elapsed time=0.004513 seconds, cpu time=0.002609 seconds
JVMJZBL2999I JZOS batch launcher elapsed time=0 seconds, cpu time=0.540000 seconds
JVMJZBL1021N JZOS batch launcher completed, return code=0
JVMJZBL2999T <- cleanup()
JVMJZBL2999T -> ~JzosVM()
JVMJZBL2999T <- ~JzosVM()

And get STDOUT:
environ(0)=LIBPATH=/usr/lpp/Java601_31/J6.0.1/lib/s390/default:/lib:/usr/lib:/usr/lpp/Java601_31/J6.0.1/bin:/usr/lpp/Java601_31/J6.0
.1/lib/s390:/usr/lpp/Java601_31/J6.0.1/lib/s390/j9vm:/usr/lpp/Java601_31/J6.0.1/bin/classic::/usr/lpp/Java601_31/J6.0.1/lib/s390/def
ault:/usr/lpp/Java601_31/J6.0.1/lib/s390
environ(1)=_BPX_SHAREAS=YES
environ(2)=JAVA_HOME=/usr/lpp/Java601_31/J6.0.1
environ(3)=NLSPATH=/usr/lpp/Printsrv/%L/%N:/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
environ(4)=LANG=C
environ(5)=_BPX_SPAWN_SCRIPT=YES
environ(6)=MANPATH=/usr/lpp/Printsrv/man/%L:/usr/man/%L
environ(7)=PWD=/u/DAINEK
environ(8)=PS1=$LOGNAME:$PWD: >
environ(9)=MAIL=/usr/mail/
environ(10)=TZ=GMT-3
environ(11)=CLASSPATH=/usr/lpp/Java601_31/J6.0.1:/usr/lpp/Java601_31/J6.0.1/lib:/usr/lpp/Java601_31/J6.0.1/lib/ext:/usr/lpp/Java601_
31/J6.0.1/*.jar::/u/DAINEK/MvsSubmitJob2
environ(12)=_EDC_PTHREAD_YIELD=-2
environ(13)=STEPLIB=DSNA10.IAS.SDSNEXIT:DSNA10.SDSNLOAD:DSNA10.SDSNLOD2:
environ(14)=IBM_JAVA_OPTIONS=-Xms16m -Xmx128m
environ(15)=PATH=/usr/lpp/db2810/jcc/bin:/usr/local/bin:/usr/lpp/Printsrv/bin:/bin:.:/bin:/usr/lpp/Java601_31/J6.0.1/bin:/u/DAINEK/M
vsSubmitJob2

environ(16)=+ echo PWD=/u/DAINEK
environ(17)=_=/bin/env
line=null
Value =say: /u/DAINEK/MvsSubmitJob2/jobStatus 1: FSUM7351 not found
RC =127

FSUM7351:
not found
Explanation
You attempted to execute a command that could not be found.
User response
Ensure that the command exists and that the PATH environment variable is valid.

Why it gives this error?
I think that Java does not recognize the contents file named "jobStatus" as a REXX script..
Somebody ran REXX through Java?

dovetail
Site Admin
Posts: 1848
Joined: Thu Jul 29, 2004 12:12 pm

Re: Java run REXX. Sample failed.

Post by dovetail » Tue Jul 15, 2014 9:01 am

Did you try to execute your REXX script from a z/OS UNIX shell? Just type its full path name from a z/OS UNIX shell:

/u/DAINEK/MvsSubmitJob2/jobStatus

curious_man
Posts: 9
Joined: Thu Jul 10, 2014 6:21 am

Re: Java run REXX. Sample failed.

Post by curious_man » Wed Jul 16, 2014 9:06 am

How to run REXX script from OMVS USS ? Please, show me example.

curious_man
Posts: 9
Joined: Thu Jul 10, 2014 6:21 am

Re: Java run REXX. Sample failed.

Post by curious_man » Thu Jul 17, 2014 5:17 am

Yes, full path name from a z/OS UNIX shell: /u/DAINEK/MvsSubmitJob2/jobStatus , where jobStatus is a REXX script.

curious_man
Posts: 9
Joined: Thu Jul 10, 2014 6:21 am

Re: Java run REXX. Sample failed.

Post by curious_man » Mon Jul 21, 2014 4:22 am

I'm a solution trouble.
In first line REXX script I put the comment: /* REXX */
Now,script see as:

/* REXX */
parse arg jobname jobid
if jobid <> '' then
do
jobname = jobname'('jobid')'
end
call rexxopt 'notsoin'
address tso "STATUS" jobname
address tso LOGOFF
exit 0

It's incredible! But it's true. Thanks for the help!

Post Reply