|
Jason:
This CL program you show below will never work under any circumstances.
The SBMJOB does not allow you to specify embedded &variables as you have
done; you must concatenate the entire command string into a single
variable, and then you can issue:
SBMJOB CMD(&CMD) ...
and you must be careful about "embedded quotes" inside that &CMD string.
You may also want to issue a CHGJOB JOB(*) LOG(4 0 *SECLVL) within this
CL program, prior to the SBMJOB command, to ensure you will always get a
job log and you can see all diagnostic and error messages that may be
produced.
Also, I would specify a JOBD on the SBMJOB command, with a *JOBD that
specifies LOG(4 0 *SECLVL), so you always have a job log to examine, in
the event something fails within the submitted job.
Hope that helps,
Mark S. Waterbury
> On 3/7/2011 8:05 AM, Jason Abreu wrote:
I have a CL program that I use to define a Custom TCPSRV for starting and
Tomcat 6.0.30. When the machine is up and running, the STRTCPSVR
*TOMCAT runs with no errors.
After the machine leaves a restricted state (IPL/ Opt 21 Backup),
however, the command fails and prevents other startup jobs from running.
Those startup jobs have to manually be executed.
Any ideas why this may occur? I have included my CL code below.
==============================
PGM PARM(&COMMAND)
DCL VAR(&COMMAND) TYPE(*CHAR) LEN(10)
DCL VAR(&JOBNAME) TYPE(*CHAR) LEN(10)
DCL VAR(&QSHCMD) TYPE(*CHAR) LEN(255) +
VALUE('cd /Apache/apache-tomcat-6.0.30/bin;')
IF COND((&COMMAND *EQ '*START')) THEN(DO)
CHGVAR VAR(&JOBNAME) VALUE('STRTOMCAT')
CHGVAR VAR(&QSHCMD) VALUE(&QSHCMD *TCAT './startup.sh')
ENDDO
IF COND((&COMMAND *EQ '*END')) THEN(DO)
CHGVAR VAR(&JOBNAME) VALUE('ENDTOMCAT')
CHGVAR VAR(&QSHCMD) VALUE(&QSHCMD *TCAT './shutdown.sh')
ENDDO
OVRDBF FILE(STDOUT) TOFILE(QSYS/QPRINT)
OVRDBF FILE(STDERR) TOFILE(QSYS/QPRINT)
SBMJOB CMD(QSH CMD(&QSHCMD)) JOB(&JOBNAME) +
JOBQ(QSYSNOMAX) USER(TOMCAT) +
MSGQ(QUSRSYS/TOMCAT)
ENDPGM
==============================
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.