Debug self-submitting CL

Learn how to use a data area in QTEMP that makes the CL run interactively.

We use self-submitting CL programs to run reports in batch. But when we need to debug the programs, we'd like to...

stop the CL from self-submitting.

Instead of changing the code temporarily, use a data area in QTEMP whose mere existence makes the CL run interactively. If data area NOBATCH (any type/size) isn't found, the CL self-submits normally.

 
		
DCL VAR(&JTYP) TYPE(*CHAR) LEN(1) VALUE('0')

/* If running interactively, submit to batch : */

CHKOBJ OBJ(NOBATCH) OBJTYPE(*DTAARA)

MONMSG MSGID(CPF0000 MCH0000) EXEC(RTVJOBA TYPE(&JTYP))

DO_SUBMIT:  IF COND(&JTYP *EQ '1') THEN(DO)

SBMJOB CMD(CALL PGM(THISPGM) PARM(&DATA)) JOB(JOB_NAME)

RETURN

OD_SUBMIT: ENDDO 

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Ask your programming questions--or help out your peers by answering them--in our live discussion forums.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.


This was last published in November 2001

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchEnterpriseLinux

SearchDataCenter

Close