Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help with QRCVDTAQ...

673 views
Skip to first unread message

Fredrik Andreasson

unread,
Jan 22, 2002, 5:32:21 AM1/22/02
to
Hello

I have a CL program which "sleeps" on a dataqueue and waits for an entry to
arrive on the queue.
I noticed that the default was to remove the entry after it was receieved.
I need to change this so that it leaves the entry on the dataqueue after it
has been receieved.
It should be an simple modification.
Since the remove parameter is a part of "optional parameter group 2" I
suspect that I need to
specify all the parameters of "optimal parameter group 1" first in order to
be able to use this parameter, right ?
I must be passing incorrect values to these parameters somehow...
I suspect paramater 8 or 10.

This is the code...

DCL VAR(&DQNAM) TYPE(*CHAR) LEN(10)
DCL VAR(&DQLIB) TYPE(*CHAR) LEN(10)
DCL VAR(&DQINF) TYPE(*CHAR) LEN(500)
DCL VAR(&LENGTH) TYPE(*DEC) LEN(5 0)
DCL VAR(&WAIT) TYPE(*DEC) LEN(5 0) VALUE(-99999)
DCL VAR(&SENDER) TYPE(*CHAR) LEN(200)
DCL VAR(&RMV) TYPE(*CHAR) LEN(10)
DCL VAR(&KEY) TYPE(*CHAR) LEN(200)

CHGVAR VAR(&DQNAM) VALUE('AVF00')
CHGVAR VAR(&DQLIB) VALUE('V0F81PD')
CHGVAR VAR(&RMV) VALUE('*NO')

CALL PGM(QRCVDTAQ) PARM(&DQNAM &DQLIB &LENGTH +
&DQINF &WAIT ' ' '0' &KEY '0' &SENDER &RMV ' ' ' '


The parameters to this API can be viewed at the bottom.

Required Parameter Group:
1 Data queue name Input Char(10)
2 Library name Input Char(10)
3 Length of data Output Packed(5,0)
4 Data Output Char(*)
5 Wait time Input Packed(5,0)

Optional Parameter Group 1:
6 Key order Input Char(2)
7 Length of key data Input Packed(3,0)
8 Key data I/O Char(*)
9 Length of sender information Input Packed(3,0)
10 Sender information Output Char(*)

Optional Parameter Group 2:
11 Remove message Input Char(10)
12 Size of data receiver Input Packed(5,0)
13 Error code I/O Char(*)

If anybody has seed this before I would appreciate the help.
Thanks in advance.. Fredrik


René H. Hartman

unread,
Jan 22, 2002, 6:30:39 AM1/22/02
to
Unless functionality has expanded recently, I have always been under the
impression that you cannot read from a dataque without removing the entry. I
once needed the info to stay on the queue for troubleshooting reasons, and
the only way I found to accomplish that was creating two queues and write
the entry to both queues simultaneously. One would then be used by the app,
the other one I would monitor.

--
Vriendelijke groeten / Kind regards
René H. Hartman
R.H. Hartman Automatiserings Consultancy
www.hac-maarssen.nl

"Fredrik Andreasson" <fredrik.1....@volvo.com> schreef in bericht
news:a2jf54$7no$1...@vg170.it.volvo.se...

Fredrik Andreasson

unread,
Jan 22, 2002, 7:02:52 AM1/22/02
to
Hello

With V5R1 data queue processing has been improved.

/ Fredrik

"René H. Hartman" <sup...@sorry-nospam.nl> wrote in message
news:ojc38.165$Va.828@zonnet-reader-1...

Fredrik Andreasson

unread,
Jan 22, 2002, 8:51:29 AM1/22/02
to
Hello

The problem is fixed now.
It's easier passing a variable to each parameter.

/ Fredrik

"René H. Hartman" <sup...@sorry-nospam.nl> wrote in message
news:ojc38.165$Va.828@zonnet-reader-1...

Karl Hanson

unread,
Jan 22, 2002, 9:23:31 AM1/22/02
to

Parameters 7 and 9 are packed(3,0) - it looks like the type and size
of data passed is incorrect. If you want sender info, you only need
up to 44 bytes of storage (200 will work, but it's more than you need)
- pass the length of the sender variable in the <*DEC (3 0)> parameter
9. If your data queue is not keyed, pass a value of zero <again *DEC
(3 0)> for parameter 7 .. otherwise pass the defined length of the
key, along with valid values in parameters 6 and 8.

You might also look at passing a valid Error Code structure (parameter
13):

http://publib.boulder.ibm.com/pubs/html/as400/v5r1/ic2924/info/apis/error.htm#hdrerrcod

--
Karl Hanson

0 new messages