DB2 Server for VSE & VM: Interactive SQL Guide and Reference

PRINT



            .----------------------------.
            V                            |
>>-PRInt-------+----------------------+--+---------------------><
               |        .-?---------. |
               +-CLAss--+-character-+-+
               |         .-1-------.  |
               +-COPies--+-integer-+--+
               +-TERMid--termid-------+
               +-DESTid--wkstat-------+
               +-SYStem---------------+
               '-TOUSER--+--------+---'
                         '-userid-'
 
DB2 Server for VSE

PRINT is an ISQL display command that requests printed copies of a query result by sending it to the system printer, POWER remote printer, or CICS/VSE terminal.

DB2 Server for VM

PRINT is an ISQL display command that requests printed copies of a query result by sending it to the system printer.

The data that is printed is based on the query result obtained by the SELECT statement.

All the rows of the query result, as modified by FORMAT commands, are printed regardless of the position of your display of the result. A query result that is longer than what can be viewed on one display, can be printed with one PRINT command. The printed report starts with the column and the character position within the column that is at the left edge of the display when the PRINT command is typed. The number of characters of each row that is printed depends on the setting of the PAGESIZE WIDTH value specified by the SET command. You receive a message if the width of the row of data exceeds the WIDTH setting.

The output class to use can be obtained from the people responsible for data processing at your location.
DB2 Server for VSE

Note:CLASS and COPIES cannot be specified for a CICS/VSE terminal printer.

DB2 Server for VM

Note:You must use the CP TAG and CP SPOOL commands to direct printed output.

CLAss
specifies the output class.

character
is the output class desired. For DB2 Server for VSE, the output class can be a letter (A to Z).

For DB2 Server for VM, the CLASS value can be an integer (0 to 9) or a letter (A to Z). The default is class A.

? (DB2 Server for VSE only)
specifies that the default printer class of the system is to be used.

For DB2 Server for VSE, if CLASS is not included in the PRINT command at all, the current class set by the SET command is used. If no class has been set by a SET command, the default printer class for the system is used.

For DB2 Server for VM, there is no SET command for CLASS. You can set the CLASS value by a CP SPOOL command.

COPies
specifies the number of copies.

integer
is the number of copies desired. For DB2 Server for VSE, you can request up to 99 copies. For DB2 Server for VM, you can specify a COPIES value from 1 to 255.

If this keyword is not specified, one copy is the default unless otherwise determined by a SET command (in DB2 Server for VSE).
DB2 Server for VM

You can also use the CP SPOOL command to specify the number of copies. The value for copies that is specified on the CP SPOOL command remains in effect until another value is specified by another CP SPOOL command.
Note:If you specify the number of copies on the PRINT command after you specified it using a CP SPOOL command, the PRINT command quantity is used for that print operation. All following PRINT commands use the quantity specified by the CP SPOOL command, unless you specify it using the COPIES keyword.

Because you can reset your PF keys, you can assign the PRINT function to any PF key. The default function key is PF4 or PF16.

TERMid (DB2 Server for VSE only)
specifies that printed output is to be directed to the designated CICS/VSE terminal.

termid
is the terminal identifier of the CICS/VSE terminal that you want. termid must be from one to four alphanumeric characters.

DESTid (DB2 Server for VSE only)
specifies that the printed output is to be directed to the designated POWER remote workstation.

wkstat
is the ID of the desired remote workstation. wkstat can be any number from 0 to 250. When wkstat is 0, the printed output is to be directed to the system printer.

SYStem (DB2 Server for VSE only)
specifies that the printed output is to be directed to the system printer.

TOUSER (DB2 Server for VSE only)
specifies that the printed output is to be directed to a user identified by userid.

userid
is the VSE POWER user identifier of the user to whom the output is being spooled. An identifier cannot be longer than 8 alphanumeric characters.

If you enter the PRINT TOUSER command without specifying a userid, ISQL spools the output to the ISQL user ID used at time of log on.

The PRINT TOUSER nnn command has the same effect as the PRINT DESTid nnn command, where nnn is the ID of the remote workstation to which you want to direct your printed output. This ID can be any number from 1 to 250.

DB2 Server for VSE

Any TERM, DEST, or SYS indication on the PRINT command applies for that particular PRINT operation only.

The PRINT command can be started by pressing PF4.

Each printed page is numbered and dated at the top. A title is automatically provided at the top of each printed page. This title consists of the first 100 characters of the SELECT statement issued unless you specified your own title with an ISQL FORMAT command.

You can specify more than one keyword option on a single PRINT command. For example, the following command specifies both the class and number of copies:

   print copies 3 class a
DB2 Server for VM

If there is an error in the command, all valid changes are made until the mistake is determined. For example, in the following command, you type a $ sign instead of the letter a:

   print copies 3 class $

The command sets the number of print copies to 3. However, the class remains at the default class A, because $ is an incorrect output class. This output class error does not change the number of copies to the original value. Neither does the number of copies or the class change from their current settings if the following command is issued:

   print class $ copies 3

The output class value is again incorrect, so processing stops when this error is detected.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]