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.

Function list

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 number of elapsed days (the age) between a specified date and a specified cutoff date, or the current operating system date, or the number of elapsed days between any two dates.

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.

LEADINGZEROS( )

Adds leading zeros to a character string or a number.

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.

SORTWORDS( )

Returns a string with individual words sorted in sequential order.

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.

Search, replace

Function Description

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.

CLEAN( )

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

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.

ISBLANK( )

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

MAP( )

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

MATCH( )

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

OCCURS( )

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

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.

REPLACE( )

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

TEST( )

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

Comparison

Function Description

DICECOEFFICIENT( )

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

ISFUZZYDUP( )

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

LEVDIST( )

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

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.

Conversion

Function Description

BINTOSTR( )

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

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

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.

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.

HASH( )

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

LEADINGZEROS( )

Adds leading zeros to a character string or a number.

PACKED( )

Returns numeric data converted to the Packed data type.

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.

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.

UNSIGNED( )

Returns numeric data converted to the Unsigned data type.

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.

ZONED( )

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

Text

Function Description

ALLTRIM( )

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

BINTOSTR( )

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

BLANKS( )

Returns a string containing a specified number of blank spaces.

DATETIME( )

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

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.

EXCLUDE( )

Returns a string that excludes the specified characters.

INCLUDE( )

Returns a string that includes only the specified characters.

INSERT( )

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

LAST( )

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

LEADINGZEROS( )

Adds leading zeros to a character string or a number.

LENGTH( )

Returns the number of characters in a string.

LOWER( )

Returns a string with alphabetic characters converted to lowercase.

LTRIM( )

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

OMIT( )

Returns a string with one or more specified substrings removed.

PROPER( )

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

REMOVE( )

Returns a string that includes only the specified characters.

REPEAT( )

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

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.

SORTWORDS( )

Returns a string with individual words sorted in sequential order.

SPLIT( )

Returns a specified segment from a string.

STRING( )

Converts a numeric value to a character string.

SUBSTR( )

Returns a specified substring from a string.

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.

UPPER( )

Returns a string with alphabetic characters converted to uppercase.

ZONED( )

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

Math

Function Description

ABS( )

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

COS( )

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

DEC( )

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

EXP( )

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

FREQUENCY( )

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

INT( )

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

LEADING( )

Returns a string containing a specified number of leading digits.

LOG( )

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

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.

MOD( )

Returns the remainder from dividing two numbers.

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.

PI( )

Returns the value of pi to 15 decimal places.

RAND( )

Returns a random number that falls within a specified boundary.

ROOT( )

Returns the square root of a numeric expression.

ROUND( )

Returns a rounded whole number for a numeric value.

SIN( )

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

TAN( )

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

VALUE( )

Converts a character string to a numeric value.

ZONED( )

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

ZSTAT( )

Returns the standard Z-statistic.

Date and time

Function Description

AGE( )

Returns the number of elapsed days (the age) between a specified date and a specified cutoff date, or the current operating system date, or the number of elapsed days between any two dates.

CDOW( )

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

CMOY( )

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

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

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

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

EOMONTH( )

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

GOMONTH( )

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

HOUR( )

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

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.

MONTH( )

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

NOW( )

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

SECOND( )

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

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

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.

UTOD( )

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

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.

Financial

Function Description

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.

EFFECTIVE( )

Returns the effective annual interest rate on a loan.

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.

IPMT( )

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

NOMINAL( )

Returns the nominal annual interest rate on a loan.

NPER( )

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

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.

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.

RATE( )

Returns the interest rate per period.

Field and record

Function Description

FTYPE( )

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

HASH( )

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

ISDEFINED( )

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

OFFSET( )

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

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.

VERIFY( )

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

Table, file, and project

Function Description

FILESIZE( )

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

FTYPE( )

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

GETOPTIONS( )

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

PROPERTIES( )

Returns properties information for the specified Analytics project item.

Variable testing

Function Description

FTYPE( )

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

ISDEFINED( )

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

Python

Function Description
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.

R

Function Description
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.

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.

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.

Bit and character encoding

Function Description

ASCII( )

