× 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,
This API working only for the first time call, If I call it for the second time with conHand it not working properly and it will keep on looping.

Here Limitation is: If Bytes available exceeds 16MB it does not work even though I use user space of 16MB.

Please find the attached code which I implemented (to call API). I used wwj to break loop.
My calling program has variables of size more than 16MB.

Can some one please help on this....

:::::Below is the code to call the API program::::

d BigSTR s 1000a
d BigArr1 s 1000a dim(16000)
d ds
d Str1 s 9999999a
d Str2 s 9999999a
d
d w_PgmNam s 10a
d w_PgmLib s 10a
d w_PgmTyp s 10a
d w_ModNam s 10a
d retst s 3p 0
c eval w_PgmNam = 'TSTDUMP'
c eval w_PgmLib = 'ICIWRKWBG'
c eval w_PgmTyp = '*PGM'
c eval w_ModNam = 'TSTDUMP'
c eval retst = 1
c*** dump
c call 'RTVMODVP2'
c parm w_PgmNam
c parm w_PgmLib
c parm w_PgmTyp
c parm w_ModNam
c parm retst
/free
//dump(a);

*inlr = *on;
return;
/end-free



-----Original Message-----
From: Gangasani, Bhargava
Sent: Sunday, May 16, 2010 5:30 PM
To: 'Bhargav G'; rpg400-l@xxxxxxxxxxxx
Subject: RE: QteDumpModuleVariables Failing

THANK YOU Dennis Lovelady...

The User Space Concept worked will for my case.. I am going ahead with this as of now. (I am giving 16MB user space so that all data returned in a single shot -- ConHND is Blank in this Case, No need to worry about ConHnd functioning)

But Still -- ConHNd is not working properly for this API. Can some follow up with IBM or Please suggest me how to follow up with IBM for this.

Thank you guys.

-----Original Message-----
From: Bhargav G [mailto:bhargav414@xxxxxxxxx]
Sent: Sunday, May 16, 2010 12:51 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: QteDumpModuleVariables Failing

Thank you vry much for your views...

I introduced loop to test whether it is retrieving the data correctly
or not. And If i do not break loop using WWIND it is going into
infinite loop.

I used hard coded values because the sized of the header wont change
right (constant), I do not feel its worthy to calculate the size every
time.

As you mentioned to use user space. So here the assumption is that The
whole data will be returned during the first call it self right.

For my product programs have max of 9, 999,999 bytes (i guess) of
data. Creating user space more than this should solve the problem, if
API returns all the data in a single hit.

Since the Con Hadle is not working properly.

Thank u .. Will try and let u guys know..

******************
I am thinking of another approach. If this API does not work.
1) My calling program will dump by executing DUMP opcode.
2) In called program I will CPYSPLF *LAT spool file into Physical file
. Selct the required fiels by using SQLRPGLE in the dump. (Do u guys
have any source code to read through ILERPG DUMP and returns the
required data?)

Thank you

On Sun, May 16, 2010 at 1:51 AM, Dennis Lovelady <iseries@xxxxxxxxxxxx> wrote:
     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
*************

This message is more appropriate in the RPG400-L list.  Please reply there
only.

After you've put so much work into this, why would you set the error
structure (erDs) to low values?  At a minimum, I would define it as a proper
error structure and tell the system the real number of bytes available (80
in this case).

I have no idea why you would introduce the "do 10 times" loop toward the
beginning of the code - data will be lost - but perhaps this is part of
initial debug?

Your use of Off2Var is very like a kludge and prone to mishap.  In fact,
you're using hard-coded values throughout the program for setting your
pointers. This can have disastrous results.  You should take statements like
the following to heart: "The caller must use the offset to next variable
field to find the start of the next module variable section and use the
length of module variable section to determine the length of the current
section."  (The quote is from the documentation for the API in question.)

Having said all that, I believe that what you are running into, is a
situation where the next variable requires more space than you have supplied
in the rcvrVar parameter.  Although the documentation doesn't mention this
effect, my testing shows that if I need 10000 bytes for the next variable
and I supply less than that, the program repeated ends without error and
without populating new data into the receiver variable (although the
continuation handle does change).  Interesting.  If the below solution works
for you then you might want to pursue this with IBM as a bug.  It doesn't
seem right to me.

