ACL Scripting Guide 14.1

Functions

An ACLScript function is a computerized routine in Analytics, narrow in scope, that performs a specific task or calculation and returns a value.

For example, the ALLTRIM( ) function removes any leading or trailing spaces from the text values in a field.

A full list of functions available in Analytics, organized alphabetically or by category, appears below.

Conventions used in function syntax, and in function documentation, and some general usage details, are also provided.

Functions in alphabetical order

Function Description

ABS( )

Returns the absolute value of a numeric expression. The absolute value of a number is the number without its sign.

AGE( )

Returns the age, in days, of a specified date compared to a specified cutoff date, or the current operating system date.

ALLTRIM( )

Returns a string with leading and trailing spaces removed from the input string.

ASCII( )

Returns the ASCII code for a specified character.

AT( )

Returns a number specifying the starting location of a particular occurrence of a substring within a character value.

BETWEEN( )

Returns a logical value indicating whether the specified value falls within a range.

BINTOSTR( )

Returns Unicode character data converted from ZONED or EBCDIC character data. Abbreviation for "Binary to String".

BIT( )

Returns the binary representation for the specified byte position in the current record as an eight character string.

BLANKS( )

Returns a string containing a specified number of blank spaces.

BYTE( )

Returns the character stored in the specified byte position in the current record.

CDOW( )

Returns the name of the day of the week for a specified date or datetime. Abbreviation for "Character Day of Week".

CHR( )

Returns the character associated with the specified ASCII code.

CLEAN( )

Replaces the first invalid character in a string, and all subsequent characters, with blanks.

CMOY( )

Returns the name of the month of the year for a specified date or datetime. Abbreviation for "Character Month of Year".

COS( )

Returns the cosine of an angle expressed in radians, with a precision of 15 decimal places.

CTOD( )

Converts a character or numeric date value to a date. Can also extract the date from a character or numeric datetime value and return it as a date. Abbreviation for "Character to Date".

CTODT( )

Converts a character or numeric datetime value to a datetime. Abbreviation for "Character to Datetime".

CTOT( )

Converts a character or numeric time value to a time. Can also extract the time from a character or numeric datetime value and return it as a time. Abbreviation for "Character to Time".

CUMIPMT( )

Returns the cumulative interest paid on a loan during a range of periods.

CUMPRINC( )

Returns the cumulative principal paid on a loan during a range of periods.

DATE( )

Extracts the date from a specified date or datetime and returns it as a character string. Can also return the current operating system date.

DATETIME( )

Converts a datetime to a character string. Can also return the current operating system datetime.

DAY( )

Extracts the day of the month from a specified date or datetime and returns it as a numeric value (1 to 31).

DBYTE( )

Returns the Unicode character located at the specified byte position in a record.

DEC( )

Returns a value, or the result of a numeric expression, with the specified number of decimal places.

DHEX( )

Converts a Unicode string to a hexadecimal string.

DICECOEFFICIENT( )

Returns the Dice's coefficient of two specified strings, which is a measurement of how similar the two strings are.

DIGIT( )

Returns the upper or lower digit of a specified Packed data type byte.

DOW( )

Returns a numeric value (1 to 7) representing the day of the week for a specified date or datetime. Abbreviation for "Day of Week".

DTOU( )

Converts an Analytics date value to a Unicode string in the specified language and locale format. Abbreviation for "Date to Unicode".

EBCDIC( )

Returns a string that has been converted to EBCDIC character encoding.

EFFECTIVE( )

Returns the effective annual interest rate on a loan.

EOMONTH( )

Returns the date of the last day of the month that is the specified number of months before or after a specified date.

EXCLUDE( )

Returns a string that excludes the specified characters.

EXP( )

Returns the exponential value (base 10) of a numeric expression with a specified number of decimal places.

FILESIZE( )

Returns the size of the specified file in bytes or -1 if the file does not exist.

FIND( )

Returns a logical value indicating whether the specified string is present in a particular field, or anywhere in an entire record.

FINDMULTI( )

Returns a logical value indicating whether any string in a set of one or more specified strings is present in a particular field, or anywhere in an entire record.

FREQUENCY( )

Returns the expected Benford frequency for sequential leading positive numeric digits to a precision of eight decimal places.

FTYPE( )

Returns a character identifying the data category of a field or variable, or the type of an Analytics project item.

FVANNUITY( )

