Defining a JZOS-based started task

General discussion on the JZOS batch launcher and toolkit
Post Reply
bilbozos
Posts: 18
Joined: Wed Jan 18, 2006 5:53 am

Defining a JZOS-based started task

Post by bilbozos »

Hello,

I have a question regarding the definition of a java-based started task using JZOS.

THE SCENARIO:
We have developed a Java (stand-alone) program which connects to a (local) MQ Manager. The function of this program is basically wait for messages, parse them, and then save their data in DB2 tables.

This program, once launched, runs forever until there's a timeout (x minutes during which no message has been received).

We currently launch this program from the USS (Unix System Services) using the CRON services. CRON just runs a shell script which invokes a JVM for this program.

THE QUESTION:
We have modified the java program to use JZOS libraries and adapt it so that it can respond to MVS commands (MODIFY mainly). Apart from this, we would like this program to be a started task, so that any operator could launch it.

As far as I know, apart from making the corresponding definitons in the RACF server, we have to define a PROCEDURE which calls our program. The JZOS itself is another procedure. In this scenario, this new PROC will call in fact another PROC (JZOS' procedure), that is, a PROC that invokes another PROC (nested PROC). I'm a bit lost. I enclose the JCL invoking my Java program. Invoking the Java class from this JCL works fine, but as you can see, I need to specify "USER=USRCRON" because this program requires this special user to do some other things. However nobody is authorised to use "USER=USRCRON", so when I launch this JCL I must remove that statement (USER=USRCRON).

If this was a started task, I could associate the started task the user USRCRON no matter what other user in the system launches the started task.

Does anybody understand my problem? ;-)

Any hint or suggestion would be highly appreciated
Aitor.

Code: Select all

//MQPARSER JOB MSGCLASS=X,USER=USRCRON
//PROCLIB  JCLLIB ORDER=LOCAL.JZOS.SAMPJCL
//JAVA     EXEC PROC=EXJZOSVM,VERSION='14',
//  LOGLVL='+I',
//  JAVACLS='mq.test.MQParserMVS'    
//STDENV   DD *
...
//
coz
Posts: 391
Joined: Fri Jul 30, 2004 5:29 pm

Post by coz »

Here's a sample PROC to run JZOS as a started task that you should be able to customize for your purposes. You might also want to look at Mike Cox's article on using JZOS to run Cloudscape (aka Derby) as a started task:

http://www-1.ibm.com/support/docview.ws ... s1td102368

Code: Select all

//JZOSST    PROC REGSIZE='0M',
//   JAVACLS='mq.test.MQParserMVS',
//   ARGS='Args_to_MQParserMVS_here',
//   LIBRARY='SYS1.JZOS.LOADLIB',         < STEPLIB FOR JVMLDM MODULE
//   VERSION='14',                        < JVMLDM VERSION
//   LOGLVL='+I',                         < DEBUG LVL: +I(INFO) +T(TRC)
//   LEPARM=''
//JAVAJVM EXEC PGM=JVMLDM&VERSION,REGION=&REGSIZE,
//   PARM='&LEPARM/&LOGLVL &JAVACLS &ARGS '
//STEPLIB DD DSN=&LIBRARY,DISP=SHR
//SYSPRINT DD SYSOUT=*          < SYSTEM STDOUT
//SYSOUT   DD SYSOUT=*          < SYSTEM STDERR
//STDOUT   DD SYSOUT=*          < JAVA SYSTEM.OUT
//STDERR   DD SYSOUT=*          < JAVA SYSTEM.ERR
//CEEDUMP DD SYSOUT=*
//ABNLIGNR DD DUMMY
//*STDIN   DD          < OPTIONAL - JAVA SYSTEM.IN
//STDENV DD DISP=SHR,DSN=SYS1.PROCLIB(JZOSENV) <envion setup script
//*MAINARGS DD         < OPTIONAL - ALTERNATE METHOD TO SUPPLY ARGS
// PEND
bilbozos
Posts: 18
Joined: Wed Jan 18, 2006 5:53 am

Post by bilbozos »

Thanks a lot Steve.
Post Reply