Send TCP/IP Spooled File (SNDTCPSPLF)

The Send TCP/IP Spooled File (SNDTCPSPLF) command sends a spooled file to be printed on a remote system. The remote system must be running TCP/IP. The SNDTCPSPLF command is the IBM i version of the TCP/IP LPR (Line Printer Requester) command.

Parameters

Keyword Description Choices Notes
RMTSYS Remote system Character value, *INTNETADR Required, Positional 1
PRTQ Printer queue Character value Required, Positional 2
FILE Spooled file Name Required, Positional 3
JOB Job name Single values: *
Other values: Qualified job name
Optional
Qualifier 1: Job name Name
Qualifier 2: User Name
Qualifier 3: Number 000000-999999
SPLNBR Spooled file number 0-999999, *ONLY, *LAST, *ANY Optional
JOBSYSNAME Job system name Name, *ONLY, *CURRENT, *ANY Optional
CRTDATE Spooled file created Single values: *ONLY, *LAST
Other values: Element list
Optional
Element 1: Creation date Date
Element 2: Creation time Time, *ONLY, *LAST
DESTTYP Destination type *AS400, *PSF2, *OTHER Optional
TRANSFORM Transform SCS to ASCII *YES, *NO Optional
USRDTATFM User data transform Single values: *NONE
Other values: Qualified object name
Optional
Qualifier 1: User data transform Name
Qualifier 2: Library Name, *LIBL, *CURLIB
MFRTYPMDL Manufacturer type and model Character value, *IBM42011 Optional
INTNETADR Internet address Character value Optional
WSCST Workstation customizing object Single values: *NONE
Other values: Qualified object name
Optional
Qualifier 1: Workstation customizing object Name
Qualifier 2: Library Name, *LIBL, *CURLIB
DLTSPLF Delete file after sending *NO, *YES Optional
DESTOPT Destination-dependent options Character value Optional
SEPPAGE Print separator page *NO, *YES Optional

Remote system (RMTSYS)

Specifies the remote system name to which the print request is sent.

To be successful, the name must be valid, and the system must be able to communicate with the local system. You can assign names to an internet address. Use the Work with TCP/IP host table entries option on the Configure TCP/IP menu (CFGTCP command). A remote name server also maps remote system names to internet addresses. You can use the Change remote name server option on the CFGTCP menu to specify a remote name server.

*INTNETADR
The value of the INTNETADR parameter is used.
character-value
Specify the remote system name to which the print request is sent.

Printer queue (PRTQ)

Specifies the destination printer queue to be used.

character-value
Specify the name of the destination printer queue to be used. For destination systems that are IBM i systems, this is the name of an output queue to which the spooled file is sent.

If a library name qualifier is not specified, the library list of the sending user ID on the destination system is searched. If not found or not authorized, QGPL/QPRINT is used as the default. The output queue is usually specified as library name/output queue name (for example, QGPL/OUTQ1). For destination systems that are not IBM i systems, this name is system-dependent. This name can be either the actual name of the device or the name of a printer queue for the device. The name used for the OS/2 operating system is the actual name of the device. Often, the name used for the UNIX operating system is the name of the printer queue for the device. This parameter is limited to 128 characters.

Note: On some systems, the printer queue name may be case sensitive. To preserve the lowercase letters in a printer queue name, enclose the printer queue name in apostrophes 'MyPrtQ'.

Spooled file (FILE)

Specifies the spooled file that is sent to the specified system and printer. The file name is the same file name that is displayed with the Work with Spooled File (WRKSPLF) command.

name
Specify the name of the spooled file to be sent.

Job name (JOB)

Specifies the job that created the spooled file to be sent.

Single values

*
The job that issued this command is the job that created the spooled file.

Qualifier 1: Job name

name
Specify the name of the job that created the spooled file.

Qualifier 2: User

name
Specify the user name of the job that created the spooled file.

Qualifier 3: Number

000000-999999
Specify the job number of the job that created the spooled file.

Note: If no job number or user name is given, all jobs currently running on the system are searched for a match against the job name.

Spooled file number (SPLNBR)

Specifies the number of the spooled file from the job whose data records are to be sent.

*ONLY
One spooled file from the job has the specified file name. The number of the spooled file is not necessary. If *ONLY is specified and more than one spooled file has the specified file name, an error message is sent.
*LAST
The spooled file with the highest number and the specified file name is used.
0-999999
Specify the number of the spooled file having the specified file name whose data records are to be sent.

Job system name (JOBSYSNAME)

Specifies the system from which the job that created the spooled file was ran on.

