|
|
![]() |
|
|
|
|
||
|
More on TCP/IP Printing Hey, Ted: I've been reading your articles on TCP/IP printing and I thought I'd pass on a tidbit of information that my shop recently received from Rochester support.
One of the nagging issues with TCP/IP printer support has been the lack of Page Range support for IP printers. This means that users cannot select a range of pages to print from their spool files. We have been using a shareware tool called Spool Tool to get around this. Spool Tool copies a range of pages and creates a new spool file, which can then be printed. It appears that IBM has stepped up to the plate and offers a utility that enables page range support via the native commands. IBM sent us a save file containing the compiled utility, which we restored to QGPL. We then changed the OUTQ description for our IP printers as described in the attached document. It works great! Perhaps you can apply your editorial magic to this information and pass it along to your readers. Thanks for all the great information you share with the readers of Midrange Guru. The Qshell stuff is really helpful for those of us being dragged kicking and screaming into the eunuch's world. (Our AIX boxes now outnumber our AS/400s two to one.) -- Cliff Kelley Thanks for sharing the save file with other readers of the Midrange Gurua, Cliff. Readers, please note that Guild Companies and I cannot vouch for this save file. Use it at your own risk. Caveat emptor. Your mileage may vary. The email Cliff received from IBM follows. -- Ted
Visit IBM online at: http://www.ibm.com/eserver/iseries/support
Functional Area: Print Product: OS/400 PRINT/SPOOL (5769SS1SP) Release: ALL Classification: Public Use Keywords:
Document Title:TSPRWPR Remote Writer Page Range Support Exit Program Note: This document previously was entitled Page Range Support on Remote Output Queue (LPR) The TSPRWPR exit program allows a user to have only a specific page range printed or sent via remote output queues (RMTOUTQs) that are configured with a connection type of *IP or using the LPR or SNDTCPSPLF commands. This page range support is provided only for *SCS or *AFPDS spooled files that are transformed to ASCII before being sent. The specific page range to use is extracted from the attributes for each spooled file at the time the file is printed or sent. This exit program can also be used on remote output queues that are configured with a connection type of *IP to provide the same page range function. This exit program also serves the purpose of providing an example of a Writer Transform Exit, as it is written to the Writer Transform Exit interface as documented in the AS/400 System API Reference manual. This exit program was introduced in the R420 version of QUSRTOOL, but will work with R370, R410 and later versions of OS/400. This tool is supplied as is without support. Therefore, any assistance with configuring or a remote output queue (RMTOUTQ) that uses the TSPRWPR utility must be done through Consult Line/400. The following methods can be used to get the TSPRWPR utility on your OS/400:
Note: This document contains a new version of the TSPRWPR utility, dated 06/20/2002, that corrects a problem where the writer will fail with message CPF6DF9--Transformed data buffer too small, when printing a large spooled file containing image data and the Page range to print (PAGERANGE) parameter is set to "1 *END" (so the entire spooled file is to be printed). It is recommended that the TSPRWPR utility be restored from the attached save file using the instructions in the section entitled Getting the Remote Writer Page Range (TSPRWPR) Utility from the Attached Save File. However, the TSPRWPR source code can be edited and the TSPRWPR program recompiled using the instructions in the section entitled Getting the Remote Writer Page Range (TSPRWPR) Utility from the QUSRTOOL Library. Getting the Remote Writer Page Range (TSPRWPR) Utility from the Attached Save File To restore the TSPRWPR utility from the attached save file, a save file must be created on the OS/400. Detach the save file from this document and upload the file to the S/400 using FTP from an MS-DOS prompt. Then, restore the objects. The resulting PAGRANGE save file contains the following objects: |------------+------------+------------+------------+---------| |Object |Type |Attribute |Owner |Size | |------------+------------+------------+------------+---------| |TSPRWPR |*PGM |CLE |QSYS |188416 | |------------+------------+------------+------------+---------| |TSPRWPR |*MODULE |CLE |QSYS |180224 | |------------+------------+------------+------------+---------| |QATTCL |*FILE |PF |QSYS |45056 | |------------+------------+------------+------------+---------| |QATTINFO |*FILE |PF |QSYS |24576 | |------------+------------+------------+------------+---------| |QATTSYSC |*FILE |PF |QSYS |376832 | |------------+------------+------------+------------+---------| Additionally, the QATTCL, QATTINFO, and QATTSYSC source physical files contain the following members: |------------+----------+------+------------------------------| |File |Member |Type | Text | |------------+----------+------+------------------------------| |QATTCL |TSPRWPRC |CLP | Create Remote Writer | | | | | Page Range Example Program | |------------+----------+------+------------------------------| |QATTCL |TSPRWPRD |CLP | Delete Writer Exit | | | | | Example Program Objects | |------------+----------+------+------------------------------| |QATTINFO |TSPRWPRI |TXT | Remote Writer Page | | | | | Range Support Program | |------------+----------+------+------------------------------| |QATTSYSC |TSPRWPR |C | Remote Writer Page | | | | | Range Support Program | |------------+----------+------+------------------------------| (See attached file: pagrange.savf .) Use the following steps to create a save file on the iSeries or AS/400 system, detach or download the PAGRANGE.SAVF file to a PC, upload the file to the iSeries or AS/400 system using FTP and then restore the objects to the QGPL library:
Getting the Remote Writer Page Range (TSPRWPR) Utility from the QUSRTOOL Library The source code for the remote writer page range utility is in member TSPRWPR in the QATTSYSC file (which is available in the R420 version of the QUSRTOOL library) and instructions for compiling the source code are in member TSPRWPRI in the QATTINFO file (which is also available in the R420 version of the QUSRTOOL library). There are a couple of defects in the TSPRWPR source code that may cause problems when printing OS/400 spooled files through a Remote Output Queue (RMTOUTQ) that is configured to use the TSPRWPR utility. These defects are described below. To avoid these defects completely, use the attached save file instead. For instructions on using the save file, refer to the section entitled Getting the Remote Writer Page Range (TSPRWPR) Utility from the Attached Save File above. Entire Spooled File Prints when Starting Page is Set to 1 There is a defect in the source code that will cause an entire spooled file to be printed if the page range starts with page 1, even when the ending page is something other than *END. To correct this defect, search for the following string in the TSPRWPR source member:
if (XFrmXtInfo->StartPage != PRT_WHOLE_FILE)
and then change it to the following:
if ((XFrmXtInfo->StartPage != PRT_WHOLE_FILE) ||
(XFrmXtInfo->EndPage != LAST_PAGE))
Note: This defect has been fixed in the TSPRWPR source code and program that are contained in the attached save file, so if the attachment is used then this is not a concern. However, the source code should be changed if you will be using the TSPRWPR source code that is included in the QUSRTOOL library on your iSeries or AS/400 system and compiling it yourself using the ILE-C compiler. Writer Fails with Message CPF6DF9 on Large SPLFs Containing Image Data There is another defect in the source code that will cause the writer to fail with message CPF6DF9--Transformed data buffer too small, when printing a large spooled file containing image data and the Page range to print (PAGERANGE) parameter is set to "1 *END" (so the entire spooled file is to be printed). This problem can be circumvented by changing the attributes of the spooled file to set the Save spooled file (SAVE) parameter to *YES and then printing the spooled file in two pieces. For example, to print a 1000 page spooled file, set the PAGERANGE parameter to "1 500" to print the first half of the spooled file, then set the PAGERANGE parameter to "501 *END" and release the spooled file again to print the second half of the spooled file. The problem was caused by trying to read the entire spooled file in a single buffer. The spooled file contained over a thousand pages of image data, so calling Host Print Transform (HPT) single buffer caused the data returned to exceed the size of the buffer. To correct this defect, search for the following lines in the TSPRWPR source member and delete them:
if ((XFrmXtInfo->StartPage != PRT_WHOLE_FILE) ||
(XFrmXtInfo->EndPage != LAST_PAGE))
{
then search for the following lines in the TSPRWPR source member and delete them as well:
}/* End if Page range is being processed. */
else
{
XFrmXtInfo->Pass_Input_Data = PASS_SPLF_DATA;
}/* Transform will not be reading spooled file data. */
This will cause the TSPRWPR utility to read the spooled file 1 buffer at a time, rather than try to read the entire spooled file in a single buffer. Note: This defect has been fixed in the TSPRWPR source code and program that are contained in the attached save file, so if the attachment is used then this is not a concern. However, the source code should be changed if you will be using the TSPRWPR source code that is included in the QUSRTOOL library on your iSeries or AS/400 system and compiling it yourself using the ILE-C compiler. Limitations of the Remote Writer Page Range (TSPRWPR) Utility The TSPRWPR exit program uses several APIs that access the spooled files being sent. Because of this, it must have sufficient authority to the output queue that the spooled file is on, the library that the output queue is in, and the spooled file itself. See the System API Reference manual under the QSPOPNSP API for the level of authority needed. One possible way of insuring this exit program has authority to process all spooled files is to use the Change Program (CHGPGM) CL command to change the program to adopt its owners authority and to use the Edit Object Authority (EDTOBJAUT) command to verify that program is owned by a user profile that has sufficient authority, such as QSYS. Using the TSPRWPR Utility with an Existing Remote Output Queue For remote output queues with a connection type of *IP, specify the name (TSPRWPR) and library for the User Data Transform parameter in the output queue description and turn off Host Print Transform. To change an existing remote output queue, type the following commands on the OS/400 command line. Press the Enter key after each command: ENDWTR WTR(output-queue) OPTION(*IMMED) CHGOUTQ OUTQ(output-queue-library/output-queue) TRANSFORM(*NO) + USRDTATFM(QGPL/TSPRWPR) MFRTYPMDL(*SAME) WSCST(*SAME) Note: The output queue description's Manufacturer type and model (MFRTYPMDL) and Workstation customizing object (WSCST) parameters will still be used, but the remote writer will no longer call Host Print Transform (HPT) directly to convert the OS/400 spooled file to an ASCII printer data stream. The remote writer will call the TSPRWPR program, and the TSPRWPR program will call Host Print Transform (HPT) to convert only the pages specified in the Page range to print (PAGERANGE) parameter in the attributes for each spooled file.
|
Editors
Contact the Editors |
|
Last Updated: 8/23/02 Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved. All content published in Guild Companies publications is for informational purposes only, and accuracy of said content is not guaranteed by Guild Companies and its staff. Guild Companies and its staff do not warrant that its content is error-free. Also, Guild Companies and its staff are not responsible for the availability or content accuracy of other Web sites and services that may be linked to this Web site and service. |