Midware Ltd.

Variable Length Parms

Home
Services
News
AS/400
Employment

Sign-up for e-mail notifications

Take our weekly poll

Dow Jones Intraday

Nasdaq Intraday

 

 

One of the more robust features of ILE is the ability to define customized parameter lists (interfaces) for procedures.  In addition to defining the field lengths and types, you can also define fields that are optional (or may be omitted), constants, parameters passed by value, and much more.

You can also define character strings to have a variable length.  This is an important feature if you develop procedure to do string manipulation (such as parsing words from a sentence).  Use the OPTIONS(*VARSIZE) keyword in the procedure interface and prototype to define a variable length string.

It is important however, not just to define the field as variable length, but also to retrieve the actual length of the field passed.  To do this, you need to explicitly code the procedure to pass operational descriptors.  This is done by coding the OPDESC keyword on the procedure itself.

Then, use the IBM-supplied API CEEDOD to retrieve the length of the passed parm.

See the variable size strings page of the RPG IV tutorial section for examples of all this.

 
Home Feedback Contents Search

Send mail to midware@midwareservices.com with questions or comments about this web site.
Copyright © 2000 Midware, Ltd.

Last Modified:  September 15, 2000