*ONLY
One spooled file from the job with the specified job name, user name, job number, spooled file create date and spooled file create time. If *ONLY is specified and more than one spooled file has the specified information listed above, an error message is sent.
*CURRENT
The job on the current system with the specified job name, user name, job number, spooled file create date and spooled file create time.
name
Specify the name of the system where the job ran that created the spooled file.

Spooled file created (CRTDATE)

Specifies the date the spooled file was created on the system. This parameter is considered after the job name, user name, job number, spooled file name, spooled file number, and job system name parameter requirements have been met.

Single values

*ONLY
There is only one spooled file with the specified job name, user name, job number, spooled file name, spooled file number, and job system name.
*LAST
The spooled file with the latest date and time which also has the specified job name, user name, job number, spooled file name, spooled file number, and job system name is used.

Element 1: Creation date

date
Specify the date the spooled file was created.

Element 2: Creation time

The spooled file create time is the time the spooled file was created on the system. This parameter must have a value set if a date is specified for the first element of this parameter. This create time is considered after the job name, user name, job number, spooled file name, spooled file number, job system name, and spooled file create date requirements have been met.

*ONLY
There is only one spooled file with the specified job name, user name, job number, spooled file name, spooled file number, job system name, and create date.
*LAST
The spooled file with the latest time which also has the specified job name, user name, job number, spooled file name, spooled file number, job system name, and create date is used.
time
Specify the time the spooled file was created.

Destination type (DESTTYP)

Specifies the type of destination system to which the spooled file is being sent. This information allows the SNDTCPSPLF command to send the file in a format that is most likely to be received and processed correctly on the destination system. When sending to another IBM i system, this parameter should be *AS400.

*OTHER
The destination system is not an IBM i system and is not using Print Services Facility/2.
*AS400
The destination system is an IBM i system. If TRANSFORM(*NO) is specified, a duplicate of the spooled file is created on the destination system. If the spooled file is *SCS or *AFPDS and TRANSFORM(*YES) is specified, the spooled file is transformed to ASCII and spooled as *USERASCII on the destination IBM i system.
*PSF2
The destination system is using Print Services Facility/2. This destination system can receive both ASCII data and Advanced Function Printer data stream (AFPDS) data. This means that in addition to sending ASCII data to a PSF/2, you can also send a spooled file of device type *AFPDS. When sending *AFPDS files, you must consider any external resources of the file. These resources, such as fonts and overlays, must also reside on the destination system to allow the file to print correctly.

Transform SCS to ASCII (TRANSFORM)

Specifies whether or not to make use of the host print transform function to transform a SNA character string (SCS) or Advanced Function Printing data stream (AFPDS) into ASCII data.

Note: If you specify TRANSFORM(*YES), you cannot use the USRDTATFM parameter.

*YES
Use the host print transform.
*NO
Do not use the host print transform.

User data transform (USRDTATFM)

Specifies the program that is used to transform the spooled file data. User data transform programs must be written to the Writer Transform Exit Program interface. For information on this interface, see the APIs topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.

Single values

*NONE
No data transform program is specified.

Qualifier 1: User data transform

name
Specify the name of the data transform program.

Qualifier 2: Library

*LIBL
All libraries in the job's library list are searched until the first match is found.
*CURLIB
The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
name
Specify the name of the library to be searched.

Manufacturer type and model (MFRTYPMDL)

Specifies the manufacturer, type, and model for a printer using the host print transform function.

If the Workstation customizing object (WSCST) parameter is used in conjunction with the MFRTYPMDL parameter, information that is specified in the workstation customization object takes precedence over the MFRTYPMDL parameter.

*IBM42011
The IBM 4201-1 Proprinter is used.
manufacturer-type-model
Specify the manufacturer, type, and model for a printer using the host print transform function. Specify one of the values that matches the device. Refer to the MFRTYPMDL parameter documentation for the Create Device Description (Printer) (CRTDEVPRT) command for a description of possible values.
*WSCST
The value of the WSCST parameter is used.

Internet address (INTNETADR)

Specifies the internet address of the remote system to which the print request is sent.

This parameter is accessed by entering *INTNETADR for the RMTSYS parameter or by leaving the RMTSYS parameter blank and pressing the Enter key.

character-value
Specify the internet address of the remote system. The internet address is specified in the form, nnn.nnn.nnn.nnn, where nnn is a decimal number ranging from 0 through 255. An internet address is not valid if it has a value of all binary ones or all binary zeros for the network identifier (ID) portion or the host ID portion of the address. If the internet address is entered from a command line, the address must be enclosed in apostrophes.

Workstation customizing object (WSCST)

Specifies an object that consists of a table of attributes used to customize a given ASCII device, such as a workstation or printer. Character presentation, font specifications, and control key sequences are examples of characteristics that can be customized.

