Types of Functions

You can access any of the following types of functions:


Top of page

Character Functions

The following functions manipulate alphanumeric fields or character strings. For details, see Character Functions.

ARGLEN

Measures the length of a character string within a field, excluding trailing blanks.

Available Operating Systems: All

Available Languages: reporting, Maintain

ASIS

Distinguishes between a blank and a zero in Dialogue Manager.

Available Operating Systems: AS/400, OpenVMS, OS/390, UNIX

Available Languages: reporting

BITSON

Evaluates an individual bit within a character string to determine whether it is on or off.

Available Operating Systems: All

Available Languages: reporting, Maintain

BITVAL

Evaluates a string of bits within a character string and returns its value.

Available Operating Systems: All

Available Languages: reporting, Maintain

BYTVAL

Translates a character to its corresponding ASCII or EBCDIC decimal value.

Available Operating Systems: All

Available Languages: reporting, Maintain

CHKFMT

Checks a character string for incorrect characters or character types.

Available Operating Systems: All

Available Languages: reporting, Maintain

CTRAN

Translates a character within a character string to another character based on its decimal value.

Available Operating Systems: All

Available Languages: reporting, Maintain

CTRFLD

Centers a character string within a field.

Available Operating Systems: All

Available Languages: reporting, Maintain

EDIT

Extracts characters from or adds characters to a character string.

Available Operating Systems: All

Available Languages: reporting

GETTOK

Divides a character string into substrings, called tokens, where a specific character, called a delimiter, occurs in the string.

Available Operating Systems: All

Available Languages: reporting, Maintain

LCWORD

Converts the letters in a character string to mixed case.

Available Operating Systems: AS/400, OpenVMS, OS/390, UNIX, VM/CMS

Available Languages: reporting, Maintain

LJUST

Left‑justifies a character string within a field.

Available Operating Systems: All

Available Languages: reporting

LOCASE

Converts alphanumeric text to lowercase.

Available Operating Systems: All

Available Languages: reporting, Maintain

OVRLAY

Overlays a base character string with a substring.

Available Operating Systems: All

Available Languages: reporting

PARAG

Divides a line of text into smaller lines by marking them with a delimiter.

Available Operating Systems: All

Available Languages: reporting, Maintain

POSIT

Finds the starting position of a substring within a larger string.

Available Operating Systems: All

Available Languages: reporting

RJUST

Right‑justifies a character string.

Available Operating Systems: All

Available Languages: reporting

SOUNDEX

Searches for a character string phonetically without regard to spelling.

Available Operating Systems: All

Available Languages: reporting, Maintain

SQUEEZ

Reduces multiple contiguous spaces within a character string to a single space.

Available Operating Systems: All

Available Languages: reporting, Maintain

STRIP

Removes all occurrences of a specific character from a string.

Available Operating Systems: All

Available Languages: reporting, Maintain

SUBSTR

Extracts a substring based on where it begins and its length in the parent string.

Available Operating Systems: All

Available Languages: reporting

TRIM

Removes leading and/or trailing occurrences of a pattern within a character string.

Available Operating Systems: All

Available Languages: reporting

UPCASE

Converts a character string to uppercase.

Available Operating Systems: All

Available Languages: reporting


Top of page

Character Functions for AnV Fields

LENV

Returns the actual length of an AnV field or the size of an An field.

Available Operating Systems: All

Available Languages: reporting

LOCASV

Converts alphanumeric text to lowercase in an AnV field.

Available Operating Systems: All

Available Languages: reporting

POSITV

Finds the starting position of a substring in an AnV field.

Available Operating Systems: All

Available Languages: reporting

SUBSTV

Extracts a substring based on where it begins and its length in the parent string in an AnV field.

Available Operating Systems: All

Available Languages: reporting

TRIMV

Removes leading and/or trailing occurrences of a pattern within a character string in an AnV field.

Available Operating Systems: All

Available Languages: reporting

UPCASV

Converts a character string to uppercase in an AnV field.

Available Operating Systems: All

Available Languages: reporting


Top of page

Maintain-specific Character Functions

