On Friday, November 7, 2003, at 07:40 PM, Werner Noll wrote:
what is the real max. lenght of a data buffer in a DTAQ? The CRTDTAQ
command
provides a max. lenght of 64512 bytes. The data buffer e.g. in the
QSNDDTAQ
API is obviously a character field and therefore limitted to 32767
byte. How
can I use the space beyond that limit? Can the data buffer be a field
with
varying lenght and thus larger than 32767 byte?
The maximum length is the length specified when the data queue was
created.
The QSNDDTAQ API will accept a data buffer of any length as long as the
length specified on the API does not exceed the maximum length of the
data queue entry.
RPG IV (and some other HLLs) imposes a restriction of 32KB on character
fields prior to 510. From 510 RPG supports 64KB character fields.
Because the QSNDDTAQ API is a *PGM object it expects parameters passed
by reference--that means the address of each variable is passed to the
API. If you understand that a variable passed by reference is EXACTLY
the same as a pointer passed by value you can use the full length of a
data queue entry by prototyping the API to accept a pointer by value to
the data buffer.
Below is my prototype for the QSNDDTAQ API. If you include it in your
program source like:
/define USE_BUFFER_POINTER
/include rpgleinc,qsnddtaq
then you will be able to invoke it passing a pointer to the data. For
example:
D data S 32767
D dataLen S 5P 0
C CALLP QSNDDTAQ( 'MYQUEUE' : 'MYLIB' :
C dataLen : %ADDR(data) )
--or--
D dataPtr S *
D dataLen S 5P 0
C CALLP QSNDDTAQ( 'MYQUEUE' : 'MYLIB' :
C dataLen : dataPtr )
Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software AS/400 Technical Specialists
http://www.flybynight.com.au/
Phone: +61 3 9419 0175 Mobile: +61 0411 091 400 /"\
Fax: +61 3 9419 0175 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------
/if defined(QSNDDTAQ_h)
/eof
/else
/define QSNDDTAQ_h
*** START HEADER FILE SPECIFICATIONS
************************************
*
*
* Header File Name . . . . : QSNDDTAQ
*
*
*
* Descriptive Name . . . . : Send Data Queue Message API.
*
*
*
* Copyright:
*
* (C) Copyright FlyByNight Software Pty. Ltd. 2001
*
* All rights reserved.
*
*
*
* Description . . . . . . . : Header file for Send Data Queue Message
*
* API which sends a message (or entry) to
*
* the specified data queue.
*
*
*
* Header Files Included . . : *NONE
*
*
*
* Macros List . . . . . . . : *NONE
*
*
*
* Structure List . . . . . : *NONE
*
*
*
* Function Prototype List . : QSNDDTAQ
*
*
*
* Notes:
*
* Dependencies . . . . . :
*
*
*
* Restrictions . . . . . :
*
*
*
* Comments . . . . . . . : Define the macro LONG_PROC_NAMES if you
*
* want meaningful procedure names.
*
* Define the macro USE_BUFFER_POINTER if
*
* you want to use pointers to buffers.
*
*
*
* Change Activity:
*
* Rlse &
*
* Flag Reason Level Date Pgmr Comments
*
* ---- -------- ------ ------ ----------
------------------------------ *
* $A0= VRM310 010824 SHC New include.
*
*
*
* Change activity detail:
*
*
*
*** END HEADER FILE SPECIFICATIONS
**************************************
************************************************************************
*
* Constants
*
************************************************************************
*
D $DQ_DDM_ASYNC_YES...
D C CONST('*YES ')
D $DQ_DDM_ASYNC_NO...
D C CONST('*NO ')
************************************************************************
*
* Prototype for calling Data Queue API QSNDDTAQ
*
************************************************************************
*
/if defined(LONG_PROC_NAMES)
D QmhqSndDtaqEntry...
D PR
/else
D QSNDDTAQ PR
/endif
D EXTPGM('QSNDDTAQ')
*
* Required parameter group:
* Data queue name
D dtaqName 10 CONST
* Data queue library name
D dtaqLib 10 CONST
* Length of data queue entry
D dtaqEntryLen 5P 0 CONST
* Data queue entry
/if defined(USE_BUFFER_POINTER)
D dtaqEntry * VALUE
/else
D dtaqEntry 32767 CONST OPTIONS(*VARSIZE)
/endif
*
* Optional parameter group 1:
* Length of key
D keyLen 3P 0 CONST OPTIONS(*NOPASS)
* Key value
/if defined(USE_BUFFER_POINTER)
D keyData * VALUE OPTIONS(*NOPASS)
/else
D keyData 256 CONST OPTIONS(*VARSIZE:*NOPASS)
/endif
*
* Optional parameter group 2:
* Asynchronous request
D asyncRqs 10 CONST OPTIONS(*NOPASS)
/endif
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.