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




Hi All,
     I need a help on the API "QteDumpModuleVariables".

Here I am trying to retrieve the variables of calling program in the called program ( both are ILERPG and compiled iwth DEBUG *ALL views) by using the above API.

The Calling program has HUGE number of variables, DSs and up to 20 files each having more than 200 fields.

Fo the API I have defined the receiver variable size as 51000.
1) For the First time It has returned around (BYtes Returned) 49,000 bytes of data with Continuation handler <> *blanks and Number of variable <> *Zeros. (Bu=ytes available is 449,000).
    I have parsed the variables and sorted them in an array - variables and their values.

2) For the second time I called the API with Continuation handle same as in the previous call. Now it is returning - Bytes returned (48 byest) - Bytes vailable (400,000) and Number of variables = *zero and Conhand = *zero.
    ******Means Here It is failing and Not returning the Data *************

My As/400 Compiler version is V6R1.

**** And If Call that Api recursively it going to Loop and ConHndle is not becoming ZERO.


Can some one help on this... Thanks in Advance.

******FInds the Below code for the prototype: d RtvVar Pr
ExtProc('QteDumpModuleVariables')
d Rcvvar 50000A Options(*varSize)
d RcvvarL 10i 0
d Fmtnm 8a
d QPgmName 20a
d PgmTyp 10a
d ModName 10a
d DtaOpt 10i 0
d Conhand 16a
d ErrCd 32000a Options(*varsize)
*
d BasePtr s * Inz(%Addr(RcvrVar))
*
d Off2Var s 10i 0
d ModVarHdr$ s *
d ModVarSec$ s *
*
d ModVarHdr Ds Align Based(ModVarHdr$) Qualified
d LenOfMVSec 10i 0
d Offset2NxVr 10i 0
d Varentyp 10i 0
*
d RcvrVar Ds 32000 Qualified
d Brtn 10i 0
d BAvl 10i 0
d NumVar 10i 0
d LibO 10a
d Res 10a
d ConHdr 16a

d Scalar Ds Align Based(ModVarSec$) Qualified
d VarTyp 10i 0
d TotDgt 10i 0
d Presin 10i 0
d SclFac 10i 0
d Ofs2VarNam 10i 0
d LenOfVarNm 10i 0
d LenOfDftVal 10i 0
d LenOfHexVal 10i 0
d StrCntDes 10i 0
d LenOfStrP 10i 0
d ptr *
d
d Array Ds 500 Align Based(ModVarSec$) Qualified
d NoOfScFld 10i 0
d Ofset2Fvar 10i 0
d Ofset2Dime 10i 0
d Ofset2ArNAm 10i 0
d NoOFArDim 10i 0
d LenOfArName 10i 0
d DomLBound 10i 0
d DomUBound 10i 0
d Name 20a
d
d Block Ds Align Based(ModVarSec$) Qualified
d BlockNum 10i 0
d Ofs2BlkName 10i 0
d LenOfBlk 10i 0
d Name 10a
d RcvLen s 10i 0 Inz(32000)
d Fmtname s 8a Inz('DMPV0100')
d
d QPgmNm Ds Qualified
d Pgm 10a Inz('TESTCIERPT')
d Lib 10a Inz('*LIBL ')
d PgmTyp s 10a Inz('*PGM')
d Modname s 10a
d DtaOpt s 10i 0 Inz(2)
d ConHnd s 16a
d erDs s 80a INZ(*ALLX'00')
*
d wwbuf$ s *
d wwbuf s 32000 based(wwbuf$)
*
d ds
d wwvar 54a dim(500) ascend
d wwvarnam 20a overlay(wwvar : 1)
d wwvartyp 2s 0 overlay(wwvar :21)
d wwvarval 32a overlay(wwvar :23)
D wwind s 3P 0
*
/Free
WWIND = 1;
RcvrVar.cONHDR = *blanks;
DOW WWIND <10;
rtvvar(RcvrVar:RCvlen:FmtName:QPgmNm:PGMTyp:
QPgmNm.Pgm:DtaOpt:RcvrVar.cONHDR:ErDs);
Off2Var = 48;
//CONhND = RcvrVar.cONHDR;
eval wwbuf$ = bASEPTR;

WWIND += 1;
enddo;
/end-free
c do RcvrVar.NumVar
c eval wwind = wwind + 1
c eval ModVarHdr$ = BasePtr + Off2Var
c eval ModVarSec$ = ModVarHdr$ + 12
c select
c when ModVarHdr.Varentyp = 0
c eval wwbuf$ = BasePtr + Scalar.Ofs2VarNam
c eval wwvartyp(wwind) = scalar.vartyp
c eval wwvarnam(wwind) =
c %subst(wwbuf: 1: Scalar.LenOfVarNm)
c eval wwbuf$ = wwbuf$ + Scalar.LenOfVarNm
c eval wwvarval(wwind) =
c %subst(wwbuf: 1 : Scalar.LenOfDftVal)
c
c when ModVarHdr.Varentyp = 1
c eval wwvarnam(wwind) = Array.Name
c
c when ModVarHdr.Varentyp = 2
c eval wwvarnam(wwind) = Block.Name
c EndSl
c Eval Off2Var = ModVarHdr.Offset2NxVr
c EndDo
c
c Eval *Inlr = *On

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.