The following functions manipulate alphanumeric fields or character strings. They are available only in the Maintain language. For details, see Maintain-specific Character Functions.

CHAR2INT

Translates an ASCII or EBCDIC character to the integer value it represents, depending on the operating system.

Available Operating Systems: All

Available Languages: Maintain

INT2CHAR

Translates an integer into the equivalent ASCII or EBCDIC character, depending on the operating system.

Available Operating Systems: All

Available Languages: Maintain

LCWORD and LCWORD2

Converts the letters in a character string to mixed case.

Available Operating Systems: All

Available Languages: Maintain

LENGTH

Measures the length of a character string, including trailing blanks.

Available Operating Systems: All

Available Languages: Maintain

LJUST

Left‑justifies a character string within a field.

Available Operating Systems: All

Available Languages: Maintain

LOWER

Converts a character string to lowercase.

Available Operating Systems: All

Available Languages: Maintain

MASK

Extracts characters from or adds characters to a character string.

Available Operating Systems: All

Available Languages: Maintain

NLSCHR

Converts a character from the native English code page to the running code page.

Available Operating Systems: All

Available Languages: Maintain

OVRLAY

Overlays a base character string with a substring.

Available Operating Systems: All

Available Languages: Maintain

POSIT

Finds the starting position of a substring within a larger string.

Available Operating Systems: All

Available Languages: Maintain

RJUST

Right‑justifies a character string.

Available Operating Systems: All

Available Languages: Maintain

SELECTS

Decodes a value from a stack.

Available Operating Systems: All

Available Languages: Maintain

STRAN

Substitutes a substring for another substring in a character string.

Available Operating Systems: All

Available Languages: Maintain

STRCMP

Compares two alphanumeric strings using the ASCII or EBCDIC collating sequence.

Available Operating Systems: All

Available Languages: Maintain

STRICMP

Compares two alphanumeric strings using the ASCII or EBCDIC collating sequence, but ignoring case differences.

Available Operating Systems: All

Available Languages: Maintain

STRNCMP

Compares a specified number of characters in two character strings starting at the beginning of the strings using the EBCDIC or ASCII collating sequence.

Available Operating Systems: All

Available Languages: Maintain

SUBSTR

Extracts a substring based on where it begins and its length in the parent string.

Available Operating Systems: All

Available Languages: Maintain

TRIM

Removes trailing occurrences of a pattern within a character string.

Available Operating Systems: All

Available Languages: Maintain

TRIMLEN

Determines the length of a character string excluding trailing spaces.

Available Operating Systems: All

Available Languages: Maintain

UPCASE

Converts a character string to uppercase.

Available Operating Systems: All

Available Languages: Maintain


Top of page

Data Source and Decoding Functions

The following functions search for data source records, retrieve data source records or values, and assign values. For details, see Data Source and Decoding Functions.

DECODE

Assigns values based on the coded value of an input field.

Available Operating Systems: All

Available Languages: reporting, Maintain

FIND

Determines if an incoming data value is in an indexed FOCUS data source field.

Available Operating Systems: All

Available Languages: reporting

LAST

Retrieves the preceding value for a field.

Available Operating Systems: All

Available Languages: reporting

LOOKUP

Retrieves a data value from a cross-referenced FOCUS data source in a MODIFY request.

Available Operating Systems: All

Available Languages: reporting


Top of page

Date and Time Functions

The following functions manipulate dates and times. For details see Date and Time Functions.

In this section:

Standard Date and Time Functions

Legacy Date Functions


Top of page

Standard Date and Time Functions

DATEADD

Adds a unit to or subtracts a unit from a date format.

Available Operating Systems: AS/400, OpenVMS, OS/390, VM/CMS

Available Languages: reporting, Maintain

DATECVT

Converts date formats.

Available Operating Systems: AS/400, OpenVMS, OS/390, VM/CMS

Available Languages: reporting, Maintain

DATEDIF

Returns the difference between two dates in units.

Available Operating Systems: AS/400, OpenVMS, OS/390, VM/CMS

Available Languages: reporting, Maintain

DATEMOV

Moves a date to a significant point on the calendar.

