Printing with transient data
The second method for creating the print task involves transient data. A CICS intrapartition transient data queue can be defined to have a property called a trigger. When the number of items on a queue with a trigger reaches the trigger value, CICS creates a transaction to process the queue.
About this task
The queue definition tells CICS what transaction this task executes and what terminal, if any, it requires as its principal facility.
You can use this mechanism to get print data from the task that generates it to a task that owns the printer. A transient data queue is defined for each printer where you direct output in this way. A task that wants to print puts its output on the queue associated with the required printer (using WRITEQ TD commands). When enough items are on the queue and the printer is available, CICS creates a task to process the queue. (For this purpose, the trigger level of enough
is typically defined as just one item.) The triggered task retrieves the output from the queue (with READQ TD commands) and writes it to its principal facility (the printer), with SEND, SEND MAP, or SEND TEXT commands.
As in the case of a STARTed printer task, you have to provide the program executed by the task that gets triggered. The sample programs distributed with CICS contain a complete example of such a program, called the order queue print sample program
. Samples describes this program in detail.