Returns the ASCII code for a specified character.

BIT( )

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

BYTE( )

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

CHR( )

Returns the character associated with the specified ASCII code.

DBYTE( )

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

DHEX( )

Converts a Unicode string to a hexadecimal string.

DIGIT( )

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

HEX( )

Converts an ASCII string to a hexadecimal string.

HTOU( )

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

MASK( )

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

SHIFT( )

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

Function syntax conventions

Convention

Description

parentheses ( )
  • Function input values must be enclosed by parentheses:

    ALLTRIM(Vendor_Name)
  • The opening parenthesis must immediately follow the function name with no intervening space:

    ALLTRIM(Vendor_Name) 

    not:

    ALLTRIM (Vendor_Name)
  • Parentheses must be used even if no input values are being specified:

    RECNO( )
separators
  • Function input values must be separated by a separator character:

    SUBSTRING(Product_ID,5,12)
  • Valid separator characters are a blank space, a comma, or a semi-colon.

    The comma or semi-colon separator must be specified in the List Separator option on the Numeric tab in the Options dialog box.

Tip

For improved readability you can use both a blank space and one of the other separator characters:

SUBSTRING(Product_ID, 5, 12)
qualifiers
  • Single or double quotation marks are required around literal character values:

    EXCLUDE(Product_ID, "#-")
  • Backquotes are required around literal datetime values:

    AGE(Due_date, `20141231`)
  • No qualifiers are used with numeric values:

    ABS(-7.2)
  • No qualifiers are used with logical values ( T / F ):

    LEVDIST(Vendor_Name, Vendor_Name_2, F)
  • No qualifiers are used with field names:

    ALLTRIM(Vendor_Name)
literal datetime format
  • Literal date values must be entered in YYYYMMDD or YYMMDD format:
    • `20141231`
    • `141231`
  • Literal time values must be entered in hhmmss or hhmm format, and preceded by a space, T, or t:
    • `t235959`
    • `20141231 2359`

Abbreviating function names

Caution

ACL recommends that you do not abbreviate function names in computed fields, expressions, or scripts, and that you use the full version of each name.

Abbreviation makes computed fields, expressions, or scripts harder to read and to understand. Without complete function names, searching functions in the online help becomes more difficult.

Abbreviation is especially problematic if your Analytics projects or scripts will be modified or inherited by someone else who may not be familiar with the abbreviations.

When specifying functions in computed fields, expressions, or scripts, you can abbreviate their names. You must include enough leading characters from a function name to uniquely identify the function among all Analytics functions.

For example:

  • MAX uniquely identifies the MAXIMUM function and therefore is a valid abbreviation.
  • MA does not uniquely identify the MAXIMUM function and generates an error message.

You can make an abbreviation as short as you want, provided that it still uniquely identifies the function.

For example, all the following abbreviations are valid for the ALLTRIM function:

  • ALLTR
  • ALLT
  • ALL
  • AL

Note

As abbreviations get shorter they become harder for other users to recognize.

Function documentation conventions

Convention

Used for:

UPPERCASE

The name of the ACLScript function.

Note

Throughout Analytics documentation, function names are presented in uppercase, which is simply a formatting convention. Analytics does not require that functions are entered in uppercase.

italic

User-supplied function parameters.

|

(vertical bar)

Separates syntax items enclosed in brackets or braces. You can use only one of the items.

< >

(angled brackets)

Optional syntax items. Do not type the brackets.

{ }

(braces)

Required syntax items. Do not type the braces.

<,...n>

Indicates the preceding item can be repeated n number of times. The occurrences are separated by commas.

Data type terms used in function documentation

The following terms are used to identify the data type of function parameter arguments, and return values:

Term

Means you can use:

Character Any field name, expression, or variable that belongs to the Analytics Character (C) category, or a string literal
Numeric Any field name, expression, or variable that belongs to the Analytics Numeric (N) data category, or a numeric value
Datetime Any field name, expression, or variable that belongs to the Analytics Datetime (D) category, or a datetime literal
Logical Any field name, expression, or variable that belongs to the Analytics Logical (L) category, or a logical value
Field The name of a field from any Analytics data category