× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Terry,

> I am trying to add offset1 to the address of QDQM_RtnData get the Offset
> Entry (QDQE_Entry).  I can see a valid value in QDQE_Offset2 but
> QDQE_MsgText just contains garbage.

I can see two problems:

First problem:

You're not checking for errors properly.  The error code parameter to
QMHRDQM is a data structure in which you have to specify a length before
you call the API.  The "DM_Error" field that you're passing for this
parameter is just a character string.  Since you're not setting it to any
value, it'll be set to blanks when your program starts.

The API won't understand that it's set to blanks, it'll try to interpret
those blanks as a length.  An EBCDIC blank is x'40'.  So, the API will
read x'40404040' as the length of your structure, if you convert that to
decimal you get 1077952576...   Since you're only providing 32k of memory
for that parameter, this will cause some big problems.

Instead, define DM_error as follows:

     D DM_Error        DS
     D  DME_BytesPrv                 10I 0 inz(%size(dsEC))
     D  DME_BytesAvl                 10I 0 inz(0)
     D  DME_MsgID                     7A
     D  DME_Reserved                  1A
     D  DME_MsgData                4096A

You can set DME_BytesPrv to 0 if you want the API to send you an exception
message (which you can catch with the MONITOR op-code, the (E) operation
extender, or the *PSSR) instead of returning errors in the MsgID/MsgData
fields.

Second Problem:

It would appear that QDQE_Key1 in your program is defined as 1A.  However,
the API states that the message key is a variable-length field, and that
QDQE_MsgText does not begin until after the end of the message key field.

Therefore, in order to read the data correctly, you need to remove
QDQE_MsgText from the QDQE_Entry data structure.  Instead, have your
MsgText field be based on it's own pointer, and set that pointer equal to
%addr(QDEQ_Key1) + QDQM_KeyLRtn.

Hope that helps...

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.