Progress/400
Product Guide


Data Queue Support

Progress/400 allows you to perform operations on data queues from within a Progress client session. You can perform two types of operations:

Using these APIs insulates your code from possible changes to the underlying method of sending and receiving data from data queues and provides a standard interface that will not change. You use them in the same way regardless of whether the code runs from the remote client or from the native clients.

Progress/400 supports the send (create) and receive (find) operations by providing the QDTAQ-ENTRY table definition in the Progress/400 schema. This table is similar to the QCMD table in that it controls the function of the Progress/400 DataServer, but different in that data can be sent to and received from data queues. More than one job can place data onto or receive data from a particular data queue.

NOTE: Do not use the QDTAQ-ENTRY name as a physical file name because the SYNC function updates the file on the client, making the data queue APIs unusable.

Before you can place a record onto a data queue, you must create the data queue using the OS/400 Create Data Queue (CRTDTAQ) command. For detailed information about OS/400 data queue access routines, see the IBM OS/400 Control Language Programmer’s Guide and the System API Reference .

The DataServer displays appropriate error messages to the remote client session, with more detailed error information available in the OS/400 job log (assuming that the server is started with logging), or to the native client’s job log, as appropriate.

SEND DATA QUEUE (snddtaqe.p) API

Table 11–17 describes the parameters that you must pass to the SEND DATA QUEUE API. You can use either the same variable names or names of your own choice. Note that you must pass all of these parameters to the API, and they must be in the same order as in Table 11–17.

Table 11–17: SEND DATA QUEUE (snddtaqe.p) Parameters
Parameter Name
Parameter Type and Data Type

Value
db-name
INPUT
CHARACTER
The name of a connected DB2/400 database that contains the QDTAQ-ENTRY table. The database must be connected before the call to the API because an alias will be defined for the database that allows any DB2/400 database to use the API.
que-name
INPUT
CHARACTER
The name of the data queue on the AS/400. This data queue must have been created before using the API.
library-name
INPUT
CHARACTER
The library name where the data queue resides.
entry-data
INPUT
CHARACTER
The data to be placed on the data queue.
key-data
INPUT
CHARACTER
If the data queue was created to use a key, the data for the key.
If the data queue is not keyed, assign this parameter to blank.
key-length
INPUT
INTEGER
If the data queue was created to use a key, the length of the key specified when the data queue was created.
If the data queue is not keyed, assign 0 to the parameter.
Status
OUTPUT
INTEGER
A return parameter that indicates whether the entry has been placed on the data queue.

The following example illustrates calling the SEND DATA QUEUE API from your code:

RUN as4dict/snddtaqe.p (INPUT db-name, INPUT que-name, 
                        INPUT library-name, INPUT entry-data, 
                        INPUT key-data, INPUT key-length, 
                        OUTPUT status), 

The OUTPUT parameter can be checked to verify that the entry has been placed on the queue.

To verify that an entry has been changed, check the value of the OUTPUT parameter. Table 11–18 lists possible return values.

Table 11–18: SEND DATA QUEUE (snddtaqe.p) Return Values 
Status
Reason
Client
0
The entry has been placed onto the data queue.
Remote and native
-1
Either the DB2/400 database name is incorrect or the database is not connected.
Remote only
-2
The named DB2/400 database does not contain the QDTAQ-ENTRY table.
Remote only
-4
An error occurred and an entry was not placed on the data queue.
Remote and native


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095