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



Hello all,

I am having fits with a routine that is getting a 'pointer not referenced'
error when trying to return an array. Both are RPGIV. The call is
prototyped. If I look at the procedure in debug, it works fine until the
return statement then it fails. Here is the siginficant code:

/* Main program */
     Dsales            s             11  3 DIM(12)
     DgetPlanedSales   PR            11  3 DIM(12)
     D                               15    CONST
     D                                4  0 CONST
     D                                3  0 CONST

      * planned Sales selection
     c                   eval      sales =
getPlanedSales(itnbr:slsPlnYr:seq#)

/* subProcedure */
     H noMain
     fSls600wfl if   e           k Disk    usropn

     d                 DS
     DdsPlan                   1    120  3 DIM(12)
     D fcstum1                 1     10  3 INZ
     D fcstum2                11     20  3 INZ
     D fcstum3                21     30  3 INZ
     D fcstum4                31     40  3 INZ
     D fcstum5                41     50  3 INZ
     D fcstum6                51     60  3 INZ
     D fcstum7                61     70  3 INZ
     D fcstum8                71     80  3 INZ
     D fcstum9                81     90  3 INZ
     D fcstum10               91    100  3 INZ
     D fcstum11              101    110  3 INZ
     D fcstum12              111    120  3 INZ

     DgetPlanedSales   PR            11  3 dim(12)
     D itnbr                         15    CONST
     D year                           4  0 CONST
     D seq                            3  0 CONST

     PgetPlanedSales   b                   export
     DgetPlanedSales   PI            11  3 dim(12)
     D itnbr                         15    CONST
     D year                           4  0 CONST
     D seq                            3  0 CONST

     dplan             S             11  3 DIM(12)
     dx                s              2  0
     DseqKey           S              2  0

     c                   if        not %open(Sls600wfl)
     c                   open      sls600wfl
     c                   endif

     C     key           klist
     c                   kfld                    year
     c                   kfld                    seqKey
     c                   kfld                    itnbr

     c                   reset                   plan
     c                   eval      seqKey = seq

     c     key           setll     Sls600wfl
     c                   dou       %eof(Sls600wfl)
     c     key           reade     Sls600wfl
     c                   if        %eof(Sls600wfl)
     c                   leave
     c                   endif

     c                   for       x = 1 to 12
     c                   eval      plan(x) = plan(x) + dsPlan(x)
     c                   endfor

     c                   enddo

     c                   return    plan

     P                 E


Thanks in advance,

Mark


Mark Walter
Sr. Programmer/Analyst
Hanover Wire Cloth a div of CCX, Inc.
mwalter@hanoverwire.com
http://www.hanoverwire.com
717.637.3795 Ext.3040



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.