IBM Support

RPG Cafe: Fall 2024: New built-in functions %HIVAL and %LOVAL

News


Abstract

Information about the PTFs to provide the ILE RPG enhancement to add new built-in functions %HIVAL and %LOVAL

Content

You are in: RPG Cafe > RPG Cafe: Fall 2024: New built-in functions %HIVAL and %LOVAL

Short URL: https://ibm.biz/rpgcafe_fall_2024_bifs_hival_loval

Fall 2024: New built-in functions %HIVAL and %LOVAL

  • %HIVAL returns the highest possible value of a variable or the highest value in an enumeration.
  • %LOVAL: returns the lowest possible value of a variable or the lowest value in an enumeration.

Details

Using %HIVAL and %LOVAL with a variable

          dcl-s total packed(7:2) inz(99999);
          dcl-s amount packed(5:2) inz(5);

          if total + amount > %hival(total);
             snd-msg *escape 'Variable "total" is not big enough for '
                           + %char(total + amount);
          endif;

Using %HIVAL and %LOVAL with an enumeration

          dcl-enum fabric_widths qualified;
             extra_wide 144.8;
             medium  75.9;
             narrow 50.2;
             wide 111.2;
          end-enum;
          dcl-s width_request packed(5:2);

          if width_request > %hival(fabric_widths);
             // The request cannot be fulfilled
          endif;
          return;
.                                                            .
.                                                            .

PTFs for 7.4 and 7.5

7.4:

  • ILE RPG compiler: 5770WDS SJ02912

7.5:

  • ILE RPG compiler: 5770WDS SJ02922
  • ILE RPG compiler, TGTRLS(V7R4M0): 5770WDS SJ02923

RDi support

The next update for RDi will support these enhancements.

Documentation

The 7.4 and 7.5 ILE RPG Reference and ILE RPG Programmer's Guide are updated with full information about these enhancements.

[{"Type":"MASTER","Line of Business":{"code":"LOB73","label":"Power TPS"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SS69QP","label":"Rational Development Studio for i"},"ARM Category":[],"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.4.0;7.5.0;and future releases"}]

Document Information

Modified date:
12 December 2024

UID

ibm17172133