1 | Data queue name | Input | Char(10) |
2 | Library name | Input | Char(10) |
3 | Length of data | Input | Packed(5,0) |
4 | Data | Input | Char(*) |
5 | Length of key data | Input | Packed(3,0) |
6 | Key data | Input | Char(*) |
7 | Asynchronous request | Input | Char(10) |
8 | Data is from a journal entry | Input | Char(10) |
The Send Data Queue (QSNDDTAQ) API sends data to the specified data queue. When an entry is sent to a standard data queue, the storage allocated for each entry will be the value specified for the maximum entry length on the Create Data Queue (CRTDTAQ) command.
Distributed data management (DDM) data queues are supported using this API. This means that you can use this API to send data to a data queue that exists on a remote iSeries.
Internally, when a job uses API QSNDDTAQ (Send Data Queue), QRCVDTAQ (Receive Data Queue), QMHQRDQD (Retrieve Data Queue Description), or QMHRDQM (Retrieve Data Queue Message), a cache is created to allow faster access to the data queue. An entry in the cache means a user is authorized to the data queue. An entry is added to the cache when a user calling one of the APIs has the required authority to the data queue. An entry is also added to the cache when QSNDDTAQ is called to handle a journal entry for a data queue created with the sender ID attribute set to *YES, and the user requesting the the send function has the required authority to the current profile name in the sender ID information of the journal entry. The data in the cache is used until the job ends, so if you need to immediately change a user's authority to one of these objects, you may need to end that user's jobs.
The name of the data queue to send the data to.
The name of the library where the data queue resides.
You can use these special values for the library name:
*LIBL | The library list |
*CURLIB | The job's current library. |
Note: To improve data queue performance, the data queue APIs remember addressing information for the last data queues used. This occurs when a specific (not *LIBL or *CURLIB) value is provided for the library name, and the data queue is located in the system auxiliary storage pool (ASP number 1) or a basic user ASP (ASP numbers 2-32). The addressing information for data queues located in independent ASPs is not saved.
Because the addressing information is saved, users of this API should be aware of the following scenarios.
Scenario 1
If, a job references a library-specific data queue, the data queue is moved using the Move Object (MOVOBJ) command or renamed using the Rename Object (RNMOBJ) command, and a new data queue is created with the same name and library as the data queue that was renamed or moved, then, the job continues to reference the original data queue, not the newly created data queue.
Scenario 2
If, a job references a library-specific distributed data management (DDM) data queue, the DDM data queue is moved using the Move Object (MOVOBJ) command or renamed using the Rename Object (RNMOBJ) command, and a new data queue is created with the same name and library as the DDM data queue that was renamed or moved, then, the job continues to reference the original DDM data queue, not the newly created data queue.
Scenario 3
If, a job references a DDM data queue, which starts a DDM target job (DDM conversation) on a remote system that references a library-specific data queue, the data queue on the remote system is moved using the Move Object (MOVOBJ) command or renamed using the Rename Object (RNMOBJ) command, and on the remote system, a new data queue is created with the same name and library as the data queue that was renamed or moved, then, the DDM target job continues to reference the original data queue on the remote system, not the newly created data queue, only when the same DDM target job is used for the subsequent data queue operation. If a new DDM target job is used for the subsequent data queue operation, then the newly created data queue will be used on the remote system.
Note: For more information on creating DDM data queues and on DDM target jobs, see Distributed Data Management in the iSeries Information Center.
The number of characters to be sent to the data queue.
Note: An error occurs if the value specified is greater than the length specified by the maximum lenght (MAXLEN) parameter on the Create Data Queue (CRTDTAQ) command, unless optional parameter group 3 is specified. With optional parameter group 3, the length of the data provided in the journal entry should be specified, and it could be longer than the maximum entry length. This will be handled appropriately by the API.
The data to be sent to the data queue.
Note: If the length of this field is larger than the length of data parameter, only the number of characters (beginning from the left) as defined by the length of data parameter are sent to the data queue. If the length of this variable is smaller than the length of data parameter, unexpected results can occur.
The number of characters in the key data parameter.
Note: The maximum value is the value that is specified on the KEYLEN parameter on the Create Data Queue (CRTDTAQ) command.
The data sent to the data queue. This value must be at least as long as the value specified in the length of key data parameter; otherwise, unexpected results can occur.
Whether the send data queue request to a DDM data queue should be processed asynchronously. This parameter only applies to DDM data queues. Valid values are *YES and *NO. An error will occur if *YES is specified for a non-DDM data queue. If the value *YES is specified for the asynchronous request parameter for a DDM data queue and an error occurs on the operation, the error will not be detected until the next time the data queue is accessed.
Note: If this parameter is specified, the key length and key data parameters must also be specified even if they are not applicable. In that event, the key length should be zero and blanks should be specified for the key data.
Indicate whether the data, in parameter four, came from a journal entry. This parameter only applies to a non-DDM data queue. Valid values are *YES and *NO.
When using this paramter the data queue needs to have the same attributes as the journaled data queue. To ensure the attributes of the data queue are the same as the journaled data queue, save the journaled data queue and restore it to the system where this API will be called with optional parameter group 3 specified. Refer to Journal management for information on journaling.
Note: When using this parameter, the length of data in parameter three should be obtained from the journal entry. The length could be longer than the maximum entry length of the data queue and this will be handled appropriately by the API, an error will not be issued.
Note: If this parameter is specified, the key length, key data, and asynchronous request parameters must also be specified even if they are not applicable. In that event, the key length should be zero, key data should be blanks and *NO should be specified for the asynchronous request.
This API can be used in a multithreaded job to send entries to a non-DDM data queue. It cannot be used in a job that allows multiple threads to send entries to a DDM data queue.
Message ID | Error Message Text |
---|---|
CPF2207 E | Not authorized to use object &1 in library &3 type *&2. |
CPF24B4 E | Severe error while addressing parameter list. |
CPF2498 E | Invalid length. MAXLEN for data queue &1 in &2 is &3. |
CPF3C90 E | Literal value cannot be changed. |
CPF6565 E | User profile storage limit exceeded. |
CPF9501 E | Data queue &1 in &2 requires a key value. |
CPF9502 E | Key length must be zero for data queue &1 in &2. |
CPF9503 E | Cannot lock data queue &1 in &2. |
CPF9506 E | Key length must be &3 for data queue &1 in &2. |
CPF9507 E | Invalid key length specified. |
CPF9509 E | Space access error. |
CPF950A E | Storage limit exceeded for data queue &1 in &2. |
CPF9510 E | Operation on DDM data queue &1 in &2 failed. |
CPF9512 E | Invalid asynchronous request. |
CPF9513 E | Asynchronous request must be *NO for data queue &1 in &2. |
CPF9520 E | Value for data is from a journal entry is not valid. |
CPF9521 E | Entry not sent. Data queue attributes do not match. |
CPF9522 E | Entry not sent. Data from a journal entry is not valid. |
CPF9523 E | Data queue function not successful. |
CPF9801 E | Object &2 in library &3 not found. |
CPF9802 E | Not authorized to object &2 in &3. |
CPF9803 D | Cannot allocate object &2 in library &3. |
CPF9807 E | One or more libraries in library list deleted. |
CPF9808 E | Cannot allocate one or more libraries on library list. |
CPF9810 E | Library &1 not found. |
CPF9820 E | Not authorized to use library &1. |
CPF9830 E | Cannot assign library &1. |
CPF9872 E | Program or service program &1 in library &2 ended. Reason code &3. |
Top | Object APIs | APIs by category |