Keyed Data Queue

130 pts.
Tags:
AS/400 Control Language
AS/400 Data Queue
CL
CL/400
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.

CPF3C36
Message . . . . : Number of parameters, &1, entered for this API was not
valid.
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,
http://www.ibm.com/systems/i/infocenter/, to determine the correct number of
parameters to specify.

You didn’t specify which API encountered the error
CALL QSNDDTAQ PARM(&DQNAME &DQLIB &DQSNDL &DQSNDD &KEYLE &KEYDAT)
this looks ok.

CALL QRCVDTAQ PARM(&DQNAME &DQLIB &DQSNDL &DQDATA &DQWAIT &KRULE &KEYLE &KEYDAT)
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.
Phil

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • 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:
    report

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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

Following