You can use the older "with debugging mode" feature or the new with COBOL 6 more flexible conditional compilation to preserve your testing DISPLAY statements in the source for the next round of changes. Here the compiler option DEFINE(DEBUG=1) will compile in the DISPLAY statement, omitting it will make the DISPLAY a comment.
IBM Canada Ltd.
Original Message:
Sent: Tue August 22, 2023 08:18 AM
From: Jon Butler
Subject: CICS program to display in SYSOUT or CONSOLE
Christian,
For development and testing, I use COBOL's DISPLAY which writes to CICS' CEEMSG log, not SYSOUT,. It is sometimes helpful to also write a brief description of true errors.
Use judiciously, as you can fill up the log pretty quickly.
DISPLAY "The SELECT statement in " paragraph_name " returned an SQLCODE = -511"
Cheers,
Jon Butler
Original Message:
Sent: 8/21/2023 1:17:00 PM
From: Christian Gonzalez
Subject: RE: CICS program to display in SYSOUT or CONSOLE
Thanks for the reply Scott. I came across the restrictions after I posted this, so that was insightful. I was able to produce a message in the SYSLOG using EXEC CICS WRITE OPERATOR.
------------------------------
Christian Gonzalez
Original Message:
Sent: Mon August 21, 2023 01:01 PM
From: Scott Fagen
Subject: CICS program to display in SYSOUT or CONSOLE
I'm sure there are folks with far more experience and knowledge on this than me, but here's a starting point for you:
First, you shouldn't use DISPLAY in a CICS-COBOL program. See Functions and statements that cannot be used.
Second, you may be able to use something like EXEC CICS WRITE OPERATOR to get a message to the operator console and SYSLOG.
Scott
------------------------------
Scott Fagen
Mainframe Evangelist
CDW
www.cdw.com/content/cdw/en/solutions/ibm-zsystems.html
Original Message:
Sent: Fri August 18, 2023 02:54 PM
From: Christian Gonzalez
Subject: CICS program to display in SYSOUT or CONSOLE
Hello,
I have little COBOL experience but I'm trying to write a program that will connect the CICS region to MQ when it gets disconnected. The program is ran via a transaction which is triggered via a policy. I would like to display a message in the syslog, console, or sysout so that automation can notify us that the attempt was made.
EXEC CICS SET MQCONN
CONNECTED
END-EXEC.
I have tried the following and can't seem to find it anywhere. Any ideas or places I should look to?
DISPLAY ' ' UPON CONSOLE
DISPLAY ' ' UPON SYSOUT
DISPLAY 'RACQMQCN' mqconn-name 'CONNECTION ACQUIRE CG23'
------------------------------
Christian Gonzalez
------------------------------