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



Instead of      d Q             e DS EXTNAME(WMERLGP:WMERLG:*INPUT)
Try             d Q               Ds LikeRec(WMERLG : *Input )


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Rich Duzenbury
Sent: Wednesday, December 07, 2005 12:55 PM
To: RPG400-L
Subject: RNF7701 - Data structure not allowed

Hi all,

I'm getting a compile error on what looks like OK code to me.  I've
stripped the program down as small as possible to demonstrate the error,
which happens to occur on a V5R2 machine.

What I want to do is load the WMERLG record format fields, then, locate
the highest EID in the file, add one to it, and attempt to use it for
the new record key.  I don't want the 'next_eid' routine to clobber the
E* fields, hence the need for reading into a data structure.

Here is the file, WMERLGP:
     A                                      UNIQUE
     A          R WMERLG
     A            EID           11P 0
     A            EACCT#        11P 0
     A            EAPLNM        20A  
     A            EAPFNM        12A  
     A            EAPITL         1A  
     A            EVISDT          Z  
     A            EREVDT          Z  
     A            EUSRID        10A  
     A            ERSTS          1A  
     A          K EID

And the code:
     H dftactgrp(*no) actgrp(*caller)
     H OPTION(*SRCSTMT:*NODEBUGIO)

     FWMERLGP   if a e           k disk

     d Q             e DS
EXTNAME(WMERLGP:WMERLG:*INPUT)
     d                                     QUALIFIED

     d next_eid        pr            11s 0
     d $err            s               n

      /free
         $err = '0';
         dow $err = '0';
             EID = next_eid();
             write(e) WMERLG;
             $err = %error;
         enddo;
         *inlr = '1';
      /end-free

     p next_eid        b
     d next_eid        pi            11s 0

     d result          s             11s 0

      /free
         setgt *hival wmerlgp;
         // read into a ds so as not to disturb the
         // global file fields
         readp wmerlg Q;
     // RNF7701 here!
         if %eof(wmerlgp);
             result = 1;
         else;
             result = q.eid + 1;
         endif;
         return result;
      /end-free
     p                 e


The error is RNF7701, 'Data structure is not allowed for the operation',
and lists the line of code that does 'readp wmerlg Q'.

I've tried EXTNAME(WMERLGP), EXTNAME(WMERLGP:*INPUT),
EXTNAME(WMERLGP:*OUTPUT) and also with and without the 'QUALIFIED',
still get the error.

PS - I tried to put the code on the code.midrange.com app
(http://code.midrange.com), but I receive the following error, 'Access
denied for user 'nopaste'@'localhost' (using password: YES)'

If you have any ideas, let me know, please.

Thanks.

Regards,
Rich



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.