Follow

Supported PL/I Built-in Functions

Table of Contents

  1. Overview
  2. String handling
  3. Arithmetic & mathematical
  4. Arrays & aggregates
  5. Searching & comparison
  6. Date & time
  7. Storage, addresses & pointers
  8. Data conversion
  9. Condition & diagnostics
  10. CICS / system helpers
  11. Summary
  12. Related articles

Audience: developers checking which PL/I built-in functions the Heirloom PL/I compiler recognizes and translates. A reference companion to "Supported PL/I Statements" and "Supported PL/I Data Types."


Overview

This is a grouped reference to the PL/I built-in functions the compiler recognizes. In the generated Java they appear as static calls (for example SUBSTR(...) becomes Builtin.SUBSTR(...)), so they are easy to spot when reading the output — see Reading Your Generated Java.

Note: This is a summary of commonly used built-ins, not an exhaustive, argument-by-argument specification. Built-in names are case-insensitive. If you need confirmation that a specific built-in — or a specific argument form — is covered, contact Heirloom support with the detail.


String handling

Built-in Notes
SUBSTR Extract a substring
INDEX Position of a substring within a string (0 if absent)
LENGTH Length of a string
VERIFY Position of the first character not in a given set (0 if all valid)
TRANSLATE Translate characters by a mapping
TRIM Remove leading / trailing blanks
STRING Concatenate the elements of a structure/array into one string
REPEAT Repeat a string a number of times
CHARACTER / CHAR Convert a value to a character string
UPPERCASE / LOWERCASE Change case
HIGH / LOW String of highest / lowest character values
HEX Hexadecimal representation of a value

Arithmetic & mathematical

Built-in Notes
ABS Absolute value
MOD Remainder (modulo)
MAX / MIN Largest / smallest of the arguments
CEIL / FLOOR Round up / down to an integer
ROUND Round to a number of decimal places
TRUNC Truncate toward zero
ADD / MULTIPLY / DIVIDE Decimal arithmetic with explicit precision/scale
PRECISION Set the precision/scale of a value

Arrays & aggregates

Built-in Notes
DIM / DIMENSION Number of elements in an array dimension
HBOUND / LBOUND Upper / lower bound of an array dimension
HBOUNDACROSS / LBOUNDACROSS Bounds across dimensions of an aggregate
ALL / ANY Whether all / any array elements satisfy a test

Searching & comparison

Built-in Notes
SEARCH / SEARCHR Find an element in an array (forward / reverse)
INLIST Whether a value matches any value in a list
BETWEEN Whether a value falls between two bounds

Date & time

Built-in Notes
DATE Current date as a string
TIME Current time as a string
DATETIME Current date and time as a string
DAYS Day count from a reference date (with optional format)
SECS Second count from a reference time (with optional format)

Storage, addresses & pointers

Built-in Notes
ADDR Address (pointer) of a variable or storage
NULL / SYSNULL Null pointer value
STG / STORAGE Storage size of a variable or structure
CSTG Storage size in character units
SIZE Size of a variable in storage units
ALLOCATION / ALLOCN Whether / how much storage is allocated
POINTERADD / PTRADD Add an offset to a pointer
POINTERSUBTRACT Subtract an offset from a pointer
POINTERDIFF Difference between two pointers

Data conversion

Built-in Notes
DECIMAL / DEC Convert to decimal (with precision/scale)
BINARY Convert to fixed binary
FIXED Convert to fixed-point
UNSPEC The raw bit representation of a value

Condition & diagnostics

Built-in Notes
ONCODE Numeric code of the current condition
ONCHAR Character that triggered a CONVERSION condition
ONSOURCE Source field involved in a CONVERSION condition
SOURCELINE / SOURCEFILE Current source line / file
PROCNAME / PACKAGENAME Current procedure / package name
PLIDUMP Produce a diagnostic dump

CICS / system helpers

Built-in Notes
DFHRESP Numeric value of a CICS response keyword (e.g. NORMAL, NOTFND)
DFHVALUE Numeric value of a CICS value keyword
PLIRETV / PLIRETC Retrieve / set the PL/I return code
PLITDLI DL/I database call interface

The EXEC CICS execution-interface fields (e.g. EIBRESP, EIBCALEN, EIBTRMID) and the full set of CICS response keywords are part of the CICS surface — see Supported CICS Features.


Summary

The compiler recognizes the common PL/I built-ins across string handling (SUBSTR, INDEX, VERIFY, TRANSLATE, TRIM, STRING, …), arithmetic (ABS, MOD, MAX/MIN, ROUND, TRUNC, CEIL/FLOOR, decimal ADD/MULTIPLY/DIVIDE), arrays (DIM, HBOUND/LBOUND, ALL/ANY), search (SEARCH, INLIST, BETWEEN), date/time (DATE, TIME, DAYS, SECS), storage and pointers (ADDR, NULL, STG, pointer arithmetic), conversion (DECIMAL, BINARY, FIXED, UNSPEC), and condition/diagnostic built-ins (ONCODE, ONSOURCE, PLIDUMP). This list is a summary — contact support to confirm a specific built-in or argument form.


Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk