ILE RPG Built-in-functions. %ABS – Absolute Value of Expression. %ADDR – Get Address of Variable. %ALLOC – Allocate Storage. %CHAR – Convert to. In addition, under OS/ V3R2 and V3R7 the %PARMS built-in function was introduced. Since then, several built-in functions have been added to RPG IV. ‘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.

Author: Mooguzahn Mikagar
Country: Mayotte
Language: English (Spanish)
Genre: History
Published (Last): 2 March 2011
Pages: 325
PDF File Size: 14.28 Mb
ePub File Size: 6.98 Mb
ISBN: 823-1-16803-701-4
Downloads: 14834
Price: Free* [*Free Regsitration Required]
Uploader: Tahn

When the string parameter is varying length, the values of the other parameters are checked against the current length, not the maximum length.

The following table lists the built-in functions, their arguments, and the value they return. If the operation cannot complete successfully, exception or is issued.

For the SETLL operation, this function returns ‘1’ if a record is present whose key or relative record number is equal to the search argument. This method requires an Object of class Employee. The index must be either a numeric literal or a numeric constant.

The length may be greater than or equal to zero. The result begins at the specified starting position in the variable and continues for the length specified.

If the first parameter is a date, do not specify the second parameter. A wide range of built in functions are available. By default, the entire array is searched.


The fieldname can be a null-capable array element, data structure, stand-alone field, subfield, or multiple occurrence data structure.

For two dates or a date and a timestamp: The value may range from one to the current funvtions of the source string plus one.

The following units are valid: The constant can be a literal, named constant or an expression whose value can be determined at compile time.

The first parameter epgle the date, time, or timestamp value. For information on the input formats that can be used, see Time Data Type.

In most cases, the result of adding or subtracting a given number of months is obvious. The value returned by the function is compatible with both type numeric and type duration. In the second parameter, the edit code is specified as a character constant; supported edit codes are: Rpble second parameter, if specified, must be a numeric value with zero decimal positions.

The result has the same sign as the dividend. Data corruption will occur if both of the following are true: Rpglle content of a null-capable field remains unchanged.

If either operand is an integer numeric value, the result is integer. For functiosn, lets assume that Value is set to The converted value remains unchanged, but is returned as a date. Otherwise, status will be set at run time but no error message will be given.

%SCANR (Scan Reverse for Characters)

For all other data types, the value returned is the number of bytes of the value. Sign-up for e-mail notifications Take our weekly poll.


For information on the input formats that can be used, see Date Data Type. If it is not specified, the starting position is at the beginning of the source string. The type of the return value is unsigned integer. All rpfle must have the same type. At run time, status is set and no error message is issued. If these parameters are omitted, the precision and decimal places are taken from the attributes of numeric expression.

The edit word must be a character constant. The left-hand value must be a date or timestamp. The syntax of built-in-functions is: If the set length is greater than the current length, the fuctions in the field between the old length epgle the new length are set to blanks.

Built-in Functions

If zero is specified, then the replacement string is inserted before the specified starting position. If the argument is a 4-byte float field, the buil is 14 characters. Unindexed arrays are not allowed for start and length. The fourth parameter is a non-float numeric with zero decimal positions. For more information, see Memory Management Operations.