Available Operating Systems: AS/400, OpenVMS, OS/390, VM/CMS

Available Languages: reporting, Maintain

HADD

Increments a date‑time field by a given number of units.

Available Operating Systems: AS/400, OpenVMS, OS/390, UNIX, VM/CMS

Available Languages: reporting, Maintain

HCNVRT

Converts a date‑time field to a character string.

Available Operating Systems: AS/400, OpenVMS, OS/390, UNIX, VM/CMS

Available Languages: reporting, Maintain

HDATE

Extracts the date portion of a date‑time field, converts it to a date format, and returns the result in the format YYMD.

Available Operating Systems: AS/400, OpenVMS, OS/390, UNIX, VM/CMS

Available Languages: reporting, Maintain

HDIFF

Calculates the number of units between two date-time values.

Available Operating Systems: AS/400, OpenVMS, OS/390, UNIX, VM/CMS

Available Languages: reporting, Maintain

HDTTM

Converts a date field to a date‑time field. The time portion is set to midnight.

Available Operating Systems: AS/400, OpenVMS, OS/390, UNIX, VM/CMS

Available Languages: reporting, Maintain

HGETC

Stores the current date and time in a date‑time field.

Available Operating Systems: AS/400, OpenVMS, OS/390, UNIX, VM/CMS

Available Languages: reporting, Maintain

HHMMSS

Retrieves the current time from the system.

Available Operating Systems: All

Available Languages: reporting

HINPUT

Converts an alphanumeric string to a date‑time value.

Available Operating Systems: AS/400, OpenVMS, OS/390, UNIX, VM/CMS

Available Languages: reporting, Maintain

HMIDNT

Changes the time portion of a date‑time field to midnight (all zeroes).

Available Operating Systems: AS/400, OpenVMS, OS/390, UNIX, VM/CMS

Available Languages: reporting, Maintain

HNAME

Extracts a specified component from a date‑time field and returns it in alphanumeric format.

Available Operating Systems: AS/400, OpenVMS, OS/390, UNIX, VM/CMS

Available Languages: reporting, Maintain

HPART

Extracts a specified component from a date‑time field and returns it in numeric format.

Available Operating Systems: AS/400, OpenVMS, OS/390, UNIX, VM/CMS

Available Languages: reporting, Maintain

HSETPT

Inserts the numeric value of a specified component into a date‑time field.

Available Operating Systems: AS/400, OpenVMS, OS/390, UNIX, VM/CMS

Available Languages: reporting, Maintain

HTIME

Converts the time portion of a date‑time field to the number of milliseconds or microseconds.

Available Operating Systems: AS/400, OpenVMS, OS/390, UNIX, VM/CMS

Available Languages: reporting, Maintain

TIMETOTS

Converts a time to a timestamp.

Available Operating Systems: All

Available Languages: reporting, Maintain

TODAY

Retrieves the current date from the system.

Available Operating Systems: All

Available Languages: reporting, Maintain


Top of page

Legacy Date Functions

AYM

Adds or subtracts months from dates that are in year‑month format.

Available Operating Systems: OS/390, UNIX, VM/CMS

Available Languages: reporting, Maintain

AYMD

Adds or subtracts days from dates that are in year‑month‑day format.

Available Operating Systems: OS/390, UNIX, VM/CMS

Available Languages: reporting, Maintain

CHGDAT

Rearranges the year, month, and day portions of alphanumeric dates, and converts dates between long and short date formats.

Available Operating Systems: OS/390, UNIX, VM/CMS

Available Languages: reporting, Maintain

DA

Convert dates to the corresponding number of days elapsed since December 31, 1899.

DADMY converts dates in day‑month‑year format.

DADYM converts dates in day‑year‑month format.

DAMDY converts dates in month‑day‑year format.

DAMYD converts dates in month‑year‑day format.

DAYDM converts dates in year‑day‑month format.

DAYMD converts dates in year‑month‑day format.

Available Operating Systems: All

Available Languages: reporting, Maintain

DMY, MDY, and YMD

Calculate the difference between two dates.

