Query Distributions (QRYDST)

The Query Distribution (QRYDST) command allows you to request distribution information either for yourself or on behalf of another user.

Restrictions:

  1. If you request distribution information for another user, you must have been given permission to work on behalf of that user with the GRTUSRPMN command.
  2. If user ID(*ALLAUT) is specified, and if you do not have permission to work on behalf of the other user, only information about your own distributions is returned.
  3. The requester of the command must be enrolled in the system distribution directory. Personal distribution cannot be requested if the requester is working on behalf of another user.
  4. The DLTSTS parameter does not apply to incoming distributions. When OPTION (*IN) is specified, the DLTSTS parameter is ignored.
  5. Personal distribution cannot be queried if the requester is working on behalf of another user.

Parameters

Keyword Description Choices Notes
OPTION Incoming or outgoing *IN, *OUT Optional, Positional 2
USRID User identifier Single values: *CURRENT, *ALLAUT
Other values: Element list
Optional, Positional 1
Element 1: User ID Character value
Element 2: Address Character value
DLTSTS Delete status *NO, *YES Optional
OUTFILE File to receive output Single values: *NONE
Other values: Qualified object name
Optional
Qualifier 1: File to receive output Name
Qualifier 2: Library Name, *LIBL, *CURLIB
OUTMBR Output member options Element list Optional
Element 1: Member to receive output Name, *FIRST
Element 2: Replace or add records *REPLACE, *ADD
STATUS Status *ALL, *NEW, *OLD, *OPENED, *UNOPENED, *LOCAL, *REMOTE, *FILEPND, *DELETED, *DAMAGED Optional
CMDCHRID Command character identifier Single values: *SYSVAL, *DEVD
Other values: Element list
Optional
Element 1: Graphic character set Integer
Element 2: Code page Integer

Incoming or outgoing (OPTION)

Specifies the type of distribution information that is returned.

*IN
Information about incoming distribution is returned.
*OUT
Information about outgoing distribution is returned. An outgoing distribution is the status being saved by the system for a distribution sent to one or more users with confirmation of delivery requested.

User identifier (USRID)

Specifies the user ID and the user ID address associated with this request.

*CURRENT
Your distribution information is returned.
*ALLAUT
Your distribution information and information for all users who have given you permission to work on their behalf is returned.
user-ID
Specify the user ID of the user whose distribution information is being returned. You must have permission to work on behalf of the user specified on this parameter if the named user ID is not your own.
user-ID-address
Specify the user ID address of the user whose distribution information is being returned. You must have permission to work on behalf of the user specified on this parameter if the named user ID address is not your own.

Delete status (DLTSTS)

Specifies whether the distribution status being kept for outgoing distributions is deleted from the system.

*NO
The distribution status is not deleted from the system.
*YES
The distribution status is deleted if all receivers have returned status.

Note: Other products use this status information. Care should be taken not to delete information that other products use to track their distribution.

File to receive output (OUTFILE)

Specifies the name of the database file to which the output is directed. If the output file does not exist, a database file is created in the specified library. If the file is created by this function, the text description will read: 'OUTFILE is created by QRYDST', and the authority for users with no specific authority is the same as the create authority specified for the library in which the file is created. Use the Display Library Description (DSPLIBD) command to show the library's create authority.

If a new file is created and *IN is specified on the Incoming or outgoing prompt (OPTION parameter), the system uses QAOSILIN in QSYS with a format name OSLIN as a model.

If a new file is created and *OUT is specified on the Incoming or outgoing prompt (OPTION parameter) the system uses QAOSILOT in QSYS with a format name OSLOUT as a model.

*NONE
The output is not directed to a database file. If *NONE is specified, the output from this command is a completion message containing the number of distributions on the Document Interchange Architecture (DIA) Distribution Recipient Index (*DRX) for the option and user ID and address specified.

When *IN is specified on the Incoming or outgoing prompt (OPTION parameter), the total count of new and old status is returned. After each QRYDST, any mail with new status is changed to old status.

