|
On Tue, 30 Apr 2002, Lori Crane wrote: > > I have a question on RPGLE and Parameters. Can anyone tell me if there are > any limitations on the length of paramters. We are trying to create > headers(and pass them to several programs) and we have the following > parameters. > This is a difficult question to answer... It depends on what you mean. First of all, let me make an assumption. Since you say "(and pass them to several programs)" I'll assume that you mean parameters passed to a program, as opposed to parameters passed to a procedure. This makes a difference, since parameters passed to a procedure by value are limited by the size of a variable you can declare in RPG. Parameters passed to a program are passed by reference. This means that, behind the scenes, all that actually gets passed from one program to another is the "address in memory" of the data. Consequently, the length of the actual data really doesn't matter to the parameter passing mechanism. The max length in that case is the max length of a variable that you can define. Of course, packed numbers can only be up to 16 bytes long, zoned can be up to 30, integer can be up to 8, etc... But I'm assuming that you're not asking about the length of specific types, but rather tha max possible length of anything. Since the data is passed by reference, you can pass an address to a block of memory that you've allocated manually, using the RPG ALLOC op-code, the C malloc() function, or some similar mechanism. In that case, the maximum size of an allocation is the factor, rather than the max size of a variable. The max size of an allocation (at least, at the moment) is 16776704 bytes. (yes, that's 16mb - 1) Whew. That's quite a bit larger than 180 bytes. :) So, those are RPG's maximums. Then, you need to look at where they are being passed _from_ to see if there's anything to take into consideration on that end. For example, there's the classic case of calling a program from the command line, where the system allocates 32 bytes for your parameter, no matter how long your program thinks it is. But, I won't get into gory details, since that's probably the most frequently asked question around here, I'll just point you to the FAQ: http://faq.midrange.com/data/cache/70.html I feel as though I've answered your question, but I'm not really sure that I've helped :)
As an Amazon Associate we earn from qualifying purchases.
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.