I got around it by receiving into a user space (where rcvrVar is
based(pSpace) and pSpace is the address of the user space (returned from
QUSPTRUS).  This is my standard method for receiving large or potentially
large data (such as this API and the QDBRTVFD API as examples).  When using
this technique, supply a large number (I use 16000000) as the "size of the
return area.  (Note that when I create user spaces, I also - by default -
create them with the "extendable" flag set.  It's a shame IBM doesn't allow
that flag on the QUSCRTUS call, but oh well.  You can pick up my
createUserSpace procedure at http://www.lovelady.com/api-samp/

Here's a look at some of the changes I made to your program:

d RtvVar          Pr                  ExtProc('QteDumpModuleVariables')
d  Rcvvar                    50000    Options(*varSize)
d  RcvvarL                      10i 0 Const
d  Fmtnm                         8    Const
d  QPgmName                     20    Const
d  PgmTyp                       10    Const
d  ModName                      10    Const
d  DtaOpt                       10i 0 Const
d  Conhand                      16    Const
d  ErrCd                              Options(*varsize) LikeDS(erDs)

(Note addition of Const where appropriate.  This allows me to use
non-variable data in the actual call.)

d RcvrHdr_T       Ds                   Qualified Based(proto_only)
d  Brtn                         10i 0
d  BAvl                         10i 0
d  NumVar                       10i 0
d  LibO                         10
d  Res                          10
d  ConHdr                       16

D rcvrVar$        S               *
D rcvrvar         DS                   Qualified Based(rcvrVar$)
D  hdr                                 LikeDS(rcvrHdr)
D  theRest                   50000


Now I can (and will) use %Size(RcvrHdr_T) in calculating position of first
variable section.

d erDs            DS                  Inz
D  bytesProv                    10I 0 Inz(%Size(erDS))
D  bytesAvail                   10I 0 Inz(0)
D  errID                         7
D                                1
D  errData                    4096

It's so easy!  How in this world could someone be writing a debugger and not
have error handling in mind!???!!!?

 rcvrVar$ = createUserSpace(mySpace: 'My space') ;
 //WWIND = 1;
 rcvrVar.Hdr.conHdr = *Blanks ;
 //DOW WWIND <10;
    rtvvar(RcvrVar
         : 16000000
         : fmtName
         : qPgmNm
         : PgmTyp
         : QPgmNm.Pgm
         : dtaOpt
         : rcvrVar.Hdr.conHdr
         : erDs) ;
    ModVarHdr$ = %Addr(rcvrVar) + %Size(rcvrHdr) ;
    ModVarSec$ = ModVarHdr$ + %Size(modVarHdr) ;
 //   WWIND += 1;
 //enddo;

I did not touch anything below this point since my goal was to figure out
your issue and try to help you get past it.  I see a few potential problems
below here, but don't want to set your style.

Do lose the constants (and Off2Var), and work off of variables as you see in
the setting of all these pointers.  And let us know how it turns out.

Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"Is there aught you would withold?  All you have shall someday be given;
therefore, give now, that the season of giving may be yours and not your
inheritors'."
       -- Kahil Gibran


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.





h debug dftactgrp(*NO)
*-------------------------------------------------------------------------
D ApiErr Ds qualified
d BytPrvd 10i 0 Bytes Provided
d BytAval 10i 0 Bytes Available
d ErrId 7a Exception ID
d Reserved 1a Reserved
d Exception 999a Exception Data
*------------------------------------------------------------------
d QRMVInp Ds Qualified Align
d FmtNam 8a
d QuaPgm 20a
d PgmNam 10a overlay(QuaPgm : 1 )
d PgmLib 10a overlay(QuaPgm : *next )
d PgmTyp 10a
d ModNam 10a
d DtaOpt 10i 0
d ConHad 16a
*------------------------------------------------------------------
*- Receiver Variable
*------------------------------------------------------------------
d QRMVRcvVar s 51000a based(QRMVRcvVar_ptr)
*------------------------------------------------------------------
*- Receiver Variable Header Section
*------------------------------------------------------------------
d QRMVRcvVarHdr Ds Based( QRMVRcvVarHdr_ptr ) Qualified
d Align
d BytRtn 10i 0
d BytAvl 10i 0
d NumVar 10i 0
d RtnLib 10a
d Reserved 10a
d ConHad 16a
*------------------------------------------------------------------
*- Module Variable Header Section
*------------------------------------------------------------------
d QRMVModVarHdr Ds Based( QRMVModVarHdr_ptr ) Qualified
d Align
d LenModVarSec 10i 0
d Off2NxtVar 10i 0
d VarEntTyp 10i 0
*------------------------------------------------------------------
*- Module Variable Section (Scalar Variable Entry Type)
*------------------------------------------------------------------
d QRMVScalar Ds Based( QRMVScalar_ptr ) Qualified
d Align
d VarTyp 10i 0
d TotalDigits 10i 0
d Precision 10i 0
d ScalingFac 10i 0
d Ofs2VarNam 10i 0
d LenOfVarNam 10i 0
d LenOfDftVal 10i 0
d LenOfHexVal 10i 0
d StrCntDes 10i 0
d LenOfStrP 10i 0
d DtaPtr *
*------------------------------------------------------------------
*- Module Variable Section (Array Definition Entry Type)
*------------------------------------------------------------------
d QRMVArray Ds Based( QRMVArray_ptr ) Qualified
d Align
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 DimLBound 10i 0
d DimUBound 10i 0
d NamePtr *
*------------------------------------------------------------------
*- Module Variable Section (Block Definition Entry Type)
*------------------------------------------------------------------
d QRMVBlock Ds Based( QRMVBlock_ptr ) Qualified
d Align
d BlockNum 10i 0
d Ofs2BlkNam 10i 0
d LenOfBlk 10i 0
d NamPtr *
d
*-------------------------------------------------------------------------
d varLst_ptr s * inz( %addr(varLst) )
d ds
d varLst 590 dim(28000) ascend
d varPRCVAR 80 overlay(varLst : 1)
d varPRCN 30 overlay(varPRCVAR : 1)
d varVARN 50 overlay(varPRCVAR : *next)
d varVART 10s 0 overlay(varLst : *next)
d varVARV 500 overlay(varLst : *next)
dvarLst# 5s 0
*-------------------------------------------------------------------------
D QRetrieveModuleVariables...
D Pr ExtProc( 'QteDumpModuleVariables')
D RcvrVariable_ 51000a Options( *VarSize )
D RcvrVarLen_ 10i 0 Const
D FormatName_ 8a Const
D QuaPgmName_ 20a Const
?D PgmType_ 10a Const
D ModName_ 10a Const
D DataOption_ 10i 0 Const
D ConHandle_ 16a Const
D ErrorCode_ 32767a Options(*VarSize )
*-------------------------------------------------------------------------
d logmsg pr
d message_ 32767a varying const Options( *VarSize )
*-------------------------------------------------------------------------
d ceemout pr extproc('CEEMOUT') opdesc
d message_ 32767 varying const
d int_ 10i 0 const
d feedback_ 12a options(*omit)
*-------------------------------------------------------------------------
* Start of stand alone variables.
*-------------------------------------------------------------------------
d wwofset2Main s 10i 0
d wwofset2var s 10i 0
dwwRcvVarHdrSize s 10s 0
dwwModVarHdrSize s 10s 0
dwwBuff s 32768a based(wwbuff_ptr)
dwwoff2ModVarHdr s 10s 0
d wwVARN s like(varVARN)
d wwVARV s like(varVARV)
d wwVART s like(varVART)
d wwprocName s 30a
d wwvari s 5s 0
d wwretainPRCN s 30a
d wwPRCN s 30a
d wwtrue s n
d wwvarcnt s 10s 0
d wwScalar_ptr s *
d wwBlock_ptr s *
d wwBase_ptr s *
d wwfsttime s 1a
d wwConHad s 16a
*
d wwjj s 5s 0
d retst s 3p 0
d w_PgmNam s 10a
d w_PgmLib s 10a
d w_PgmTyp s 10a
d w_ModNam s 10a
**********-----------------USER SPACE CODE---------***********************
D QUSCRTUS PR ExtPgm('QUSCRTUS')
d UsrSpc 20A const
d ExtAttr 10A const
d InitSize 10I 0 const
d InitVal 1A const
d PublicAuth 10A const
d Text 50A const
d Replace 10A const
d ErrorCode 32766A options(*varsize)
d domain 10a const
D QUSPTRUS PR ExtPgm('QUSPTRUS')
D UserSpc 20A CONST
D Pointer *
D p_UsrSpc S *
D USNAME C 'USRSPACE QTEMP'
D dsEC DS
D dsECBytesP 10I 0 INZ(0)
D dsECBytesA 10I 0 INZ(0)
*
**********-----------------USER SPACE CODE---------***********************
*-------------------------------------------------------------------------
* H. Begin.
*-------------------------------------------------------------------------
c *entry plist
c parm w_PgmNam
c parm w_PgmLib
c parm w_PgmTyp
c parm w_ModNam
c parm retst
*-------------------------------------------------------------------------
/free
//-------------------------------------------------------------------------
// 1. Init routine.
//-------------------------------------------------------------------------
retst = 1;
exsr wwinit_;
wwConHad = *blanks;
? //-------------------------------------------------------------------------
// 2. Excecute API, to retrive the data.
// a. Loop till ConHad is zero (i.e. No data to retrive).
//-------------------------------------------------------------------------
//*******---------------- GET THE USER SPACE POINTER -----*****************
callp QUSCRTUS(USNAME: 'USRSPC':
16000000: '*ALL' :
'*ALL':
'List of jobs on system':
'*YES': dsEC : '*USER');

callp QUSPTRUS(USNAME: p_UsrSpc);

//*******-----------------GET THE USER SPACE POINTER -----*****************
wwjj = 1;
dow wwtrue or wwjj > 20;
wwjj += 1; //*****Temparory Patch to break the Lopp*****//
//QRMVRcvVar = *blanks;
wwConHad = *blanks;
QRMVRcvVar_ptr = p_usrspc;
callp(e) QRetrieveModuleVariables(QRMVRcvVar //Receiver variable
: 16000000 //Receiver variable length
: 'DMPV0100' //Format name - 'DMPV0100'
: w_PgmNam + w_PgmLib //Qualified program name
: w_PgmTyp //Program type - *PGM or *SRVPGM
: w_ModNam //Module name
: 1 //Data option - 1
: wwConHad //Continuation handle
: ApiErr); //Error code
if %error;
LogMsg('ERROR02:RTVMODV:');
logMsg('Error occurred while executing Retrieving module +
variables api');
exsr *pssr;
endif;
//-------------------------------------------------------------------------
// 3. If No errors Process the retrieved data.
// Else, Log Error message and end.
//-------------------------------------------------------------------------
if ApiErr.errid = *blanks;
QRMVRcvVarHdr_ptr = QRMVRcvVar_ptr;
//********--- Ev QRMVRcvVarHdr to see in Header --*******

//if QRMVRcvVarHdr.NumVar = *zeros;
// leave;
//endif;

? //********--- Put Break point After wwProcessdata_ routine --*******
//********--- Ev VarLst to see the Variables routine --*******

retst = 1;
exsr wwProcessData_;
if retst <> 1;
LogMsg('ERROR03:RTVMODV:');
logMsg('Error occured while processing data received from api');
exsr *pssr;
endif;
//-----------------------------------------------------

//-- Retrive data again if more data available <> Blanks, else leave loop
if QRMVRcvVarHdr.ConHad = *Blanks;
leave;
else;
wwConHad = QRMVRcvVarHdr.ConHad;
iter;
endif;
//Erros - Log it and return
else;
LogMsg('ERROR04:RTVMODV:');
logMsg('Error occured while retrieving module variables. +
ApiError:' + ApiErr.ErrId +','+ ApiErr.Exception);
exsr *pssr;
endif;

enddo;
//-------------------------------------------------------------------------
// 4. End.
//-------------------------------------------------------------------------
*inlr = *on;
return;
//----------------------------------------------------------------------
/end-free
*-------------------------------------------------------------------------
xx*RTVMODV
3x*A. NAME: Process Data.
x*
x*B. PROGRAM: wwprocess_ (RTVMODV)
x*
x*C. PURPOSE: To process the data from Api
x*
x*D. USAGE: Subroutine
x*
x*F. INPUT: None
x*
x*G. OUTPUT: None
x*
*------------------------------------------------------------------------
/free
begsr wwProcessData_;
//----------------------------------------------------------------------
// 1. Initialize required variables
//----------------------------------------------------------------------
//--Asign pointer to RcvVar Header.
QRMVRcvVarHdr_ptr = QRMVRcvVar_ptr;

//----------------------------------------------------------------------
// 2. Loop for each variable returned.
//----------------------------------------------------------------------
wwoff2ModVarHdr = wwRcvVarHdrSize;
wwVarCnt = QRMVRcvVarHdr.NumVar;
wwBase_ptr = QRMVRcvVar_ptr;
//--Lopp untill Variable count becoems zero.
dow wwVarCnt > *zeros and wwoff2ModVarHdr <> *zero;
//--Point to ModVar Header.
QRMVModVarHdr_ptr = QRMVRcvVar_ptr + wwoff2ModVarHdr;
//----------------------------------------------------------------------
// 3. Depending on the variable entry type, process the record
//----------------------------------------------------------------------
select;
//--Scalar Variable Entry Type
when QRMVModVarHdr.VarEntTyp = *zero;
wwScalar_ptr = QRMVModVarHdr_ptr + wwModVarHdrSize;
wwProcName = wwRetainPRCN;
exsr wwFmtScalarVar_;

//--Array Definition Entry Type
when QRMVModVarHdr.VarEntTyp = 1;

exsr wwFmtArrayVar_;

//--Block Definition Entry Type
when QRMVModVarHdr.VarEntTyp = 2;
wwBlock_ptr = QRMVModVarHdr_ptr + wwModVarHdrSize;

exsr wwFmtBlockVar_;

endsl;

//----------------------------------------------------------------------
// 4. set the offset to next variable.
//----------------------------------------------------------------------
wwoff2ModVarHdr = QRMVModVarHdr.Off2NxtVar;
//--Decrement Variable count by 1.
wwVarCnt -= 1;
enddo;

varLst# = wwvari;
//----------------------------------------------------------------------
// 5. End.
//----------------------------------------------------------------------
endsr;
/end-free
//------------------------------------------------------------------------
*-------------------------------------------------------------------------
xx*RTVMODV
3x*A. NAME: Format Data for Scalar type.
x*
x*B. PROGRAM: wwFmtScalarVar_ (RTVMODV)
x*
x*C. PURPOSE: To format the data.
x*
x*D. USAGE: Subroutine
x*
x*F. INPUT: None
x*
x*G. OUTPUT: None
x*
*------------------------------------------------------------------------
/free
begsr wwFmtScalarVar_;
//----------------------------------------------------------------------
// 1. Start
//----------------------------------------------------------------------
//--Assign pointer to Scalar Ds
QRMVScalar_ptr = wwScalar_ptr;

//--Point to Variable name.
wwBuff_ptr = wwBase_ptr + QRMVScalar.Ofs2VarNam;

wwPRCN = wwRetainPRCN;
wwVARN = %subst(wwbuff: 1: QRMVScalar.LenOfVarNam);
//--Skip indicator variables.
if %subst(wwVARN:1:4) = '*ind';
leavesr;
endif;

//--Point to Variable value
wwBuff_ptr = wwBuff_ptr + QRMVScalar.LenOfVarNam;
wwVARV = %subst(wwbuff: 1: QRMVScalar.LenOfDftVal);
wwVART = QRMVScalar.VarTyp;
wwvari += 1;
if wwvari > 28000;
sorta %subarr(varVARN : 1 : 28000);
return;
endif;
varPRCN(wwvari) = wwPRCN;
varVARN(wwvari) = wwVARN;
varVARV(wwvari) = wwVARV;
varVART(wwvari) = wwVART;
//----------------------------------------------------------------------
// 2. End.
//----------------------------------------------------------------------
endsr;
/end-free
//----------------------------------------------------------------------
*-------------------------------------------------------------------------
xx*RTVMODV
3x*A. NAME: fmt array data.
x*
x*B. PROGRAM: wwFmtArrayVar_(RTVMODV)
x*
x*C. PURPOSE: To format Array data.
x*
x*D. USAGE: Subroutine
x*
x*F. INPUT: None
x*
x*G. OUTPUT: None
x*
*------------------------------------------------------------------------
/free
begsr wwFmtArrayVar_;


/////LEAVE ARRAY VARIABLES AS OF NOW



endsr;
/end-free
*-------------------------------------------------------------------------
xx*RTVMODV
3x*A. NAME: fmt Block data.
x*
x*B. PROGRAM: wwFmtBlockVar_(RTVMODV)
x*
x*C. PURPOSE: To format Block data.
x*
x*D. USAGE: Subroutine
x*
x*F. INPUT: None
x*
x*G. OUTPUT: None
x*
*------------------------------------------------------------------------
/free
begsr wwFmtBlockVar_;
//----------------------------------------------------------------------
// 1. Start
//----------------------------------------------------------------------
QRMVBlock_ptr = wwBlock_ptr;
//--Point to Block Name.
wwBuff_ptr = wwBase_ptr + QRMVBlock.Ofs2BlkNam;
wwRetainPRCN = %subst(wwbuff: 1: QRMVBlock.LenOfBlk);
if wwfsttime = 'Y';
wwfsttime = *blanks;
wwRetainPRCN = '*MAIN';
endif;

//----------------------------------------------------------------------
// 2. End.
//----------------------------------------------------------------------
endsr;
/end-free
*-------------------------------------------------------------------------
xx*RTVOBJL
3x*A. NAME: Init routine.
x*
x*B. PROGRAM: wwinit_ (RTVOBJL)
x*
x*C. PURPOSE: To initialize.
x*
x*D. USAGE: Subroutine
x*
x*F. INPUT: None
x*
x*G. OUTPUT: None
x*
*------------------------------------------------------------------------
/free
begsr wwinit_;
//-------------------------------------------------------------------------
// 1. Start.
//-------------------------------------------------------------------------
ApiErr = *blanks;
ApiErr.BytPrvd = %size(ApiErr);
QRMVInp = *blanks;
//QRMVRcvVar = *blanks;
wwofset2Main = *zeros;
wwofset2var = *zeros;
wwRcvVarHdrSize = *zeros;
wwModVarHdrSize = *zeros;
wwoff2ModVarHdr = *zeros;
wwVARN = *blanks;
wwVARV = *blanks;
wwVART = *zeros;
wwprocName = *blanks;
wwvari = *zeros;
wwretainPRCN = *blanks;
wwPRCN = *blanks;
wwtrue = *on;
wwvarcnt = *zeros;
wwfsttime = 'Y';
QRMVInp.FmtNam = 'DMPV0100'; //Format Name
QRMVInp.PgmNam = w_PgmNam; //Qualified program name
if w_PgmLib = *blanks;
QRMVInp.PgmLib = '*LIBL';
else;
QRMVInp.PgmLib = w_PgmLib;
endif;
QRMVInp.PgmTyp = w_PgmTyp; //Program type
QRMVInp.ModNam = w_ModNam; //Module Name
//--Data option =1 for Vriable names and current values in default character format.
QRMVInp.DtaOpt = 1;
QRMVInp.ConHad = *blanks; //Continuation handle
varLst# = *zero;

wwtrue = *on;
//--Get the Size of RcvVarHdr and ModVarHdr
wwRcvVarHdrSize = %size(QRMVRcvVarHdr); //48
wwModVarHdrSize = %size(QRMVModVarHdr); //12
//-------------------------------------------------------------------------
// 2. End.
//-------------------------------------------------------------------------
endsr;
/end-free
*-------------------------------------------------------------------------
xx*RTVCALS
3x*A. NAME: pssr routine.
x*
x*B. PROGRAM: *pssr (RTVCALS)
x*
x*C. PURPOSE: To handel errors
x*
x*D. USAGE: Subroutine
x*
x*F. INPUT: None
x*
x*G. OUTPUT: None
x*
*------------------------------------------------------------------------
/free
begsr *pssr;
//-------------------------------------------------------------------------
// 1. Start.
//-------------------------------------------------------------------------
LogMsg('Status:'+ %char(%status)+' ,Retst:'+ %char(retst));
LogMsg('ERROR01:RTVMODV:');
//-------------------------------------------------------------------------
// 2. End.
//-------------------------------------------------------------------------
//dump;
retst = 200;
*inlr = *on;
return;
endsr;
/end-free
*------------------------------------------------------------------------
*------------------------------------------------------------------------
*------------------------------------------------------------------------
p logMsg b export
d pi
d w_message 32767a varying const options(*varSize)
/free

//------------------------------------------------------------
// 1. Invoke Ceemout to Log the message into joblog.
// a. If any error occurs nullify it. (monitor it)
//------------------------------------------------------------
callp(e) ceemout(w_message : x'01' : *omit);
//------------------------------------------------------------
// 2. End.
//------------------------------------------------------------

/end-free
p logMsg e

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.