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



I believe that, as Barbara said, you need only a 1-character variable in CL, since it is really getting the pointer to that variable, then pass it along without using it. The original array memory is allocated in your job and will remain so through the various calls. I think I used a similar trick when passing floats between CL to RPG - just had a *CHAR variable large enough to hold the float (4 or 8).

Vern

At 12:20 PM 7/24/2003 +0530, you wrote:
fkany,

Pass single Character type value to the CLP, then Pass the same to the RPG
Pgm, there Use
a data structure to bifurcate your flat field to array elements.

D FRED          DS
D Field1              1 1000 DIM(500)
....
C    *ENTRY    Plist
C              PARM                       FRED

Again, it depends on the Size of the Array. There is a limitation in CL that
you can have a character variable with the length 9999. If your Array is of
size 1000,each element would be of length 10, then this way you can't
proceed.

Thanks
Murugesh




-----Original Message----- From: Barbara Morris [mailto:bmorris@xxxxxxxxxx] Sent: Wednesday, July 23, 2003 11:19 PM To: midrange-l@xxxxxxxxxxxx Subject: Re: DCL array variable in CL


fkany@xxxxxxxxxxxxxxxxxx wrote: > > Is it possible to define an array variable in a CL program? I have an RPG > program that receives parms(some parms are arrays) and generates a couple > reports. I want to call a CL program that will OVRPRTF the generated > reports to an OUTQ, but I need to pass the array parms into the CL so that > it can execute the RPG program. I've looked in my CL book and CL > programming.pdf's but can't find anything on defining an array. I'm trying > to pass arrays defined as character. I asked a co-worker and they said > something about breaking the array up into fields and passing the all the > new fields. We're at V5R2. >

Frank, if the CL just needs to pass on the array parameter, and doesn't
actually need to use the array data, you can define the array parameter
in CL as anything you want.

Parameters are passed to CL by reference, and passed on from CL by
reference, meaning that pointers are being passed around.  If the CL
program isn't ever going to use the parameter value, it doesn't matter
what the CL program thinks the parameter-pointer is pointing at.

(I usually define pass-through CL parameters as char(1), although that
breaks my own rule that says "Never lie to the compiler".)



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.