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.
>>DEFINE DEBUG AS PARAMETER
>>IF DEBUG IS NOT DEFINED
>>DEFINE DEBUG AS 0
>>END-IF
...
>>IF DEBUG > 0
DISPLAY "Hello from a test message."
>>END-IF
Bernie
Conditional Compilation
------------------------------
Bernie Rataj
Technical Support Professional
IBM Canada Ltd.
Markham ON Canada
https://www.ibm.com/products/cobol-compiler-zoshttps://www.ibm.com/products/pli-compiler-zos------------------------------
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