Here are the steps to use a printer managed outside CICS®:
For some printers managed outside CICS, you can format output with BMS, as we explain in Programming for non-CICS printers. However, for most printers, you need to meet the format requirements of the application that drives the printer. This may be the device format or an intermediate form dictated by the application. For conventional line printers, formatting is simply a matter of producing line images and, sometimes, adding carriage-control characters.
Print data is usually conveyed to an application outside of CICS by placing the data in an intermediate file, accessible to both CICS and the application. The type of file, as well as the format within the file, is dictated by the receiving application. It is usually one of those listed in the first column of Table 33. The second column of the table shows which groups of CICS commands you can use to create such data.
File type | Methods for writing the data |
---|---|
Spool files | CICS spool commands (SPOOLOPEN, SPOOLWRITE, etc.)
Transient data commands (WRITEQ TD) Terminal control and BMS commands (SEND, SEND MAP, etc.) |
BSAM | CICS spool commands (SPOOLOPEN, SPOOLWRITE, etc.)
Transient data commands (WRITEQ TD) |
VSAM | CICS file control commands (WRITE) |
DB2® | EXEC SQL commands |
IMS™ | EXEC DLI commands or CALL DLI statements |
If you are using VSAM, DB2, or IMS, the CICS application programming commands you can use are determined by the type of file you are using.
For BSAM and spool files, however, you have a choice. The CICS definition of the file (or its absence) determines which commands you use. The file may be:
Both transient data queue definitions and sequential terminal definitions point to an associated data definition (DD) statement in the CICS start-up JCL, and it is this DD statement that determines whether the file is a BSAM file or a spool file. Files created by CICS spool commands do not require definition before use and are spool files by definition.
If the printing application accepts BSAM or spool file input, there are several factors to consider in deciding how to define your file to CICS:
In contrast, a file created by a SPOOLOPEN can be written only by the task that created it. This eliminates the danger of interleaving output, but also prevents sharing the file among tasks.
A spool file associated with a sequential terminal can be written by only one task at a time (the task that has the terminal as its principal facility). This also prevents interleaving, but allows tasks to share the file serially.
A file that represents the output of a sequential terminal does not get closed automatically (and so does not get released for printing) until CICS shutdown, and CICS does not provide facilities to close it earlier. If you use a sequential terminal to pass data to a printer controlled outside of CICS, as you might do in order to use BMS, you should be aware of this limitation.
If you choose this option, remember that BMS always sends a page of output at a time, using the page size in the terminal definition, and that the data set representing the output from a sequential terminal is not released until CICS shutdown.
When you deliver the data to a print application outside CICS, you might need to notify the application that you have data ready to process. You do not need to do this if the application runs automatically and knows to look for your data. For example, to print on a printer owned by the MVS job entry system (JES), all you need to do is create a spool file with the proper routing information. JES does the rest.
However, sometimes you need to submit a job to do the processing, or otherwise signal an executing application that you have work for it.
To submit a batch job from a CICS task, you need to create a spool file which contains the JCL for the job, and you need to direct this file to the JES internal reader. You can create the file in any of the three ways listed for spool files in Table 33, although if you use a sequential terminal, the job does not execute until CICS shuts down, as noted earlier. For files written with spool commands, the information that routes the file to the JES internal reader is specified in the SPOOLOPEN command. For transient data queues and sequential terminals, the routing information appears on the first record in the file, the "JOB card".
The output to be printed can be embedded in the batch job (as its input) or it can be passed separately through any form of data storage that the job accepts.
[[ Contents Previous Page | Next Page Index ]]