Example with STDIN and MAINARGS
COBOL Program
IDENTIFICATION DIVISION.
PROGRAM-ID. PARM1.
DATA DIVISION.
LINKAGE SECTION.
01 PARM-GRP.
05 PARM-LENGTH PIC S9(04) COMP.
05 PARM-DATA1 PIC X(5).
05 PARM-DATA2 PIC 9(4).
WORKING-STORAGE SECTION.
01 PARM-DATA3 PIC X(4).
PROCEDURE DIVISION USING PARM-GRP.
DISPLAY "MAINARGS LENGTH: " PARM-LENGTH.
DISPLAY "MAINARGS ARGS1: " PARM-DATA1.
DISPLAY "MAINARGS ARGS2: " PARM-DATA2.
ACCEPT PARM-DATA3 FROM SYSIN.
DISPLAY "STDIN ARGS3: " PARM-DATA3.
STOP RUN.
Jopaz Execution JCL Job
...
// EXPORT SYMLIST=(*)
...
// SET CLASS='PARM1'
...
// SET ARGS1='Jopaz'
// SET ARGS2='1234'
// SET ARGS3='Test'
...
//JVMEXEC EXEC PROC=&JVM64,REGSIZE=512M,LOGLVL='+T',
// JAVACLS=&CLASS
//STDENV DD DISP=SHR,DSN=&CONFIG
//JPZOPT DD DISP=SHR,DSN=&RUNOPT
//STEPLIB DD DISP=SHR,DSN=&MLCLIB
// DD DISP=SHR,DSN=&ASMLIB
//LICJPZBT DD DISP=SHR,DSN=&JPZLIC
//*
//STDIN DD *,SYMBOLS=JCLONLY
&ARGS3.
//*
//MAINARGS DD *,SYMBOLS=JCLONLY
'&ARGS1.&ARGS2.'
STDOUT of JCL Job
MAINARGS LENGTH: 0009
MAINARGS ARGS1: Jopaz
MAINARGS ARGS2: 1234
STDIN ARGS3: Test
SYSOUT of JCL Job with Java Trace
This information is only visible if you have LOGLVL=’+T’ set.
JVMJZBL2004N Log level has been set to: T
JVMJZBL2999T -> JzosVM()
...
JVMJZBL2999T -> invokeMain()
JVMJZBL2999T javaClassName: 'PARM1'
JVMJZBL2999T Arg 1='Jopaz1234'
JVMJZBL1023N Invoking PARM1.main()...
JVMJZBL1056I Arguments to main...
JVMJZBL1057I Jopaz1234
JVMJZBL2999T -> JniUtil.convert()
JVMJZBL2999T <- JniUtil.convert()
JVMJZBL2999T JvmExitHook entered with exitCode=0, javaMainReturnedOrThrewException=0
JVMJZBL1043N The Java virtual machine completed with System.exit(0)