Returns the future value of a series of payments calculated using a constant interest rate. Future value is the sum of the payments plus the accumulated compound interest.

FVLUMPSUM( )

Returns the future value of a current lump sum calculated using a constant interest rate.

FVSCHEDULE( )

Returns the future value of a current lump sum calculated using a series of interest rates.

GETOPTIONS( )

Returns the current setting for the specified Analytics option (Options dialog box setting).

GOMONTH( )

Returns the date that is the specified number of months before or after a specified date.

HASH( )

Returns a salted cryptographic hash value based on the input value.

HEX( )

Converts an ASCII string to a hexadecimal string.

HOUR( )

Extracts the hour from a specified time or datetime and returns it as a numeric value using the 24-hour clock.

HTOU( )

Converts a hexadecimal string to a Unicode string. Abbreviation for "Hexadecimal to Unicode".

INCLUDE( )

Returns a string that includes only the specified characters.

INSERT( )

Returns the original string with specified text inserted at a specific byte location.

INT( )

Returns the integer value of a numeric expression or field value.

IPMT( )

Returns the interest paid on a loan for a single period.

ISBLANK( )

Returns a logical value indicating whether the input value is blank.

ISDEFINED( )

Returns T (true) if the specified field or variable is defined, and F (false) otherwise.

ISFUZZYDUP( )

Returns a logical value indicating whether a string is a fuzzy duplicate of a comparison string.

LAST( )

Returns a specified number of characters from the end of a string.

LEADING( )

Returns a string containing a specified number of leading digits.

LENGTH( )

Returns the number of characters in a string.

LEVDIST( )

Returns the Levenshtein distance between two specified strings, which is a measurement of how much the two strings differ.

LOG( )

Returns the logarithm (base 10) of a numeric expression or field value with a specified number of decimal places.

LOWER( )

Returns a string with alphabetic characters converted to lowercase.

LTRIM( )

Returns a string with leading spaces removed from the input string.

MAP( )

Returns a logical value indicating if a character string matches a specified format string containing wildcard characters, literal characters, or both.

MASK( )

Performs a bitwise AND operation on the first bytes of two character strings.

MATCH( )

Returns a logical value indicating whether the specified value matches any of the values it is compared against.

MAXIMUM( )

Returns the maximum value in a set of numeric values, or the most recent value in a set of datetime values.

MINIMUM( )

Returns the minimum value in a set of numeric values, or the oldest value in a set of datetime values.

MINUTE( )

Extracts the minutes from a specified time or datetime and returns it as a numeric value.

MOD( )

Returns the remainder from dividing two numbers.

MONTH( )

Extracts the month from a specified date or datetime and returns it as a numeric value (1 to 12).

NOMINAL( )

Returns the nominal annual interest rate on a loan.

NORMDIST( )

Returns the probability that a random variable from a normally distributed data set is less than or equal to a specified value, or exactly equal to a specified value.

NORMSINV( )

Returns the z-score associated with a specified probability in a standard normal distribution. The z-score is the number of standard deviations a value is from the mean of a standard normal distribution.

NOW( )

Returns the current operating system time as a Datetime data type.

NPER( )

Returns the number of periods required to pay off a loan.

OCCURS( )

Returns a count of the number of times a substring occurs in a specified character value.

OFFSET( )

Returns the value of a field with the starting position offset by a specified number of bytes.

OMIT( )

Returns a string with one or more specified substrings removed.

PACKED( )

Returns numeric data converted to the Packed data type.

PI( )

Returns the value of pi to 15 decimal places.

PMT( )

Returns the amount of the periodic payment (principal + interest) required to pay off a loan.

PPMT( )

Returns the principal paid on a loan for a single period.

PROPER( )

Returns a string with the first character of each word set to uppercase and the remaining characters set to lowercase.

PROPERTIES( )

Returns properties information for the specified Analytics project item.

PVANNUITY( )

Returns the present value of a series of future payments calculated using a constant interest rate. Present value is the current, lump-sum value.

PVLUMPSUM( )

Returns the present value required to generate a specific future lump sum calculated using a constant interest rate. Present value is the current, lump-sum value.

PYDATE( )

Returns a date value calculated by a function in a external Python script. Data processing in Python is external to Analytics.

PYDATETIME( )

Returns a datetime value calculated by a function in an external Python script. Data processing in Python is external to Analytics.

