|
Jeff, a better way to execute a command than using QCMDEXC is to re-send the &RQSDTA to *EXT type *RQS and give it over to original request processor by TFRCTL to QCMD. I used that once to do things to CRTxxx like processing in-source embedded commands (OVRDBF before compile etc), build xref etc. In that way I managed to be able to recompile entire production source files (a good guarantee that your system is solid and source/object consistent). btw-1: VAR(&RQSDTA) LEN(256) will give you troubles. I often have use commands. btw-2: The all-catching MONMSG will make all jobs end 'Normal'. Why give up an 'Job xxx ended in error'? The choise between theese two completion messages _are_ informative. I even once changed the 2'nd level text for 'Job ended normally' into 'This does not mean that the result is what you wanted, just that I have not discovered that there is somthing wrong', so when users showed me an empty report on sales from 2002.01.01 to 2001.12.31 and asked me why they got 'Job ended normally' when the report does not look normal, then I just showed them the 2'level text. Henrik http://hkrebs.dk > From: Jeff Bull <Jeff.Bull@itm-group.co.uk> > To: "'midrange-l@midrange.com'" <midrange-l@midrange.com> > Subject: RE: Running batch jobs in Qinter > Date: Thu, 12 Dec 2002 16:56:41 -0000 > Reply-To: midrange-l@midrange.com > > I've found the cl source for my alternate QCMD processor. You will need to > adapt the validation and rejection messages of course. > > > PGM > > /* Work field declarations */ > DCL VAR(&CRT) TYPE(*CHAR) LEN(6) > DCL VAR(&IND) TYPE(*CHAR) LEN(1) > DCL VAR(&JOBNAM) TYPE(*CHAR) LEN(10) > DCL VAR(&JOBNBR) TYPE(*CHAR) LEN(6) > DCL VAR(&JOBUSR) TYPE(*CHAR) LEN(10) > DCL VAR(&RQSDTA) TYPE(*CHAR) LEN(256) > > /* Retreive the submitted command */ > DUMMY: RCVMSG PGMQ(*EXT) MSGTYPE(*RQS) MSG(&RQSDTA) > > /* Flag Compilation commands */ > CHGVAR VAR(&CRT) VALUE(%SST(&RQSDTA 1 6)) > CHGVAR VAR(&IND) VALUE('0') > IF COND(&CRT = 'COMPFI') THEN(CHGVAR VAR(&IND) VALUE('1')) > IF COND(&CRT = 'CRTBND') THEN(CHGVAR VAR(&IND) VALUE('1')) > IF COND(&CRT = 'CRTCBL') THEN(CHGVAR VAR(&IND) VALUE('1')) > IF COND(&CRT = 'CRTCLM') THEN(CHGVAR VAR(&IND) VALUE('1')) > IF COND(&CRT = 'CRTCLP') THEN(CHGVAR VAR(&IND) VALUE('1')) > IF COND(&CRT = 'CRTDSP') THEN(CHGVAR VAR(&IND) VALUE('1')) > IF COND(&CRT = 'CRTPGM') THEN(CHGVAR VAR(&IND) VALUE('1')) > IF COND(&CRT = 'CRTBND') THEN(CHGVAR VAR(&IND) VALUE('1')) > IF COND(&CRT = 'CRTPRT') THEN(CHGVAR VAR(&IND) VALUE('1')) > IF COND(&CRT = 'CRTRPG') THEN(CHGVAR VAR(&IND) VALUE('1')) > IF COND(&CRT = 'CRTSQL') THEN(CHGVAR VAR(&IND) VALUE('1')) > IF COND(&CRT = 'CRTS36') THEN(CHGVAR VAR(&IND) VALUE('1')) > > /* Execute non-compilation requests */ > IF COND(&IND *EQ '0') THEN(DO) > CALL PGM(*LIBL/QCMDEXC) PARM(&RQSDTA 256) > MONMSG MSGID(CPF0000 MCH0000) > ENDDO > > /* Reject compilation requests */ > IF COND(&IND *EQ '1') THEN(DO) > RTVJOBA JOB(&JOBNAM) USER(&JOBUSR) NBR(&JOBNBR) > SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('Job' + > *BCAT &JOBNAM *TCAT '/' *TCAT &JOBUSR + > *TCAT '/' *TCAT &JOBNBR *BCAT 'must be + > submitted to the COMPILE subsystem, job + > queue QBATCHC. Submitted command was + > CMD(' *TCAT &RQSDTA *TCAT ')') + > TOUSR(&JOBUSR) MSGTYPE(*DIAG) > SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('Job' + > *BCAT &JOBNAM *TCAT '/' *TCAT &JOBUSR + > *TCAT '/' *TCAT &JOBNBR *BCAT 'submitted + > to QBATCHM *SBS in error. Command was + > CMD(' *TCAT &RQSDTA *TCAT ')') + > TOUSR(BULLJ1) MSGTYPE(*INFO) > DSPJOBLOG JOB(*) OUTPUT(*PRINT) > SNDPGMMSG MSGID(CPF0001) MSGF(QCPFMSG) + > MSGDTA('submitted') TOUSR(&JOBUSR) + > MSGTYPE(*ESCAPE) > SNDPGMMSG MSGID(CPC2402) MSGF(QCPFMSG) MSGTYPE(*COMP) > ENDDO > > /* Program Exit Procedure */ > RETURN > 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.