What's New in V3R7?

The major enhancements to RPG IV since V3R6 are the new support for database null fields, and the ability to better control the precision of intermediate results in expressions. Other enhancements include the addition of a floating point data type and support for null-terminated strings. These further improve the RPG product for integration with the OS/400 operating system and ILE interlanguage communication. This means greater flexibility for developing applications.

The following is a list of these enhancements including a number of new built-in functions and usability enhancements:

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

Table 17. Changed Language Elements Since V3R6
Language Unit Element Description
Definition specification keywords ALIGN ALIGN can now be used to align float subfields along with the previously supported integer and unsigned alignment.
OPTIONS(*NOPASS *OMIT *VARSIZE *STRING) The *STRING option allows you to pass a character value as a null-terminated string.
Record address type F (Float format) Added to the list of allowed record address types on the file description specifications. Signals float processing for a program described file.
Internal data type F (Float format) Added to the list of allowed internal data types on the definition specifications. Defines a floating point standalone field, parameter, or data structure subfield.
Data format F (Float format) Added to the list of allowed data formats on the input and output specifications for program described files.
Table 18. New Language Elements Since V3R6
Language Unit New Description
Control specification keywords COPYNEST('1-2048') Specifies the maximum depth for nesting of /COPY directives.
EXPROPTS(*MAXDIGITS | *RESDECPOS) Expression options for type of precision (default or "Result Decimal Position" precision rules)
FLTDIV{(*NO | *YES)} Indicates that all divide operations in expressions are computed in floating point.
Definition specification keywords ALTSEQ(*NONE) Forces the normal collating sequence to be used for character comparison even when an alternate collating sequence is specified.
Built-in functions %ABS Returns the absolute value of the numeric expression specified as the parameter.
%DEC & %DECH Converts the value of the numeric expression to decimal (packed) format with the number of digits and decimal positions specified as parameters. %DECH is the same as %DEC, but with a half adjust applied.
%DECPOS Returns the number of decimal positions of the numeric variable or expression. The value returned is a constant, and may be used where a constant is expected.
%EDITC This function returns a character result representing the numeric value edited according to the edit code.
%EDITFLT Converts the value of the numeric expression to the character external display representation of float.
%EDITW This function returns a character result representing the numeric value edited according to the edit word.
%FLOAT Converts the value of the numeric expression to float format.
%INT & %INTH Converts the value of the numeric expression to integer. Any decimal digits are truncated with %INT and rounded with %INTH.
%LEN Returns the number of digits or characters of the variable expression.
%NULLIND Used to query or set the null indicator for null-capable fields.
%SCAN Returns the first position of the search argument in the source string, or 0 if it was not found.
%STR Used to create or use null-terminated strings, which are very commonly used in C and C++ applications.
%UNS & %UNSH Converts the value of the numeric expression to unsigned format. Any decimal digits are truncated with %UNS and rounded with %UNSH.
Operation code Extenders N Sets pointer to *NULL after successful DEALLOC
M Default precision rules
R No intermediate value will have fewer decimal positions than the result ("Result Decimal Position" precision rules)
Operation codes ALLOC Used to allocate storage dynamically.
DEALLOC Used to deallocate storage dynamically.
REALLOC Used to reallocate storage dynamically.


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