STRDBRDR (Start Database Reader)

STRDBRDR Command syntax diagram

 

Purpose

The Start Database Reader (STRDBRDR) command starts a spooled reader to a database file. The reader reads a batch input stream from the database file and places the jobs onto one or more job queues. This command specifies the name of the database file and member from which the input stream is read, the name of the reader, and the names of the job queue and message queue that are used.

More than one reader can be active at the same time (as determined by the spooled subsystem description). Each database reader must have a unique reader name, and the specified file or member must be available. The reader can also be held or canceled if the Hold Reader (HLDRDR) or End Reader (ENDRDR) command is used.

Because each reader runs independent of the job that started it, users can continue doing other work on the system after they have started a reader. The reader is owned by the user who issues the STRDBRDR command.

Restriction: The specified database file either must consist of single-field records and must have an arrival sequence access path, or it must be a standard database source file.

 

Required Parameters

FILE
Specifies the qualified name of the database file from which the input stream is to be read. The file must be available for allocation to the spooled reader before the reader can be started.

The name of the file can be qualified by one of the following library values:

*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.

library-name: Specify the name of the library to be searched.

database-file-name: Specify the name of the database file.

 

Optional Parameters

MBR
Specifies the name of the member in the specified file that contains the input stream that is read by the reader.

*FIRST: The first member in the database file is used.

file-member-name: Specify the name of the member that contains the input stream that is read by the reader.

RDR
Specifies the name of the spooled reader being started. Each reader name must be unique.

*FILE: The name of the reader is the same as that of the database file specified by the FILE parameter.

reader-name: Specify the name by which the reader being started is identified.

JOBQ
Specifies the qualified name of the job queue on which the spooled reader places jobs. An entry is placed on this job queue for each job in the input stream that specifies JOBQ(*RDR) on its Batch Job (BCHJOB) command. If *RDR is not specified on the BCHJOB command, the job queue specified in the BCHJOB command or in the job description is used. Each job in the input stream can have a different job queue.

Restriction: If the user starting the reader is not authorized for the job queue used by the reader for a job in the input stream, an error message is sent to the message queue specified by the MSGQ parameter and the job does not run.

The name of the job queue can be qualified by one of the following library values:

*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.

library-name: Specify the name of the library to be searched.

QBATCH: The job entry is placed on the system-supplied QBATCH job queue. QBATCH is the default if JOBQ(*RDR) is specified on the BCHJOB command.

job-queue-name: Specify the qualified name of the job queue to which each job read by this reader is sent if JOBQ(*RDR) is specified on its BCHJOB command.

MSGQ
Specifies the qualified name of the message queue to which the messages created by the reader are sent.

The name of the message queue can be qualified by one of the following library values:

*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.

library-name: Specify the name of the library to be searched.

QSYSOPR: The messages are sent to the system operator's message queue, QSYSOPR.

message-queue-name: Specify the name of the message queue to which messages created by the reader are sent.

Other Single Values

*REQUESTER: The messages are sent to the workstation message queue of the workstation of the user who started the process. If this value is specified for a batch job, *OUTQ is used.

Example for STRDBRDR

STRDBRDR  FILE(QGPL/BILLING)

This command starts a spooled reader that reads its input from the database file named BILLING, which is in the QGPL library. The reader name is also BILLING because the RDR parameter was not specified. The first member in the BILLING file contains the input stream to be processed. The default job queue QBATCH and the system-supplied system operator's message queue QSYSOPR are used by the database reader.

Error messages for STRDBRDR

*ESCAPE Messages

CPF1338
Errors occurred on SBMJOB command.
CPF2207
Not authorized to use object &1 in library &3 type *&2.
CPF3301
Reader &1 already started.
CPF3307
Job queue &1 in &2 not found.
CPF3330
Necessary resource not available.
CPF3362
Objects in QTEMP not valid for parameter values.
CPF3363
Message queue &1 in library &2 not found.
CPF3364
File &1 in library &2 not database file or DDM file.
CPF9812
File &1 in library &2 not found.
CPF9815
Member &5 file &2 in library &3 not found.