Skip to Main Content
IBM Power Ideas Portal


This portal is to open public enhancement requests against IBM Power Systems products, including IBM i. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).


Shape the future of IBM!

We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:

Search existing ideas

Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,

Post your ideas
  1. Post an idea.

  2. Get feedback from the IBM team and other customers to refine your idea.

  3. Follow the idea through the IBM Ideas process.


Specific links you will want to bookmark for future use

Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.

IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.

ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.

Status Not under consideration
Workspace IBM i
Created by Guest
Created on Nov 28, 2018

CL variables can't be qualified to that variable.

Currently CL variables whose storage is defined inside another variable (known in RPG as a data structure) cannot be qualified to that variable. CL modules are getting more and more complex given the expanded features IBM has introduced. The number of variables are getting larger and so are the number of data structure sub-fields and they must have unique names within the module. It is getting harder and harder to devise self-documenting field names with only 10 characters to work with, which was the problem that RPG had for many years before IBM allowed for qualified data structures.


Use Case:

Current workaround: There is no work-around. Unique sub-field names have to be devised and heavily documented so that other programmers will know what is going on.

Proposed resolution: I propose changing the DEFVAR parameter in the DCL command to have a 3rd element. It would have a default of *UNQUAL (for an unqualified sub-field) and it would allow a 2nd value of *QUAL (for a qualified sub-field).

DCL VAR(&QUALNAME) TYPE(*CHAR) LEN(20)
DCL VAR(&NAME) TYPE(*CHAR) STG(*DEFINED) LEN(10) +
DEFVAR(&QUALNAME 1 *QUAL)
DCL VAR(&LIB) TYPE(*CHAR) STG(*DEFINED) LEN(10) +
DEFVAR(&QUALNAME 11 *QUAL)

Variables declared this way can only be referenced with the qualifying name they're defined in, like so:

CHGVAR VAR(&QUALNAME:&NAME) VALUE('MYOBJ')
CHGVAR VAR(&QUALNAME:&LIB) VALUE('*LIBL')

This way other CL data structures can be defined with the same sub-fields:

DCL VAR(&OUTQ) TYPE(*CHAR) LEN(20)
DCL VAR(&NAME) TYPE(*CHAR) STG(*DEFINED) LEN(10) +
DEFVAR(&OUTQ 1 *QUAL)
DCL VAR(&LIB) TYPE(*CHAR) STG(*DEFINED) LEN(10) +
DEFVAR(&OUTQ 11 *QUAL)

CHGVAR VAR(&OUTQ:&NAME) VALUE('MYOUTQ')
CHGVAR VAR(&OUTQ:&LIB) VALUE('MYLIB')

(In RPG the separator character is a period(.) but in CL it's a valid character in variable names, so another character was needed. The best fit for this seemed to be the colon(:) character.)

Of course, if need be the entire data structure can also be referenced as:

CHGVAR VAR(&QUALNAME) VALUE('MYOBJ *LIBL')


Idea priority Medium
  • Guest
    Reply
    |
    Jun 6, 2022

    You want to have more and more features of RPG in the CL language. It would be more helpful and productive to use RPG instead and add the ability to issue a CL command directly from within RPG, without QCMDEXC.

    Commands that use return variables will be more comfortable in RPG.

  • Guest
    Reply
    |
    Jun 12, 2019

    The cost to implement would not be worth the benefit.

  • Guest
    Reply
    |
    Jan 29, 2019

    A group of 3 RFEs are related enhancements that COMMON Americas Advisory Council (CAAC) believes would work well together to enhance the CL language capabilities, so I am linking them together: 127728, 127731, 127732.

    Nancy Uthke-Schmucki - CAAC Program Manager

  • Guest
    Reply
    |
    Jan 29, 2019

    The CAAC has reviewed this requirement and recommends that IBM view this as a high priority requirement that is important to be addressed. This would add to the ability to work with APIs by expanding the relatively new *DEFINED declarations to be able to qualify variable names, and then have multiple instances of a data structure.

    Background: The COMMON Americas Advisory Council (CAAC) members have a broad range of experience in working with small and medium-sized IBM i customers. CAAC has a key role in working with IBM i development to help assess the value and impact of individual RFEs on the broader IBM i community, and has therefore reviewed your RFE.

    For more information about CAAC, see www.common.org/caac

    For more details about CAAC's role with RFEs, see http://www.ibmsystemsmag.com/Blogs/i-Can/May-2017/COMMON-Americas-Advisory-Council-%28CAAC%29-and-RFEs/

    Nancy Uthke-Schmucki - CAAC Program Manager

  • Guest
    Reply
    |
    Dec 7, 2018

    IBM has modified some of the information in this request. In particular, the Source was updated to indicate this RFE came from the COMMON User Group. Please contact us if you have any questions.

  • Guest
    Reply
    |
    Dec 3, 2018

    The CL language is lacking a lot behind HLL like RPG.

    Instead of adding one function or two, it would be more wise to add the ability to execute CL commands directly from within RPG. Like SQL. and have everything in one language. It a bit silly to have a CL program for just one or 2 lines, like RTVSYSVAL or CPYF.

    Just add EXEC CL from within RPG, similar to EXEC SQL.

  • Guest
    Reply
    |
    Nov 29, 2018

    An additional suggestion of *FIRST and *NEXT values for the position parameter would be helpful.

  • Guest
    Reply
    |
    Nov 28, 2018

    I would suggest using the same syntax as when there are multiple files declared in a CL program where the field names for a file are prefixed by the OPNID parameter value and an underscore. So the qualified field names of a data structure would be:

    DCL VAR(&OUTQ) TYPE(*CHAR) LEN(20)
    DCL VAR(&NAME) TYPE(*CHAR) STG(*DEFINED) LEN(10) DEFVAR(&OUTQ 1 *QUAL)
    DCL VAR(&LIB) TYPE(*CHAR) STG(*DEFINED) LEN(10) DEFVAR(&OUTQ 11 *QUAL)

    CHGVAR VAR(&OUTQ_NAME) VALUE('MYOUTQ')
    CHGVAR VAR(&OUTQ_LIB) VALUE('MYLIB')