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

This works. However I have to pass the record count as a parameter.


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

SubProcedure
     HNomain
     DgetCtryMastAll   PR              *
     D count                         10i 0

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

     Dx                s              3  0
     DmemSize          S             10i 0

     pgetCtryMastAll   B                   Export
     DgetCtryMastAll   PI              *
     D count                         10i 0

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

     c                   eval      memSize = %size(dsData) * count
     c                   alloc     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


Main procedure
     fQsysprt   o    f  132        printer oflind(*inof)

     DgetCtryMastAll   PR              *
     D count                         10i 0

     DdsCtryMast     E ds                  extname(ctryMast) prefix(i_)
     D                                     OCCURS(20000) 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.