× 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.



Any chance there's another procedure out there with the same name?

On 12/1/06, David Gibbs <david@xxxxxxxxxxxx> wrote:

Folks:

I've got an odd problem that's kind of driving me crazy.

Please keep in mind, this code worked fine the day before yesterday ...
I have no idea what changed to cause it to stop working.

Basically, I'm getting a MCH3601-pointer not set error when I try to
assign a character field with options(*varsize) to the substring of a
standalone field.

Here's the situation ... I've got a generic routine that I used to
retrieve an entry off a keyed data queue (getClientData).  Since the
data queue entry is formatted for a data structure, I pass a data
structure into the routine.

Here's how the data structure is defined in the calling routine ...

D dataQueueEntry...
D               E DS                  extname(EXTDSPF) qualified inz

(this data structure is 601 bytes long)

And the call to the generic data queue routine is ...

moreEntries = getClientData(pListId: dataQueueEntry);


getClientData is is a different module than the caller, but the same
service program.

Here is the full getClientData Routine ...

     PgetClientData...
     P                 B                   export
     D                 PI              N
     D pListId                       35    value
     D pData                       2048    options(*varsize)
     D

     D data            S           2048
     D dataLength      S              5  0
     D gotData         S               N
     D dummySender     S              8
     D parmLength      S              5  0

      /free

       QRCVDTAQ(CLIENT_REQUEST_DATA_QUEUE:'*LIBL':dataLength:data:
         *zero:'EQ':%size(pListId):pListId:*zero:dummySender);

       gotData = (dataLength > 0);

       if gotData;
         pData = %subst(data:1:dataLength);
       else;
         pData = *blank;
       endif;

       return gotData;

      /end-free

     P                 E

When I receive the entry off the data queue, everything is fine ... the
dataLength is 601 (which is correct for the data queue entry), the data
field has the data queue entry content.

The problem arises when I try to trim the data field to the datalength
value (using %subst) and put it into the pData field.  pData, which was
previously valid, now has an invalid pointer.  The debugger tells me
this, and the program bombs with the MCH3601 error.

This is driving me crazy ... it worked FINE two days ago.  I can't
figure out what changed.

I did rename a few procedures ... but the binding source was updated and
all modules recompiled and the service program recreated.

Can anyone see what is probably quite obvious ... that I'm missing?

Thanks!

david
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



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.