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
Categories Languages - RPG
Created by Guest
Created on Apr 12, 2017

Recursive program call static variables

With use of THREAD(*CONCURRENT) for "MRT" programs (recursive call'able) we are missing a new type of 'static' variables:
Program level:
1) Static GLOBAL variables (Shared for ALL recursive call instances) – ok (default)
2) GLOBAL variables (Unique for each recursive call instance) – missing
Procedure level:
3) Locale variables (Unique for each procedure call level) – ok (default)
4) Static GLOBAL variables (Shared for ALL recursive program/procedure call instances) – ok (static kwd)
5) GLOBAL variables (Unique for each recursive program call instance) – missing


Use Case:

Next step could be one way of describing it.
Minimizing the difference to other languages is a step in the right direction.


Idea priority High
  • Guest
    Reply
    |
    Apr 19, 2017

    It is very unlikely that IBM will add a new type of static storage, so this request is being closed.

    However, if you use ACTGRP(*NEW) for the program, then every call to the program would have its own static variables.

    If you need some static variables to be unique for each call to the program and other static variable to be shared by all calls to a program, then the way to do that is to define the shared variables in a service program with a named activation group and use getter and setter procedures to access them. The variables that should be unique for each call to the *NEW program would be defined as normal static variables in the program.

  • Guest
    Reply
    |
    Apr 19, 2017

    I give you, this is not a proper way to describe this. Let me try again.
    Traditionally we handled recursive calls by copying the program to QTEMP and calling it there. That way global variables was local to the new object.
    By using the native possibility to call recursively the global variables are Global/Global!
    This means that the transition is not just to implement recursive calls. That would introduce serious errors!
    Our new coding template is all about procedures and this helps to minimize the problem, but we are forced to use existing code for many years to come.

    May be a keyword that indicates that this is a static variable on module level could help here.

    We will be happy to deliver a code example if the above makes no sense!

  • Guest
    Reply
    |
    Apr 13, 2017

    Hello, Pete. You mentioned that this would minimize the difference to other languages. Could you give an example of how your requirement works in another language, with specific syntax for that language?