Types of Functions

In this section:

You can access any of the following types of functions:


Top of page

x
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.

ASIS

Distinguishes between a blank and a zero in Dialogue Manager.

BITSON

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

BITVAL

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

BYTVAL

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

CHKFMT

Checks a character string for incorrect characters or character types.

CTRAN

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

CTRFLD

Centers a character string within a field.

EDIT

Extracts characters from or adds characters to a character string.

GETTOK

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

LCWORD

Converts the letters in a character string to mixed case.

LCWORD2

Converts the letters in a character string to mixed case.

LCWORD3

Converts the letters in a character string to mixed case.

LJUST

Left-justifies a character string within a field.

LOCASE

Converts alphanumeric text to lowercase.

OVRLAY

Overlays a base character string with a substring.

PARAG

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

POSIT

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

REVERSE

Reverses the characters in a character string.

RJUST

Right-justifies a character string.

SOUNDEX

Searches for a character string phonetically without regard to spelling.

SPELLNM

Takes an alphanumeric string or a numeric value with two decimal places and spells it out with dollars and cents. This function is available only for WebFOCUS.

SQUEEZ

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

STRIP

Removes all occurrences of a specific character from a string.

STRREP

Replaces all occurrences of a specific character string.

SUBSTR

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

TRIM

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

UPCASE

Converts a character string to uppercase.


Top of page

x
Variable Length Character Functions

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

LENV

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

LOCASV

Converts alphanumeric text to lowercase in an AnV field.

POSITV

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

SUBSTV

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

TRIMV

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

UPCASV

Converts a character string to uppercase in an AnV field.


Top of page

x
Character Functions for DBCS Code Pages

The following functions manipulate character strings for DBCS code pages. For details, see Character Functions for DBCS Code Pages.

DCTRAN

Translates a single-byte or double-byte character to another character.

DEDIT

Extracts characters from or adds characters to a string.

DSTRIP

Removes a single-byte or double-byte character from a string.

DSUBSTR

Extracts a substring based on its length and position in the source string.

JPTRANS

Converts Japanese specific characters.


Top of page

x
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.

INT2CHAR

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

LCWORD and LCWORD2

Converts the letters in a character string to mixed case.

LENGTH

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

LJUST

Left-justifies a character string within a field.

LOWER

Converts a character string to lowercase.

MASK

Extracts characters from or adds characters to a character string.

MNTGETTOK

Divides a character string into substrings, called tokens.

NLSCHR

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

OVRLAY

Overlays a base character string with a substring.

POSIT

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

RJUST

Right-justifies a character string.

SELECTS

Decodes a value from a stack.

STRAN

Substitutes a substring for another substring in a character string.

STRCMP

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

STRICMP

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

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.

SUBSTR

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

TRIM

Removes trailing occurrences of a pattern within a character string.

TRIMLEN

Determines the length of a character string excluding trailing spaces.

UPCASE

Converts a character string to uppercase.


Top of page

x
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.

DB_LOOKUP

Retrieves a data value from a lookup data source.

DECODE

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

FIND

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

LAST

Retrieves the preceding value for a field.

LOOKUP

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

Available Languages: MODIFY, Maintain


Top of page

x
Date Functions

In this section:

The following functions manipulate dates. For details see Date Functions.



x
Standard Date Functions
DATEADD

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

DATECVT

Converts date formats.

DATEDIF

Returns the difference between two dates in units.

DATEMOV

Moves a date to a significant point on the calendar.

DATETRAN

Formats dates in international formats.

DPART

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

FIYR

Returns the financial year, also known as the fiscal year, corresponding to a given calendar date based on the financial year starting date and the financial year numbering convention.

FIQTR

Returns the financial quarter corresponding to a given calendar date based on the financial year starting date and the financial year numbering convention.

FIYYQ

Returns a financial date containing both the financial year and quarter that corresponds to a given calendar date.

HMASK

Extracts components from a date-time value and moves them to a target date-time field with all other components of the target field preserved.

TODAY

Retrieves the current date from the system.



x
Legacy Date Functions
AYM

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

AYMD

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

CHGDAT

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

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.

DMY, MDY, and YMD

Calculate the difference between two dates.

