What's New in V4R2?

The major enhancements to RPG IV since V3R7 are the support for variable-length fields, several enhancements relating to indicators, and the ability to specify compile options on the control specifications. These further improve the RPG product for integration with the OS/400 operating system and ILE interlanguage communication.

The following list describes these enhancements:

In addition, the following new function has been added:

The following tables summarize the changed and new language elements, based on the part of the language affected.

Table 15. Changed Language Elements Since V3R7
Language Unit Element Description
Control specification keywords DECEDIT(*JOBRUN | 'value') The decimal edit value can now be determined dynamically at runtime from the job or system value.
Definition specification keywords DTAARA {(data_area_name)} Users can now access logical data areas.
EXPORT {(external_name)} The external name of the variable being exported can now be specified as a parameter for this keyword.
IMPORT {(external_name)} The external name of the variable being imported can now be specified as a parameter for this keyword.
OVERLAY(name{:pos}) The name parameter can now be the name of the current data structure.
Extended century format *CYMD (cyy/mm/dd) The valid values for the century character 'c' are now:
    'c'           Years
   -----------------------
     0          1900-1999
     1          2000-2099
     .              .
     .              .
     .              .
     9          2800-2899
Internal data type N (Indicator format) Added to the list of allowed internal data types on the definition specifications. Defines character data in the indicator format.
Data format N (Indicator format) Indicator format added to the list of allowed data formats on the input and output specifications for program described files.
Data Attribute *VAR Added to the list of allowed data attributes on the input and output specifications for program described files. It is used to specify variable-length fields.
Command parameter FIXNBR The *INPUTPACKED parameter has been added to handle packed-decimal data that is not valid.
Table 16. New Language Elements Since V3R7
Language Unit New Description
Control specification keywords ACTGRP(*NEW | *CALLER | 'activation- group-name') The ACTGRP keyword allows you to specify the activation group the program is associated with when it is called.
ALWNULL(*NO | *INPUTONLY | *USRCTL) The ALWNULL keyword specifies how you will use records containing null-capable fields from externally described database files.
AUT(*LIBRCRTAUT | *ALL | *CHANGE | *USE | *EXCLUDE | 'authorization-list-name') The AUT keyword specifies the authority given to users who do not have specific authority to the object, who are not on the authorization list, and whose user group has no specific authority to the object.
BNDDIR( 'binding -directory-name' {:'binding- directory-name'...}) The BNDDIR keyword specifies the list of binding directories that are used in symbol resolution.
CVTOPT(*{NO}DATETIME *{NO}GRAPHIC *{NO}VARCHAR *{NO}VARGRAPHIC) The CVTOPT keyword is used to determine how the ILE RPG compiler handles date, time, timestamp, graphic data types, and variable-length data types that are retrieved from externally described database files.
DFTACTGRP(*YES | *NO) The DFTACTGRP keyword specifies the activation group in which the created program will run when it is called.
ENBPFRCOL(*PEP | *ENTRYEXIT | *FULL) The ENBPFRCOL keyword specifies whether performance collection is enabled.
FIXNBR(*{NO}ZONED *{NO}INPUTPACKED) The FIXNBR keyword specifies whether decimal data that is not valid is fixed by the compiler.
GENLVL(number) The GENLVL keyword controls the creation of the object.
INDENT(*NONE | 'character-value') The INDENT keyword specifies whether structured operations should be indented in the source listing for enhanced readability.
LANGID(*JOBRUN | *JOB | 'language-identifier') The LANGID keyword indicates which language identifier is to be used when the sort sequence is *LANGIDUNQ or *LANGIDSHR.
OPTIMIZE(*NONE | *BASIC | *FULL) The OPTIMIZE keyword specifies the level of optimization, if any, of the object.
OPTION(*{NO}XREF *{NO}GEN *{NO}SECLVL *{NO}SHOWCPY *{NO}EXPDDS *{NO}EXT *{NO}SHOWSKP) The OPTION keyword specifies the options to use when the source member is compiled.
PRFDTA(*NOCOL | *COL) The PRFDTA keyword specifies whether the collection of profiling data is enabled.
SRTSEQ(*HEX | *JOB | *JOBRUN | *LANGIDUNQ | *LANGIDSHR | 'sort-table-name') The SRTSEQ keyword specifies the sort sequence table that is to be used in the ILE RPG source program.
TEXT(*SRCMBRTXT | *BLANK | 'description') The TEXT keyword allows you to enter text that briefly describes the object and its function.
TRUNCNBR(*YES | *NO) The TRUNCNBR keyword specifies if the truncated value is moved to the result field or if an error is generated when numeric overflow occurs while running the object.
USRPRF(*USER | *OWNER) The USRPRF keyword specifies the user profile that will run the created program object.
File Description Specification keywords INDDS( data_structure_name) The INDDS keyword lets you associate a data structure name with the INDARA indicators for a workstation or printer file.
Definition specification keywords VARYING Defines variable-length fields when specified on character data or graphic data.
Built-in functions %CHAR(graphic, date, time or timestamp expression) Returns the value in a character data type.
%EOF{file name} Returns '1' if the most recent file input operation or write to a subfile (for a particular file, if specified) ended in an end-of-file or beginning-of-file condition; otherwise, it returns '0'.
%EQUAL{file name} Returns '1' if the most recent SETLL (for a particular file, if specified) or LOOKUP operation found an exact match; otherwise, it returns '0'.
%ERROR Returns '1' if the most recent operation code with extender 'E' specified resulted in an error; otherwise, it returns '0'.
%FOUND{file name} Returns '1' if the most recent relevant operation (for a particular file, if specified) found a record (CHAIN, DELETE, SETGT, SETLL), an element (LOOKUP), or a match (CHECK, CHECKR and SCAN); otherwise, it returns '0'.
%OPEN(file name) Returns '1' if the specified file is open and '0' if the specified file is closed.
%REPLACE(replacement string: source string {:start position {:source length to replace}}) Returns the string produced by inserting a replacement string into a source string, starting at the start position and replacing the specified number of characters.
%STATUS{file name} If no program or file error occurred since the most recent operation code with extender 'E' specified, it returns 0. If an error occurred, it returns the most recent value set for any program or file status. If a file is specified, the value returned is the most recent status for that file.
Operation code Extender E Allows for error handling using the %ERROR and %STATUS built-in functions on the CALLP operation and all operations that allow error indicators.
New century formats *CMDY (cmm/dd/yy) To be used by the MOVE, MOVEL, and TEST operations.
*CDMY (cdd/mm/yy) To be used by the MOVE, MOVEL, and TEST operations.
New 4-digit year format *LONGJUL (yyyy/ddd) To be used by the MOVE, MOVEL, and TEST operations.
Command parameters PRFDTA The PRFDTA parameter specifies whether the collection of profiling data is enabled.
BNDDIR The BNDDIR parameter was previously only allowed on the CRTBNDRPG command and not on the CRTRPGMOD command, now it is allowed on both commands.


[ Top of Page | Previous Page | Next Page | Contents | Index ]