Chapter 4: Built-In Functions


OVERVIEW

The RPG language contains a rich set of operations. In addition to these operations, RPG supports a set of functions. These functions, known as built-in functions, perform various tasks—much like that of an operation code. Unlike operations, however, built-in functions return a value and, therefore, can be used as the parameter of a keyword on the definition specification or within an expression in the extended factor 2.

Built-in functions can be used with the IF, DOW, DOU, EVAL, EVALR, FOR, WHEN, RETURN, and CALLP operations. These operations support the extended factor 2 calculation specification. In addition, built-in functions can be used in the function/keyword area of the definition specification. They cannot, however, be used in the function/keyword area of the header or file specifications, and they cannot be used with traditional RPG operations such as the DO, IFEQ, and COMP operations. The two types of built-in functions are those that return a value that can be interpreted at:

  • Compile time.

  • Runtime.

Currently, only %SIZE, %LEN, %DECPOS, %ADDR, %PADDR and %ELEM are capable of returning values at compile time. Therefore, these are the only built-in functions that can be used with definition specification keywords.




The Modern RPG IV Language
The Modern RPG IV Language
ISBN: 1583470646
EAN: 2147483647
Year: 2003
Pages: 156
Authors: Robert Cozzi

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net