Note: Office Vision/400 disregards the old mail status and treats both old and new mail as if they have new status.

data-base-file-name
Specify the name of the database file and library that receives the output of the display.

The possible library values are:

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is used to locate the database file. If no current library entry exists in the library list, QGPL is used.
library-name
Specify the library where the database file is located.

Output member options (OUTMBR)

Specifies whether the output from the command is displayed at the requesting work station or printed with the job's spooled output.

The possible member to receive output values are:

*FIRST
The first member in the file receives the output. If the member does not exist, the system creates a member with the name of the file specified on the File to receive output prompt (OUTFILE parameter).
member-name
Specify the name of the file member that receives the output. If the member does not exist, the system creates the file member. If the member already exists, the system adds records to the end of the member or clears the member and then adds the records.

The possible add or replace values are:

*REPLACE
The system clears the existing member and adds the new records.
*ADD
The system adds the new records to the end of the existing records.

Status (STATUS)

Specifies the mail entry status of the distribution for which you are requesting information. This parameter is valid only if *IN is specified on the Incoming or outgoing prompt (OPTION parameter) and an output file is specified on the File to receive output prompt (OUTFILE parameter).

*ALL
Distribution information is returned regardless of the distributions' mail entry status.
*NEW
Distribution information is returned only for those distributions whose mail entry status is NEW.
*OLD
Distribution information is returned only for those distributions whose mail entry status is OLD, which indicates that the distribution has been queried once but has not been processed.
*OPENED
Distribution information is returned only for those distributions whose mail entry status is OPENED.
*UNOPENED
Distribution information is returned for those distributions whose mail entry status is either NEW or OLD.
*LOCAL
Distribution information is returned only for those distributions whose mail entry status is LOCAL, which indicates that the distribution has been filed on the local system.
*REMOTE
Distribution information is returned only for those distributions whose mail entry status is REMOTE, which indicates that the distribution has been filed on a remote system.
*FILEPND
Distribution information is returned only for those distributions whose status is FILEPND, which indicates that the distribution is being filed on the local system or a remote system, but the file operation has not finished.
*DELETED
Distribution information is returned only for those distributions whose status is DELETED, which indicates that the document referred to by the distribution has been deleted.
*DAMAGED
Distribution information is returned only for those distributions whose status is DAMAGED, which indicates that the document referred to by the distribution is damaged.

Command character identifier (CMDCHRID)

Specifies the character identifier (graphic character set and code page) for the data being entered as command parameter values. The character identifier is related to the display device used to enter the command.

The value specified on the User identifierprompt (USRID parameter) is translated to character set and code page '930 500'.

Single values

*SYSVAL
The system determines the graphic character set and code page values for the command parameters from the QCHRID system value.
*DEVD
The system determines the graphic character set and code page values from the display device description where this command was entered. This option is valid only when entered from an interactive job. If this option is specified in a batch job, an error occurs.

Element 1: Graphic character set

1-32767
Specify the graphic character set to use.

Element 2: Code page

1-32767
Specify the code page to use.

Examples

QRYDST   USER(*CURRENT)  OPTION(*IN)
         OUTFILE(*CURLIB/MYFILE)  OUTMBR(*FIRST *ADD)

This command requests information about incoming distributions for the current user of this command. The output is directed to the database file MYFILE in the user's current library and is added to the first member in that file.

Error messages

*ESCAPE Messages

CPF900B
User ID and address &1 &2 not in System Distribution Directory.
CPF900C
Sign on and verify of user failed.
CPF905C
Error occurred trying to find a translation table.
CPF907C
&1 requested distributions completed, acknowledge failed.
CPF9096
Cannot use CMDCHRID(*DEVD), DOCCHRID(*DEVD) in batch job.
CPF9097
Query distribution request failed.
CPF9845
Error occurred while opening file &1.
CPF9847
Error occurred while closing file &1 in library &2.
CPF9860
Error occurred during output file processing.