This article describes what is needed to print from CICS in Enterprise Server MTO on UNIX platforms.
Problem:
What configuration changes are needed to support printing from CICS in Enterprise Server Mainframe Transaction Option (MTO) on a UNIX platform?
Resolution:
There are two approaches that can be taken to enable printing from CICS in Enterprise Server MTO, depending on whether a single printer or multiple printers are required per server. For both approaches you must define a TN3270 printer terminal device. Instructions on how to do this can be found in the Micro Focus Server product documentation. By default a printer called L860 is defined.
To use a single printer for a server you must edit the CICS SIT to check the 3270 Print box and enter something in Print Destination. The actual contents of Print Destination do not matter as on UNIX the destination is defined by an environment variable named dd_LPT1.
Whether configuring the server for a single printer or multiple printers, each printer must be available to the UNIX system and must have a print queue defined via lpadmin or similar. (see sit.jpg for diagram)
The final configuration change to enable a single printer is to set the dd_LPT1 environment variable. This is best done in the Configuration Information box of the tab. (see config.jpg for diagram)
The ts-1320n is a print queue defined in UNIX which can be printed to from the command line using the lp or lpr commands. If printer escape sequences are included in the text being sent to the print then use the lpr command with the –l option, for example, dd_LPT1=|lpr –l –P ts1320n.
To use multiple printers you must define a TN3270 printer terminal for each printer and use a printer exit program to handle the printing. The printer exit must be named dfhuprnt. An example dfhuprnt.cbl and its copybook are attached in dfhuprint.zip. For each printer you must define a TN3270 printer terminal and have an entry in the ws-prt-table in dfhuprint.cbl as follows:
01 ws-prt-table.
pw-331* 03 pic x(78-prt-ID) value 'LPT1'.
03 pic x(78-prt-ID) value 'L860'.
03 pic x(78-prt-dest) value 'ts-1320n'.
In the code example above, terminal L860 is defined with a destination of ts-1320n which, like the single printer setup, is a UNIX print queue. By default Enterprise Server MTO is shipped with a version of dfhuprnt.so which disables the printer exit. To enable CICS printing this default version must either be removed from $COBDIR/lib or replaced with a modified version.
The example printer exit can be compiled without any special compiler directives and must be in a directory specified in the CICS transaction path. If compiled to shared object it must be on the library path (LIBPATH, SHLIB_PATH or LD_LIBRARY_PATH depending upon the UNIX platform).
Incident Number:
Attachments
#MFDS
#EnterpriseDeveloper