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



Andrew,

It's still not working. It is not allocating the size of the pointer. I'll
post the code.

What's happening here is that the occur value is out of range. There are
still only 10 occurrences of the MODS even though there are 13 records in
the file.


Thanks,

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

Here is the procedure

     DgetCtryMastAll   PR              *
     D count                         10i 0

     Ddsdata         E DS                  extname(ctrymast) occurs(10)
     D                                     based(pDS)
     DpDS              S               *   INZ

     Dx                s              3  0
     DmemSize          S             10i 0

     pgetCtryMastAll   B                   Export
     DgetCtryMastAll   PI              *
     D count                         10i 0

     c                   eval      memsize = %size(dsData) * 10
     c                   alloc     memSize       pDS


     c/exec sql
     c+ SELECT COUNT(*) INTO :count
     c+ FROM ctrymast
     c/end-exec

     c                   eval      memSize = %size(dsData) * count
     c                   realloc   memSize       pDS

     c/exec sql
     c+ DECLARE c1  CURSOR FOR
     c+  SELECT *
     c+  FROM Ctrymast
     c/end-exec

     c/exec sql
     c+ OPEN c1
     c/end-exec

     c/exec sql
     c+ FETCH FROM c1 FOR :count ROWS
     c+  INTO :dsData
     c/end-exec

     c/exec sql
     c+ CLOSE c1
     c/end-exec

     c                   return    pDS
     P                 e


Here is the Main procedure

     fQsysprt   o    f  132        printer oflind(*inof)
     DgetCtryMastAll   PR              *
     D count                         10i 0

     DdsCtryMast     E ds                  extname(ctryMast) prefix(i_)
     D                                     OCCURS(10) BASED(ptr)
     dptr              S               *   INZ

     Dx                s              3  0
     dcount            S             10i 0

     c                   eval      ptr = getCtryMastAll(count)

     c                   for       x = 1 to count
     c     x             occur     dsCtryMast
     c                   except    detail
     c                   endfor

     c***                dealloc                 ptr

     c                   eval      *inlr = *on

     OQsysprt   E            detail      1
     o                       x                   +1
     O                       i_ct_code           +1
     O                       i_ct_name           +1




As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.