|
Here it is
** SUBPROCEDURE in SP **
D/copy *libl/qrpglesrc,ctryMastPr
DdsCtryMast e Ds extname(CtryMast) prefix(o_)
DdsData E DS extname(CtryMast) prefix(i_)
D based(pDS) OCCURS(1000)
DpDs S * INZ
Dcount S 10i 0
Dx S 3 0
? * retrieve all country master records
PgetCtryMastAll B Export
DgetCtryMastAll PI *
D count 10i 0
DmemSize S 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
** CALLING 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
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 mailing list archive is Copyright 1997-2025 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.