Print Text for OnDemand (PRTTXTOND)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The Print Text for OnDemand (PRTTXTOND) command allows you to print all or part of a spooled file in a text-only format. This allows the report administrator to see what the report looks like to ADDRPTOND when it is indexed. Using this output, the administrator can determine how to index the report.

Top

Parameters

Keyword Description Choices Notes
SPLF Spooled file Name Required, Positional 1
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 1-999999, *ONLY, *LAST, *ANY Optional
JOBSYSNAME Job system name Name, *ONLY, *CURRENT, *ANY Optional
CRTDATE Spool file created Single values: *ONLY, *LAST
Other values: Element list
Optional
Element 1: Creation date Date
Element 2: Creation time Time, *ONLY, *LAST
PAGERANGE Page range to print Element list Optional
Element 1: Starting page Integer, 1
Element 2: Ending page Integer, 10, *END
SBMJOB Submit to batch *YES, *NO Optional
JOBD Job description Qualified object name Optional
Qualifier 1: Job description Name, QOND400
Qualifier 2: Library Name, QRDARS, *LIBL, *CURLIB
STMF Stream file Path name, *NONE Optional
REPLACE Replace object *NO, *YES Optional
Top

Spooled file (SPLF)

Specifies the name of the spooled file to use as input to OnDemand. This is the file name that was specified by the user program when the file was created, or the name of the device file used to create this file.

This is a required parameter.

Top

Job name (JOB)

Specifies the name of the job which created the spooled file.

*
The job that issued this command is the job that created the spooled file.
job-name
Specify the name of the job to use. If no job qualifier is given, all of the jobs currently in the system are searched for the simple job name. If duplicates of the specified name are found, a list of messages containing the qualified job names of all duplicates is displayed.
user-name
Specify the user profile name that ran the job.
number
Specify the job number assigned by the system.
Top

Spooled file number (SPLNBR)

Specifies, by number, which of the job's spooled files is printed.

*ONLY
Only one spooled file in the job has the specified file name; therefore, the number of the spooled file is not necessary.
*LAST
The spooled file with the highest number and the specified file name is used.
*ANY
The spooled file number is not used to determine which spooled file is used. Use this value when the job system name parameter or the spooled file create date and time parameter is to take precedence over the spooled file number when selecting a spooled file.
spooled-file-number
Specify the number of the spooled file having the specified file name to use.
Top

Job system name (JOBSYSNAME)

Specifies the name of the system where the job that created the spooled file (JOB parameter) ran. This parameter is considered after the job name, user name, job number, spooled file name, and spooled file number parameter requirements have been met.

*ONLY
There is one spooled file with the specified job name, user name, job number, spooled file name, spooled file number, and spooled file create date and time.
*CURRENT
The spooled file created on the current system with the specified job name, user name, job number, spooled file name, spooled file number, and create date and time is used.
*ANY
The job system name is not used to determine which spooled file is used. Use this value when the spooled file create date and time parameter is to take precedence over the job system name when selecting a spooled file.
job-system-name
Specify the name of the system where the job that created the spooled file ran.
Top

Spool file created (CRTDATE)

Specifies the date and time the spooled file was created. 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.

The possible single values are:

*ONLY
There is 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 create date and time of the specified job name, user name, job number, spooled file name, spooled file number, and job system name is used.

The possible create date value is:

spooled-file-create-date
Specify the date the spooled file was created.

The possible create time values are:

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

Page range to print (PAGERANGE)

Specifies the starting and ending pages to print.

Element 1: Starting page

1
Start at page 1 of the report.
starting-page-number
Specify the starting page to print.

Element 2: Ending page

10
End printing at the tenth page.
*END
Printing continues until the last page is printed.
ending-page-number
Specify the last page to print.
Top

Submit to batch (SBMJOB)

Specify if you want to print the specified data interactively or in a batch job.

*YES
This command should be submitted to run in a different job.
*NO
This command should be run within the current job. If you are entering this command from a terminal, this will prevent you from doing any other work from this terminal session until this command completes.
Top

Job description (JOBD)

Specifies the name of the job description used for the submitted job.

Qualifier 1: Job description

QOND400
The QOND400 job description is used as the job description for the submitted job.
name
Specify the name (name/name) of the job description used for the job.

Qualifier 2: Library

QRDARS
Library QRDARS is used as the job description's 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 used to locate the job description name. If no library is specified as the current library for the job, QGPL is used.
name
Specify the name of the library where the job description name is located.
Top

Stream file (STMF)

Specifies the path to the stream file to contain the output data.

*NONE
Output is directed to the spooled file QPRLMTXT.
path-name
Specifies the path to the stream file to contain the output data.
Top

Replace object (REPLACE)

Specifies whether the output operation replaces or fails to copy the records to the stream file if the stream file with the specified name already exists. If the stream file does not exist, it is created.

*NO
No records are output and an error condition is created.
*YES
The records replace the existing stream file records.
Top

Examples

Example 1: Simple Example

PRTTXTOND SPLF(CKSTMTPRTF)

This command submits a job to batch to print a text-only version of the first ten pages of the CKSTMTPRTF spooled file that was generated in the current job. (This function is of particular value to aid in indexing AFP (Advanced Function Presentation) spooled files.)

Example 2: More Complex Example

PRTTXTOND SPLF(CKSTMTPRTF) JOB(123456/OPERATOR/NIGHTBATCH)
            SPLNBR(*LAST)STMF('/MYDIR/MYOUTPUT.TXT')

This command is similar to Example 1 but specifies a particular job and spooled file number (*LAST) for the spooled file as well as a stream file to receive the output.

Top

Error messages

*ESCAPE Messages

CPF3342
Job &5/&4/&3 not found.
CPF3343
Duplicate job names found.
CPF3344
File &1 number &8 no longer in the system.
CPF3492
Not authorized to spooled file.
CPF3C40
Spooled file &4 not found.
Top