DOWK and DOWKL

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

DT

Converts 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.

GREGDT

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

JULDAT

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

YM

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


Top of page

x
Date-Time Functions

The following functions manipulate date- time values. For details see Date-Time Functions.

HADD

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

HCNVRT

Converts a date-time field to a character string.

HDATE

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

HDIFF

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

HDTTM

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

HEXTR

Extracts components from a date-time value and moves them to a target date-time field with all other components set to zero.

HGETC

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

HMASK

Extracts components from a date-time value and moves them to a target date-time field with all other components of the target field preserved.

HHMMSS

Retrieves the current time from the system.

HINPUT

Converts an alphanumeric string to a date-time value.

HMIDNT

Changes the time portion of a date-time field to midnight (all zeros).

HNAME

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

HPART

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

HSETPT

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

HTIME

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

HTMTOTS/TIMETOTS

Converts a time to a timestamp.


Top of page

x
Maintain-specific Date and Time Functions

In this section:

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



x
Maintain-specific Standard Date and Time Functions
HHMMSS

Retrieves the current time from the system.

Initial_HHMMSS

Retrieves the time that the Maintain module was started.

Initial_TODAY

Retrieves the date that the Maintain module was started.

TODAY

Retrieves the current date from the system.

TODAY2

Retrieves the current date from the system.



x
Maintain-specific Legacy Date Functions
ADD

Adds a given number of days to a date.

DAY

Extracts the day of the month from a date.

JULIAN

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

MONTH

Extracts the month from a date.

QUARTER

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

SETMDY

Sets a value to a date.

SUB

Subtracts a given number of days from a date.

WEEKDAY

Determines the day of the week for a date.

YEAR

Extracts the year from a date.


Top of page

x
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.

EDIT

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

FPRINT

Converts a field to alphanumeric format.

FTOA

Converts a number in a numeric format to alphanumeric format.

HEXBYT

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

ITONUM

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

ITOPACK

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

ITOZ

Converts a number in numeric format to zoned format.

PCKOUT

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

PTOA

Converts a packed decimal number from numeric format to alphanumeric format.

UFMT

Converts characters in alphanumeric field values to hexadecimal representation.

XTPACK

Stores a packed number with up to 31 significant digits in an alphanumeric field, retaining decimal data.


Top of page

x
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.

ASIS

Distinguishes between a blank and a zero in Dialogue Manager.

BAR

Produces a horizontal bar chart.

CHKPCK

Validates the data in a field described as packed format.

DMOD, FMOD, and IMOD

Calculate the remainder from a division.

EXP

Raises the number "e" to a specified power.

EXPN

Is an operator that evaluates a number expressed in scientific notation. For information, see Using Expressions in the Creating Reports manual.

FMLINFO

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

FMLLIST

Returns a string containing the complete tag list for each row in an FML request.

FMLFOR

Retrieves the tag value associated with each row in an FML request.

FMLCAP

Returns the caption value for each row in an FML hierarchy request.

INT

Returns the integer component of a number.

LOG

Returns the natural logarithm of a number.

MAX and MIN

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

MIRR

Calculates the modified internal rate of return for a series of periodic cash flows.

NORMSDST and NORMSINV

Perform calculations on a standard normal distribution curve.

PRDNOR and PRDUNI

Generate reproducible random numbers.

RDNORM and RDUNIF

Generate random numbers.

SQRT

Calculates the square root of a number.

XIRR

Calculates the internal rate of return for a series of cash flows that can be periodic or non-periodic.


Top of page

x
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

CLSDDREC

Closes a file and frees the memory used to store information about open files.

FEXERR

Retrieves an Information Builders error message.

FINDMEM

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

Available Operating Systems: z/OS

GETPDS

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

Available Operating Systems: z/OS

GETUSER

Retrieves the ID of the connected user.

MVSDYNAM

Transfers a FOCUS DYNAM command to the DYNAM command processor.

Available Operating Systems: z/OS

PUTDDREC

Writes a character string as a record in a sequential file. Opens the file if it is closed.

SLEEP

Suspends execution for a specified number of seconds.

SYSVAR

Retrieves the Value of a z/OS System Variable.

Available Operating Systems: z/OS


Information Builders