You can code a CICS program to do a XCTL to program DCCOCPR to issue a DBOC command and get the output in the DBOCPRT file.
You can call DCCOCPR for DBOC or DCCECPR for a DBEC command. When calling these programs the CICS COMM area contains the DBOC or DBEC command that you would normally type on the terminal. Define it like this:
02 COMM-AREA-ID PIC X(05) VALUE 'DBOC '.
02 COMM-AREA-COMMAND PIC X(75) VALUE SPACES.
02 COMM-AREA-RTNCDE PIC X(02) VALUE SPACES.
For example, to issue a DBOC INQ=CODES you would code this:
MOVE 'INQ=CODES' TO COMM-AREA-COMMAND.