If the Manufacturer type and model (MFRTYPMDL) parameter is used in conjunction with the WSCST parameter, information that is specified in the workstation customization object takes precedence over the MFRTYPMDL parameter.

Single values

*NONE
Do not specify a workstation customizing object.

Qualifier 1: Workstation customizing object

name
Specify the name of a workstation customizing object that was created with the Create Work Station Customizing Object (CRTWSCST) command.

Qualifier 2: Library

*LIBL
All libraries in the user and system portions of the job's library list are searched until the first match is found.
*CURLIB
The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
name
Specify the name of the library to be searched.

Delete file after sending (DLTSPLF)

Specifies whether or not to delete the specified spooled file after it has been successfully sent. No guarantee can be made as to the correct printing of the sent file. Only correct transmission can be verified.

*NO
Do not delete the spooled file after it has been successfully sent.
*YES
Delete the spooled file after it has been successfully sent.

Destination-dependent options (DESTOPT)

Specifies the destination-dependent options. These options may be specific to a particular implementation of an LPD print server. When this parameter is not specified, the SNDTCPSPLF command sends default options that are common to all LPD print servers. The options specified by this parameter are inserted into the control file generated by the SNDTCPSPLF command, one option per line, and sent to the specified LPD print server. The options specified by this parameter must have the following format:

"option1 option2 option3...optionN"

where each option is separated from the next by one or more blanks.

Options typically have a format of <control characters><value>. An example is

 "-oTITLE=LPR"

where "-o" are the control characters and "TITLE=LPR" is the value. SNDTCPSPLF examines the first character of each option to determine if it is a reserved control character. The following control characters cannot be specified as their values are determined by SNDTCPSPLF. If any of the following control characters are specified, the option is ignored and a warning message is generated.

C    T
H    U
I    W
L    1
M    2
N    3
P    4
S    k

For example, "Class=ASCII" is not allowed because the "C" control character is reserved for use by the SNDTCPSPLF command. However, "-Class=ASCII" is permitted.

The control character "X" is allowed, but the value of "AS/400" used with it is not permitted. For example, "XMyLPD" can be specified, but "XAS/400" cannot be. The option "XAS/400" is reserved for use by the SNDTCPSPLF command. It is used to indicate to another IBM i system that the request is coming from an IBM i system.

The option "XAIX" controls how multiple copies are sent to the printer. This option specifies that the data and control files are to be sent multiple times, once for each copy. The default is to send the data and control files once, with multiple print commands in the control file.

The following print "filters" are supported by SNDTCPSPLF (see section 7 of RFC 1179):

c    n
d    p
f    r
g    t
l    v

If one of these characters is specified as the first character in a destination option, the character is used on the "print file" command in the control file. Only the first occurrence of one of these characters in this position is used in the control file. Subsequent use of these characters in this position is ignored. If none of these options is specified, the default character "l" is used on the "print file" command, which prints the file "as is" without filtering out any control characters.

If "J" is specified as the first character of a destination option, the remaining characters in the option are used to override the default job name for the banner page (see RFC 1179, section 7.4). For instance, to specify a job name of /nff, specify:

   DESTOPT('J/nff')

Only the first occurrence of this option is used to override the job name. If this option is not specified, the spooled file name is used as the job name (the default).

You can enable an auto-queue option by using the destination dependent option XAUTOQ on the SNDTCPSPLF command (or on the CRTOUTQ or CHGOUTQ commands). When you use the auto-queue option, files are sent as before unless the remote system times out during the transform. If this happens, the transformed spool files are sent back to the same output queue using the IBM i LPD server. When a remote writer is running, it will then send the transformed spooled file to the remote system.

character-value
Specify the destination-dependent options.

Print separator page (SEPPAGE)

Specifies whether or not a separator page is requested when the spooled file is printed on the remote system.

Note: A separator page may not be printed in all cases. Printing of separator pages depends on whether the LPD implementation on the receiving system honors the separator page request. Some LPD implementations ignore the SEPPAGE parameter and print or do not print a separator page by default.

*YES
Request a separator page.
*NO
Do not request a separator page.

Examples

None

Error messages

*ESCAPE Messages

TCP3701
Send request failed for spooled file &1.
TCP3702
Not authorized to spooled file &1.
TCP3703
Send request failed. Spooled file &1 open.
TCP3704
Send request failed. Spooled file &1 not spooled print file.
TCP3705
Spooled file &1 not transformed.
TCP3706
Spooled file &1 not transformed.
TCP3715
Not authorized to delete spooled file &1. The spooled file was sent.