Using BMS facility

Top  Previous  Next

The first method to print data under XCICS is to use BMS commands (SEND, SEND TEXT, SEND MAP, etc.) in a transaction started on a terminal defined as "printer" in the XCICS configuration file (xcics.conf).

This transaction, once started, will issue BMS commands to write the print file, which is a standard UNIX flat file containing control characters as new-line, carriage-return an new-page.

This file is temporary stored in the path defined in the configuration parameter spool_path.

When transaction completes XCICS will provide to spool the generated file through the command specified in the configuration parameter print_command.

The print_command is  a user defined script/executable which takes care of forwarding the file to the printing subsystem or to do whatever the user needs.

XCICS invokes the print_command providing the following arguments:

1.the absolute path name of the printout file
2.the device name of the printer terminal which generated the printing
3.the transaction name of the transaction which generated the printing

An example

We suppose to have an XCICS printer terminal named PRT0 and a print_command named tplp.

The xcics.conf will contain the following lines:

define terminal name=PRT0, type=printer, device=PRINTER0;
set print_command=$HOME/bin/tplp
set spool_path=$HOME/tmp

When the transaction started on PRT0 completes its work, XCICS will issue the command:

$HOME/bin/tplp $HOME/tmp/PRT0_<PID>.dat PRT0 PRINTER0

The "tplp" script could be defined as follow (an example):

#!/bin/ksh
#
# example printing shell which
# assumes that every XCICS terminal has
# a corresponding lp class with the same name
#
filename=$1
terminal_name=$2
transid=$3
lp -d $terminal_name $filename