× 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'm trying to figure out how to pass an arrray from
RPGLE to a CLP (just pass
 thru) and to another RPGLE, but I'm stuck now. If the
pointer guru, Scott
 Klement, or Hans & Barbara can help it would be
great.

Here's the thing:
I have a wrapper CLP, where I declared this vars:
   Dcl  &ArrWhs      *Char     1         
   Dcl  &NbrWhs      *Dec     (3 0)   0  
   Dcl  &OkFlag      *Char     1         

It will call an RPGLE pgm and it will build an array
to be passed back. Here's
 the prototype:

 *Entry parms Prototype: - Array of Authorized
Divisio(
Divspwhchkr     PR                                    
               D         
                       2  0 dim(99) 
D                                3  
Divspwhchkr     PI                                    
             
D  p1_AuthWhs                    2  0 dim(99)
D  p1_NbrWhs                     3  

Then the CL will pass that array to be used for
another RPGLE program:
d ReleaseEm       pr                  EXTPGM(
'IVSPRELSER' )   
d                                2  0 dim(99)         
   
d                                3  0                 
   
d                                1                    
        
                                                      
        
d ReleaseEm       pi                                  
        
d  p1_whsArr                     2  0 dim(99) 
d  p1_numArr                     3  0 
d  p1_exitType                   1 

In this program I get the Address of the parameter and
try to move it to be used
 for the program:
d ptr_whsArr      s               *                   
        
d whsArr          s              2  0 dim(99)
based(ptr_whsArr)
d atWhsArr        s              3  0 dim(99)
inz(*hival)      
d xx              s              3  0 inz(0)          
        

c                   if        p1_numArr > 0           
   
c                   if        %addr(p1_whsArr) <>
*null   
c                   eval      ptr_whsArr =
%addr(p1_whsArr)

c                   for       xx = 1 by 1 to p1_numArr
 
c                   eval      atWhsArr(xx) =
whsArr(xx) 
c                   endfor                            
 
 
c                   endif   
c                   endif   

But, once I assign the Address of p1_whsArr parameter,
I got a corrupted array.
 Hence, I got a decimal data error. Can someone tell
me where I got it wrong? Do
 I really need to declare the variable in CL as big as
%ELEM * %LEN? 

Thanks!

Jean Reksodiputro


__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

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.