Keyed Data Queue

130 pts.
AS/400 Control Language
AS/400 Data Queue
Data Queue
Hello, Can any one help me by providing a sample CL program to add and retrieve data from a keyed Data Queue? Please see the below mentioned CL program I am getting “CPF3C36” error. Can any one help me in this regards? PGM DCL VAR(&DQNAME) TYPE(*CHAR) LEN(10) VALUE('BIBIN') DCL VAR(&DQLIB) TYPE(*CHAR) LEN(10) VALUE('D993336') DCL VAR(&DQSNDL) TYPE(*DEC) LEN(5 0) VALUE(14) DCL VAR(&DQLEN) TYPE(*DEC) LEN(5 0) DCL VAR(&DQSNDD) TYPE(*CHAR) LEN(100) DCL VAR(&DQDATA) TYPE(*CHAR) LEN(100) DCL VAR(&DQWAIT) TYPE(*DEC) LEN(5 0) VALUE(0) DCL VAR(&KEYLE) TYPE(*DEC) LEN(3 0) VALUE(1) DCL VAR(&KEYDAT) TYPE(*CHAR) LEN(1) CHGVAR VAR(&DQSNDD) VALUE('THIS IS BIBIN ') CALL QSNDDTAQ PARM(&DQNAME &DQLIB &DQSNDL &DQSNDD &KEYLE &KEYDAT) CALL QRCVDTAQ PARM(&DQNAME &DQLIB &DQDATA - &KEYLE &KEYDAT &DQWAIT ) SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA(&DQDATA) ENDPGM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Message . . . . : Number of parameters, &1, entered for this API was not
Cause . . . . . : Number of parameters, &1, specified was not valid. The
minimum number of parameters is &2. Refer to the APIs topic collection in
the Programming category in the i5/OS Information Center book,, to determine the correct number of
parameters to specify.

You didn’t specify which API encountered the error
this looks ok.

I’ve fixed the code. I think the call QRCVDTAQ is missing
data length field &DQSNDL
wait time out of order
next KRule (2A value(‘EQ’)
then &keyLE and &keyDat
then you can optionally capture the SENDERLen (3 0)value(44) and SenderVal (44 struture)
SenderVal – LenRtv 4p0, LenAvl 4p0 SenderJobName 10A SenderUser(10a) SenderJobNum 6A
SenderProfile 10A

I think the last two are optional.

Typically the same program is not putting the items on the Queue that are picked up by the second.
The Putter codes the Key values. (Lets say they were ‘ADD’, ‘CHANGE’, ‘DELETE’)
One or more programs are receiving from the Queue. When a program received key ‘ADD’ it will receive and remove the entries with the ‘ADD’ key but will not effect the others.

Key rules can be ‘GT’ ‘LT’ ‘NE’ ‘EQ’ ‘GE’ ‘LE’
With a wait time = 0 the receiver will not wait for an entry.
With a negative wait time the receiver will wait forever for an entry.

The value in &DQSNDL should typically be the length of the field to be sent (100) not the length of the data…
I think that simplifies the program a bit.

Discuss This Question: 1  Reply

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Davidfree007
    Agree with Phil, QRCVDTAQ parameters are incorrect should be DATAQUEUE 10 DATA QUEUE LIBRARY 10 LENGTH 5,0 DATA WAITTIME 5,0 Then the optional parameters which are only relevant if dataqueue is keyed ORDER 2 KEY LENGTH 3,0 KEY SENDER ID LENGTH 3,0 SENDER ID See my simple QRCVDTAQ example here Col
    90 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: