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 Feb 21, 2019

Provide full backwards compatibility in free-form calculations

The free-form enhancements are a dramatic advancement for the language, but they are not fully backwards compatible with existing fixed-form RPG programs. If we want customers to modernize their existing code, there must be a seamless way to provide for that transition. The differences seem to be arbitrary in some cases, which make it impossible to automatically convert fixed-form to free-form without manual intervention and review.

Please provide some kind of "backwards compatibility switch", through a CRTRPGxxx parameter or GENLVL or possibly some kind of markup in the generated source or whatever you think would provide the best solution to the problems described below:

Different BIF indicator behavior (high)
Numeric overflow/truncation behavior (critical)
Language changes (medium)


Use Case:

%Check (or %CheckR) BIF, does not update the %Found indicator (unlike the CHECK/CHECKR opcodes)

BIF %Scan does not update the %Found indicator (unlike the SCAN opcode)

%LookUpXX (or %TLookUpXX) BIF, used to convert the operation code LOOKUP, does not update the indicators %Found and %Equal.

Maybe you could add an EVAL extender like EVAL(I) that would set those indicators in a compatible way?
EVAL(I) x=%LOOKUP(value: array);


Most critically, numeric truncation/overflow works differently in free-form code (and causes a run-time error) – in fixed-form code these overflow conditions are automatically monitored for and ignored:
Z-ADD, Z-SUB, PARM (when factor 1 or factor 2 are specified)
ADD, SUB, MULT, DIV

Maybe you could simply add a new extender for "overflow management" something like EVAL(O):
EVAL(O) val = x * .01;

...and/or add a new value on the CRTxxxRPG parameter TRUNCNBR like (*ALL) e.g. CRTBNDRPG TRUNCNBR(*ALL) would do numeric truncation just like the default *YES does for fixed-format specifications.



And then finally, some fixed-form code is simply much more clean/elegant than the corresponding free-form code, for instance
MOVEL '123' CHAR3 3
MOVE CHAR3 PKD52 5 2

Becomes this fairly unreadable code:
CHAR3 = '123';
PKD52 = %Dec(%Subst(%EditC(PKD52:'X'):1:2) + %XLate(' ':'0':CHAR3) :5:0) / 100;

Much nicer, of course, would be something like a EVALR(V) "move" or EVALR(N) "no pad" extender {i.e. the opposite of MOVE(P)} or BIF:
EVALR(V) PKD52 = CHAR3;
Or
EVALR(N) PKD52 = CHAR3;
Or
PKD52 = %MOVE(CHAR3:PKD52);


Also admittedly, GOTO is evil, but even languages like C++ support it and is required in some cases to be fully compatible. If GOTO is not supported, at least allow labeled break/continue:

START TAG
1 DOWEQ 1
X IFEQ Y
GOTO START
Y IFEQ Z
GOTO EXIT
ENDIF
ENDIF
ENDDO
EXIT TAG

Free-form:

START:
DOW 1=1;
IF X=Y;
ITER START;
IF Y=Z;
LEAVE START; // OR LEAVE EXIT, that's kind of non-standard but ok I guess...
ENDIF;
ENDIF;
ENDDO;
EXIT:


And is there any reason we need to use a ';' at the end of an IF statement?!? That is extremely confusing, surely the RPG parser could use a different token, something like this:

IF cusno=10 THEN
cusno++;

...instead of this?!? (which implies a null execution path in every single other language in the world except for RPG)
IF cusno=10;
cusno++;


Idea priority High
  • Guest
    Reply
    |
    Mar 8, 2019

    IBM does not intend to provide a solution to this request at this time, so it is being closed.

  • Guest
    Reply
    |
    Feb 22, 2019

    There is no way to vote _against_ an RFE so IBM please take this as one HUGE NEGATIVE VOTE.

    We do not need or want the vast majority of the suggested functionality and certainly not to start setting %Found etc. on Scans.

    We went through these discussions back in V5 when free-form was introduced - that was 15 years ago. And it wasn't a good idea then either.

  • Guest
    Reply
    |
    Feb 22, 2019

    With all the 3rd party conversion to free format tools there are, some free of cost and some not, I don't see much benefit on IBM spending time on this. We've had free format RPG now for like 18 years.

    I'd much prefer to see IBM spend time enhancing the language in more ways than just being backward compatible.

    Jason