Built-in functions must begin with a % (percent) sign followed by the built-in function name. If the built-in function contains parameters, the function name is followed by the parameters enclosed in parentheses. Built-in function parameters are often referred to as arguments. These arguments can be any valid literal, field, expression, or another built-in function. When more than one argument is specified, they are separated by the : (colon) symbol. Spaces are not significant to built-in functions or expressions. All built-in functions have the following syntax:
%funct( arg1 : arg2 : ... argn )
For those built-in functions that do not support parameters, parentheses are not required. For example, %PARMS supports no parameters, so %PARMS or %PARMS() may be used. In earlier releases of RPG, (i.e., OS/400 Version 4 and earlier) empty parentheses were not allowed, so only %PARMS would be valid, and %PARMS() would be invalid. The syntax for built-in functions is the same as the syntax used when calling a subprocedure.