Available Operating Systems: All

Available Languages: reporting, Maintain

DOWK and DOWKL

Find the day of the week that corresponds to a date.

Available Operating Systems: All

Available Languages: reporting, Maintain

DT

Convert the number of days elapsed since December 31, 1899 to the corresponding date.

DTDMY converts numbers to day‑month‑year dates.

DTDYM converts numbers to day‑year‑month dates.

DTMDY converts numbers to month‑day‑year dates.

DTMYD converts numbers to month‑year‑day dates.

DTYDM converts numbers to year‑day‑month dates.

DTYMD converts numbers to year‑month‑day dates.

Available Operating Systems: All

Available Languages: reporting, Maintain

GREGDT

Converts dates in Julian format to year‑month‑day format.

Available Operating Systems: All

Available Languages: reporting, Maintain

JULDAT

Converts dates from year‑month‑day format to Julian (year‑day format).

Available Operating Systems: All

Available Languages: reporting, Maintain

YM

Calculates the number of months that elapse between two dates. The dates must be in year‑month format.

Available Operating Systems: All

Available Languages: reporting, Maintain


Top of page

Maintain-specific Date and Time Functions

The following functions manipulate dates and times. They are available only in the Maintain language. For details, see Maintain-specific Date and Time Functions.

In this section:

Maintain-specific Standard Date and Time Functions

Maintain-specific Legacy Date Functions


Top of page

Maintain-specific Standard Date and Time Functions

HHMMSS

Retrieves the current time from the system.

Available Operating Systems: All

Available Languages: Maintain

Initial_HHMMSS

Retrieves the time that the Maintain module was started.

Available Operating Systems: All

Available Languages: Maintain

Initial_TODAY

Retrieves the date that the Maintain module was started.

Available Operating Systems: All

Available Languages: Maintain

TODAY

Retrieves the current date from the system.

Available Operating Systems: All

Available Languages: Maintain

TODAY2

Retrieves the current date from the system.

Available Operating Systems: All

Available Languages: Maintain


Top of page

Maintain-specific Legacy Date Functions

ADD

Adds a given number of days to a date.

Available Operating Systems: All

Available Languages: Maintain

DAY

Extracts the day of the month from a date.

Available Operating Systems: All

Available Languages: Maintain

JULIAN

Determines the number of days that have elapsed so far in the year up to a given date.

Available Operating Systems: All

Available Languages: Maintain

MONTH

Extracts the month from a date.

Available Operating Systems: All

Available Languages: Maintain

QUARTER

Determines the quarter of the year in which a date resides.

Available Operating Systems: All

Available Languages: Maintain

SETMDY

Sets a value to a date.

Available Operating Systems: All

Available Languages: Maintain

SUB

Subtracts a given number of days from a date.

Available Operating Systems: All

Available Languages: Maintain

WEEKDAY

Determines the day of the week for a date.

Available Operating Systems: All

Available Languages: Maintain

YEAR

Extracts the year from a date.

Available Operating Systems: All

Available Languages: Maintain


Top of page

Format Conversion Functions

The following functions convert fields from one format to another. For details, see Format Conversion Functions.

ATODBL

Converts a number in alphanumeric format to double‑precision format.

Available Operating Systems: All

Available Languages: reporting, Maintain

EDIT

Converts an alphanumeric field that contains numeric characters to numeric format or converts a numeric field to alphanumeric format.

Available Operating Systems: OS/390, UNIX, VM/CMS

Available Languages: reporting

FTOA

Converts a number in a numeric format to alphanumeric format.

Available Operating Systems: All

Available Languages: reporting, Maintain

HEXBYT

Obtains the ASCII or EBCDIC character equivalent of a decimal integer value.

Available Operating Systems: AS/400, HP, OpenVMS, OS/390, UNIX, VM/CMS

Available Languages: reporting, Maintain

ITONUM

Converts a large binary integer in a non‑FOCUS data source to double‑precision format.

Available Operating Systems: AS/400, OpenVMS, OS/390, UNIX, VM/CMS

Available Languages: reporting, Maintain

ITOPACK

