Skip to main content

IBM i Feature Requests and Requirements

 Last exported on by

Arrays in CLID: 212

    Click to rate
The CL language does not have array support, which is something that would be very useful.
Being able to traverse the elements in, for example, a library list without having to write a lot of code would be of great benefit to all. It would save a programmer's time that could be better spent on more useful endeavors.
Prior to getting pointer support one had to declare large fields, do a lot of calculating, and use %SST() functions. With pointers the calculations were the same, but the %SST() functions was replaced with pointer based fields. Either way the amount of code this required in CL gets really ugly.
A DIM parameter should be added to the DCL command. The array elements would be referenced with parentheses as is currently done in RPG: &MYFIELD(2), &THATFIELD(&I), etc. There is a problem when fields are defined in a variable that itself is an array. The way around this problem is to implement another requirement that I've proposed on this site, allowing CL data structures to be qualified. A sub-field in such a structure would be referenced as &MYDS(2):&SUBFIELD or &THATDS(&I):&THATSUB (The period(.) character cannot be used as a separator because it's a valid character in variable and object names, so I settled on the colon(:) character as a reasonable separator in CL.)

Responsibility Contacts

Originator

Admin Comments

As a member of the COMMON community, you can search our database of requirement requests.

If you cannot find an answer to your questions, click here to send us an email.