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


  • Subject: Re: Parameter limitation - Please help
  • From: "Dave Wall" <dawall@xxxxxxxxxx>
  • Date: Tue, 5 Dec 2000 14:21:43 -0600
  • Importance: Normal


Sorry, the server limit for the number of parameters the Toolbox can pass
to a program is 35.  One technique others have used to get around the limit
is to combine multiple values into a single parameter.  I know of two
popular techniques to combine values into a singe parm.  In one case a
format identifier is the first thing in the parm (or is passed in another
parm).  The target program reads the format to understand how data in the
parm is laid out.  This technique is often used in AS/400 APIs.  Another
technique is to define each value in a "length, type, data" group.  These
groups are placed in a single parm and parsed by the target.

Suppose, for example, you combine a short, an integer, and two strings in a
parameter.  With technique 1 the parameter would look like
   0100 01 0002 String1 String2
Where 0100 is the format, 01 is the short, 0002 is the int, and the two
strings follow.  This buffer is actually bad because it is not obvious
where the first string ends and the second begins.  You can do that with
length indicators, or make the strings be constant length.  If at a later
date you decide to pass more info in the parm, you update the format to
tell the target the change.

To use the second technique the parm would be
   0008 01 01
   000A 02 0002
   000D 03 String1
   000D 03 String2
The first four bytes are the length of the group, the next two describe
what is coming (01=short, 02=int, 03=string), and the data follows.  The
pattern is repeated for each value.

I think the first technique works best when the data tends to be fixed
length.  Parsing at the target can be messy when there are a lot of
variable length fields.  Variable length fields are not a problem with the
second technique because every value is parsed.  Performance can be a
problem with the second technique because every value must be parsed.  You
can also combine the two techniques.  Put fixed length values at the front
of the parm (preceeded by a format id) and follow them with
length/type/data groups.  Only the variable length things will be parsed.
I hope this helps,

David Wall
AS/400 Toolbox for Java


Madhavan <seawolf00@yahoo.com>@midrange.com on 12/04/2000 08:19:59 PM

Please respond to JAVA400-L@midrange.com

Sent by:  owner-java400-l@midrange.com


To:   java400-l@midrange.com
cc:
Subject:  Parameter limitation - Please help



Hi All,

I am calling a C program sitting on As400 (ILE C *PGM)
from a Java class on the client and possibly see a
scenario of more than 50 parameters. But the
limitation on ProgramParameter seems to be 35 !! Is
there any other way of issuing calls with more than 35
parameters ???? (I get a
"com.ibm.as400.access.ExtendedIllegalArgumentException:
parameterList: Length is not valid"
 error)

Please help !
Thanks
madhavan

__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/
+---
| This is the JAVA/400 Mailing List!
| To submit a new message, send your mail to JAVA400-L@midrange.com.
| To subscribe to this list send email to JAVA400-L-SUB@midrange.com.
| To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner: joe@zappie.net
+---



+---
| This is the JAVA/400 Mailing List!
| To submit a new message, send your mail to JAVA400-L@midrange.com.
| To subscribe to this list send email to JAVA400-L-SUB@midrange.com.
| To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner: joe@zappie.net
+---

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.