Converts a large binary integer in a non‑FOCUS data source to packed‑decimal format.

Available Operating Systems: AS/400, OpenVMS, OS/390, UNIX, VM/CMS

Available Languages: reporting, Maintain

ITOZ

Converts a number in numeric format to zoned format.

Available Operating Systems: AS/400, HP, OpenVMS, OS/390, UNIX, VM/CMS

Available Languages: reporting, Maintain

PCKOUT

Writes a packed number of variable length to an extract file.

Available Operating Systems: AS/400, OpenVMS, OS/390, UNIX, VM/CMS

Available Languages: reporting, Maintain

UFMT

Converts characters in alphanumeric field values to hexadecimal representation.

Available Operating Systems: AS/400, OpenVMS, OS/390, VM/CMS

Available Languages: reporting, Maintain


Top of page

Numeric Functions

The following functions perform calculations on numeric constants or fields. For details, see Numeric Functions.

ABS

Returns the absolute value of a number.

Available Operating Systems: All

Available Languages: reporting, Maintain

ASIS

Distinguishes between a blank and a zero in Dialogue Manager.

Available Operating Systems: AS/400, OpenVMS, OS/390, UNIX

Available Languages: reporting

BAR

Produces a horizontal bar chart.

Available Operating Systems: AS/400, OpenVMS, OS/390, UNIX, VM/CMS

Available Languages: reporting, Maintain

CHKPCK

Validates the data in a field described as packed format.

Available Operating Systems: All

Available Languages: reporting, Maintain

DMOD, FMOD, and IMOD

Calculate the remainder from a division.

Available Operating Systems: All

Available Languages: reporting, Maintain

EXP

Raises the number "e" to a specified power.

Available Operating Systems: All

Available Languages: reporting, Maintain

EXPN

Evaluates a number expressed in scientific notation.

Available Operating Systems: AS/400, OS/390

Available Languages: reporting

FMLINFO

Returns the FOR value associated with each row in an FML report.

Available Operating Systems: All

Available Languages: reporting

INT

Returns the integer component of a number.

Available Operating Systems: All

Available Languages: reporting, Maintain

LOG

Returns the natural logarithm of a number.

Available Operating Systems: AS/400, HP, OpenVMS, OS/390, VM/CMS

Available Languages: reporting, Maintain

MAX and MIN

Return the maximum or minimum value, respectively, from a list of values.

Available Operating Systems: All

Available Languages: reporting, Maintain

NORMSDST and NORMSINV

Perform calculations on a standard normal distribution curve.

Available Operating Systems: All

Available Languages: reporting

PRDNOR and PRDUNI

Generate reproducible random numbers.

Available Operating Systems: All

Available Languages: reporting, Maintain

RDNORM, and RDUNIF

Generate random numbers.

Available Operating Systems: All

Available Languages: reporting, Maintain

SQRT

Calculates the square root of a number.

Available Operating Systems: All

Available Languages: reporting, Maintain


Top of page

System Functions

The following functions call the operating system to obtain information about the operating environment or to use a system service. For details, see System Functions.

FEXERR

Retrieves an Information Builders error message.

Available Operating Systems: AS/400, OpenVMS, OS/390, UNIX, VM/CMS

Available Languages: reporting, Maintain

FINDMEM

Determines if a specific member of a partitioned data set (PDS) exists in batch processing.

Available Operating Systems: OS/390

Available Languages: reporting, Maintain

GETPDS

Determines if a specific member of a partitioned data set (PDS) exists, and if it does, returns the PDS name.

Available Operating Systems: OS/390

Available Languages: reporting, Maintain

GETUSER

Retrieves the ID of the connected user.

Available Operating Systems: All

Available Languages: reporting, Maintain

HHMMSS

Retrieves the current time from the system.

Available Operating Systems: All

Available Languages: reporting, Maintain

MVSDYNAM

Transfers a FOCUS DYNAM command to the DYNAM command processor.

Available Operating Systems: OS/390

Available Languages: reporting, Maintain

TODAY

Retrieves the current date from the system.

Available Operating Systems: All

Available Languages: reporting, Maintain