PYLOGICAL( )

Returns a logical value calculated by a function in an external Python script. Data processing in Python is external to Analytics.

PYNUMERIC( )

Returns a numeric value calculated by a function in an external Python script. Data processing in Python is external to Analytics.

PYSTRING( )

Returns a character value calculated by a function in an external Python script. Data processing in Python is external to Analytics.

PYTIME( )

Returns a time value calculated by a function in an external Python script. Data processing in Python is external to Analytics.

RAND( )

Returns a random number that falls within a specified boundary.

RATE( )

Returns the interest rate per period.

RDATE( )

Returns a date value calculated by an R function or script. Data processing in R is external to Analytics.

RDATETIME( )

Returns a datetime value calculated by an R function or script. Data processing in R is external to Analytics.

RECLEN( )

Returns the length of the current record.

RECNO( )

Returns the current record number.

RECOFFSET( )

Returns a field value from a record that is a specified number of records from the current record.

REGEXFIND( )

Returns a logical value indicating whether the pattern specified by a regular expression occurs in a string.

REGEXREPLACE( )

Replaces all instances of strings matching a regular expression with a new string.

REMOVE( )

Returns a string that includes only the specified characters.

REPEAT( )

Returns a string that repeats a substring a specified number of times.

REPLACE( )

Replaces all instances of a specified character string with a new character string.

REVERSE( )

Returns a string with the characters in reverse order.

RJUSTIFY( )

Returns a right-justified string the same length as a specified string, with any trailing spaces moved to the left of the string.

RLOGICAL( )

Returns a logical value calculated by an R function or script. Data processing in R is external to Analytics.

RNUMERIC( )

Returns a numeric value calculated by an R function or script. Data processing in R is external to Analytics.

ROOT( )

Returns the square root of a numeric expression.

ROUND( )

Returns a rounded whole number for a numeric value.

RSTRING( )

Returns a string value calculated by an R function or script. Data processing in R is external to Analytics.

RTIME( )

Returns a time value calculated by an R function or script. Data processing in R is external to Analytics.

SECOND( )

Extracts the seconds from a specified time or datetime and returns it as a numeric value.

SHIFT( )

Returns a single character string with the bits in the first character of the input value shifted to the left or right.

SIN( )

Returns the sine of an angle expressed in radians, with a precision of 15 decimal places.

SOUNDEX( )

Returns the soundex code for the specified string, which can be used for phonetic comparisons with other strings.

SOUNDSLIKE( )

Returns a logical value indicating whether a string phonetically matches a comparison string.

SPLIT( )

Returns a specified segment from a string.

STOD( )

Converts a serial date – that is, a date expressed as an integer – to a date value. Abbreviation for "Serial to Date".

STODT( )

Converts a serial datetime – that is, a datetime expressed as an integer, and a fractional portion of 24 hours – to a datetime value. Abbreviation for "Serial to Datetime".

STOT( )

Converts a serial time – that is, a time expressed as a fractional portion of 24 hours, with 24 hours equaling 1 – to a time value. Abbreviation for "Serial to Time".

STRING( )

Converts a numeric value to a character string.

SUBSTR( )

Returns a specified substring from a string.

TAN( )

Returns the tangent of an angle expressed in radians, with a precision of 15 decimal places.

TEST( )

Returns a logical value indicating whether a specified string occurs at a specific byte position in a record.

TIME( )

Extracts the time from a specified time or datetime and returns it as a character string. Can also return the current operating system time.

TODAY( )

Returns the current operating system date as a Datetime data type.

TRANSFORM( )

Reverses the display order of bi-directional text within a specified string.

TRIM( )

Returns a string with trailing spaces removed from the input string.

UNSIGNED( )

Returns numeric data converted to the Unsigned data type.

UPPER( )

Returns a string with alphabetic characters converted to uppercase.

UTOD( )

Converts a Unicode string containing a formatted date to an Analytics date value. Abbreviation for "Unicode to Date".

VALUE( )

Converts a character string to a numeric value.

VERIFY( )

Returns a logical value indicating whether the data in a physical data field is valid.

WORKDAY( )

Returns the number of workdays between two dates.

YEAR( )

Extracts the year from a specified date or datetime and returns it as a numeric value using the YYYY format.

ZONED( )

Converts numeric data to character data and adds leading zeros to the output.

ZSTAT( )

Returns the standard Z-statistic.