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



Also to mention:

My compiler is v6R1. it supports Character String or Ds or Array upto
16MB. But V5R3 do not support character string more than 64kB .

Even Some this About DUMP opcode:

In V5R3, dump opcode fails to dump the Ds or Array which is more than
5MB or 16MB.. not sure I did not remember exactly, It say NOT
ADDRESSABLE in dump.

But in V6R1, What ever the size of the Variable it DUMPS in to sp0ol
file with out fail.

*** Can Some Help How to skip HEX values in Dump So that I can save
huge memory in Dump or I can Get less and required data from the API
if I stop getting HEX values.

Something like Setting an Environment Variable...etc what ever it is?


On Mon, May 17, 2010 at 7:36 AM, Bhargav G <bhargav414@xxxxxxxxx> wrote:
Thanks for explaining about %size =, going forward i prefer to use
this as this is compiler effort.
----------------------
Any way, from this API i do not require Hex values. Is there any way
to prevent that, So that I can fit more variables in 16MB.

--------

USerSpace: Yes I agree I will use your procedures for this. For quick
testing i used existing once. Today Monday I will be using yours.Thank
you.

--------
Vry Big String:  d Str1            s        9999999a.  This i defined
to just make the calling program to have more than 16MB info. So that
I can test this APi. The result is it Failed since ConHadle is not
working. And Empty Ds, I thought of defining subfields and i forgot

Thanks Dennis.

Please Help in taking up this issue to IBM for fixing.

Thanks
Bhargava.


On Mon, May 17, 2010 at 3:26 AM, Dennis Lovelady <iseries@xxxxxxxxxxxx> wrote:
What is this intended to do?

d                 ds
d Str1            s        9999999a
d Str2            s        9999999a

I see two things strange about this.  First is an unnamed, unsized data
structure with no subfields.  What is that?  Second is the size of each:
str1 and str2.  At least on V5R3 that cannot be compiled as is.  And if I
could compile it, I'm fairly certain it wouldn't have the desired effect.

Again, you would do well to create your user spaces small and extendable.
It's a shame to chew up 16MB chunks when you might need only a few KB.  The
code to do extension is freely available at
http://www.lovelady.com/api-samp/  Note that although it's set up as a
program, it's intended to be a module for your service program or for bind
by copy.

Beyond that, I may have time to look at this over the next day or so, but my
evening is spoken for.

Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"Inanimate objects are classified scientifically into three major categories
- those that don't work, those that break down, and those that get lost."
       -- Russell Baker


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.





--
bhargav

2009 Winner: Broadridge receives “Top Overall Honors" for 2 consecutive
years in the Black Book of Outsourcing Brokerage Process Service
Provider Survey.  Learn more at http://www.broadridge.com/ranked1/



“THANK GOD IT’S MONDAY!” Sounds interesting? Know more @
www.broadridge.com.


This message and any attachments are intended only for the use of the
addressee and may contain information that is privileged and
confidential. If the reader of the message is not the intended
recipient or an authorized representative of the intended recipient,
you are hereby notified that any dissemination of this communication is
strictly prohibited. If you have received this communication in error,
please notify us immediately by e-mail and delete the message and any
attachments from your system.


--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.





--
bhargav





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.