ACL Analytics Language Reference

ACL Script function reference

The topics in this section document the _ACL_Script functions and their syntax.

For information about the function syntax conventions used in this guide, see ACLScript function syntax conventions.

ACL Script functions by category

ACL Script functions are listed below in eight categories that identify their purpose. If you are working in the Expression Builder, you can filter the functions by the same categories using the Functions drop-down list.

## Bit and character functions
[ASCII( )](r_ascii.html#id433ecedc-99c0-4d9f-bfcc-81b2751123e1) Returns the ASCII character code for a specified character.
[BIT( )](r_bit.html#id8fcd5702-e9c7-4425-be17-6076d1b48823) Returns the binary representation for the specified byte position in the current record.
[BYTE( )](r_byte.html#id3c90daf5-e8bb-4409-9473-68e4cc09c20b) Returns the character stored in the specified byte position in the current record.
[CHR( )](r_chr.html#ide313738b-1997-4f04-bb9d-3a7012a76e7f) Returns the character associated with the specified ASCII character code.
[DBYTE( )](r_dbyte.html#id279b54ca-351e-4e22-a9a8-430c4b191a37) Returns the Unicode character located at the specified byte position in a record.
[DHEX( )](r_dhex.html#id88912c62-0fd6-4ec8-8ed5-46ab8b5508bb) Converts a Unicode string to a hexadecimal string.
[DIGIT( )](r_digit.html#ide879ee5f-3e0e-4169-9c80-c864228007ce) Returns the upper or lower digit of a specified Packed data type byte.
[HEX( )](r_hex.html#id1dd67366-4420-46d9-982e-f931d2f108dd) Returns a hexadecimal string representing the contents of the specified value.
[HTOU( )](r_htou.html#id86ebfad0-945d-4e26-bf82-498b6a82f1a2) Converts a hexadecimal string to a Unicode string. Abbreviation for “Hexadecimal to Unicode”.
[MASK( )](r_mask.html#id1f2c4867-35f7-4a94-a34d-5210a8c3b152) Returns the individual bits from the first byte of a character expression.
[SHIFT( )](r_shift.html#id48719f8e-6bfa-49d1-b13b-e6dfcfd81161) Returns a single character string with the bits in the first character of the input value shifted to the left or right.

## Conversion functions
[BINTOSTR( )](r_bintostr.html#idae7d1f2e-a949-4d5d-a764-39094050b649) Returns Unicode character data converted from ZONED or EBCDIC character data. Abbreviation for “Binary to String”.
[DEC( )](r_dec.html#id42449107-c358-460b-ad3f-78a620b82a41) Returns a numeric expression with the specified number of decimal places.
[EBCDIC( )](r_ebcdic.html#id9849d00f-0f3d-460d-bf6a-cbe3ffde8376) Returns a string that has been converted to EBCDIC character encoding.
[HASH( )](r_hash.html#id7fb75ae0-c717-4844-a3b2-f5de64315d84) Returns a salted cryptographic hash value based on the input value.
[PACKED( )](r_packed.html#id46975a80-6302-4f3a-980f-1689bd9e6995) Returns numeric data converted to the Packed data type.
[STRING( )](r_string.html#id36fd4d45-de51-4f90-8aff-f8f59308a52a) Converts a numeric value to a character string.
[UNSIGNED( )](r_unsigned.html#id7c39d6ff-4a77-4401-a45c-24cca0c8778e) Returns numeric data converted to the Unsigned data type.
[VALUE( )](r_value.html#idf9d13eb9-9923-4620-8e85-9f98d27574a2) Converts a character string to a numeric value.
[ZONED( )](r_zoned.html#ided2f0a76-6e78-42d6-b690-250c8e13ea40) Converts a numeric value to ASCII zoned data format.

## Date and time functions
[AGE( )](r_age.html#id7743197b-f136-4a18-b2b2-9e1ef042e755) Returns the age, in days, of a specified date compared to a specified cutoff date, or the current operating system date.
[CDOW( )](r_cdow.html#id5ecb2a73-60b0-430e-9dd8-18978f86fcfc) Returns the name of the day of the week for a specified date or datetime. Abbreviation for “Character Day of Week”.
[CMOY( )](r_cmoy.html#id96c0eb48-d801-42a9-a402-227037fbdc9d) Returns the name of the month of the year for a specified date or datetime. Abbreviation for “Character Month of Year”.
[CTOD( )](r_ctod.html#idbedfe82a-a21a-4d78-8f24-8bba77a6e6f2) 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( )](r_ctodt.html#id8d0811f6-ad71-4d8d-8587-ef3f09e901b0) Converts a character or numeric datetime value to a datetime. Abbreviation for “Character to Datetime”.
[CTOT( )](r_ctot.html#id4512dd74-8764-4f15-8ce8-6b0519600400) 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( )](r_date.html#ida92ed4e2-2ec5-4889-8399-f7fd10e0e3d2) 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( )](r_datetime.html#idb05874d8-bc72-47ba-afc2-35a8cd26183e) Converts a datetime to a character string. Can also return the current operating system datetime.
[DAY( )](r_day.html#id8edd81a5-d6ef-4d96-a6bd-3f32019c1d67) Extracts the day of the month from a specified date or datetime and returns it as a numeric value.
[DOW( )](r_dow.html#id49b40c2e-a0a8-4f3e-89dc-7c877a35cf3b) 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( )](r_dtou.html#id1e3787c3-3141-49ba-8594-efc0b57b2c48) Converts a date to a Unicode string, which allows dates in a numeric format to be displayed in various languages. Abbreviation for “Date to Unicode”.
[EOMONTH( )](r_eomonth.html#id3a17cb0a-2390-44f8-b9ee-937277871c23) Returns the date of the last day of the month that is the specified number of months before or after a specified date.
[GOMONTH( )](r_gomonth.html#id611062ab-8652-42fb-a49f-492240e3929d) Returns the date that is the specified number of months before or after a specified date.
[HOUR( )](r_hour.html#ide4cee7cc-1327-4fa4-82ed-ddc042e2ccda) Extracts the hour from a specified time or datetime and returns it as a numeric value.
[MINUTE( )](r_minute.html#id250e5e98-2dc0-4180-9140-b1c86f6956bd) Extracts the minutes from a specified time or datetime and returns it as a numeric value.
[MONTH( )](r_month.html#id0993f2c7-6e2b-4354-8db6-702e2d6c42e6) Extracts the month from a specified date or datetime and returns it as a numeric value.
[NOW( )](r_now.html#id1fa5354d-3b93-43a0-a687-f89e96eac490) Returns the current operating system time as a Datetime data type.
[SECOND( )](r_second.html#id5cce121e-30d2-423f-9062-d753cf230665) Extracts the seconds from a specified time or datetime and returns it as a numeric value.
[STOD( )](r_stod.html#id6251a775-085a-4d9d-ba1f-725dd1647015) Converts a serial date – that is, a date expressed as an integer – to a date value. Abbreviation for “Serial to Date”.
[STODT( )](r_stodt.html#id118e6262-c1bf-4a70-8069-6c8089a9b9b6) 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( )](r_stot.html#idc559fecb-c8e9-491f-aa86-fa1aae9d953c) 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( )](r_time.html#id253e42cb-0f5d-4da5-8333-ac19846466c5) 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( )](r_today.html#id7222925f-14d7-4dd5-add9-12301f76a330) Returns the current operating system date as a Datetime data type.
[UTOD( )](r_utod.html#id986d74ac-f54e-48dd-91c1-c4d518a931c5) Converts a Unicode string to a date, which allows dates in various languages to be displayed in a numeric format. Abbreviation for “Unicode to Date”.
[WORKDAY( )](r_workday.html#id0000f59b-3efa-47e7-901d-2a6695b49674) Returns the number of workdays between two dates.
[YEAR( )](r_year.html#id9630e72b-ca9e-4411-aee2-8461729e498f) Extracts the year from a specified date or datetime and returns it as a numeric value.

## Financial functions
[CUMIPMT( )](r_cumipmt.html#idebed63c7-62ef-4fa3-973b-a4d9f24a7b0a) Returns the amount of interest paid on a loan during the specified period.
[CUMPRINC( )](r_cumprinc.html#id1481aabc-6523-43ff-97de-bba826bbe85f) Returns the amount paid against the principal of a loan for the specified period.
[EFFECTIVE( )](r_effective.html#idf5e1b162-96ce-4fa7-998a-df516725e8f6) Returns the effective annual interest rate on a loan.
[FVANNUITY( )](r_fvannuity.html#idc9c7e4dd-2fb5-46ea-b1d8-f794f5160b6a) Returns the future value of a series of payments, which represents the sum of the payments plus interest.
[FVLUMPSUM( )](r_fvlumpsum.html#id2a1887fc-9c88-43b8-a014-5a13ab3af866) Returns the future value of a lump sum after a number of periods.
[FVSCHEDULE( )](r_fvschedule.html#id13e254ce-6001-488f-9ab6-a721b1d40c4d) Returns the future value of an investment calculated at a variable compound rate.
[IPMT( )](r_ipmt.html#id4037d47e-dbdd-4154-b012-10ec6905dc9f) Returns the size of the interest payment on a loan for a specified period.
[NOMINAL( )](r_nominal.html#iddd0675b9-1f24-4597-93aa-a2628af3b2ce) Returns the annual nominal interest rate.
[NPER( )](r_nper.html#id9d5f1047-bf5f-48e6-920d-2e3a22b370e9) Returns the number of periods required to pay off a loan.
[PMT( )](r_pmt.html#idf4a99aae-bdf2-40f1-a958-e3aad96aac33) Returns the amount of the periodic payment required to pay off a loan.
[PPMT( )](r_ppmt.html#idc3bc9be6-da45-4a9f-a802-620969e774d6) Returns the amount of the principal repaid on a loan for a specified period of the term.
[PVANNUITY( )](r_pvannuity.html#id50b7fbe1-ae21-4ae7-b278-ee84cd10d554) Returns the present value of a series of payments.
[PVLUMPSUM( )](r_pvlumpsum.html#id741f631e-6260-4c2b-ab97-81685158e525) Returns the present value of a lump sum due in a number of periods.
[RATE( )](r_rate.html#ide6dd6c7f-4eb2-4cfb-b8ae-718f70e9dfbb) Returns the interest rate per period.

## Logical functions
[BETWEEN( )](r_between.html#id97d4ce7e-9170-41c7-ab76-d2d988b63c16) Returns a logical value indicating whether the specified value falls within a range.
[FIND( )](r_find.html#idd6e597a1-2399-49c4-8014-6bc648f6a805) Returns a logical value indicating whether the specified string is present in a particular field, or anywhere in an entire record.
[ISBLANK( )](r_isblank.html#id1ed64d11-9819-4473-82af-de74f1b34566) Returns a logical value indicating whether the input value is blank.
[ISDEFINED( )](r_isdefined.html#ide51924e3-c3e0-46ad-8573-1a6fde4f7e66) Returns a logical value indicating whether the specified field exists.
[ISFUZZYDUP( )](r_isfuzzydup.html#ida71ecd17-36d9-4244-ac45-90c94c6aad4e) Returns a logical value indicating whether a string is a fuzzy duplicate of a comparison string.
[MAP( )](r_map.html#id55964861-cb96-4826-9ef4-0f12bc683982) Returns a logical value indicating if a character string matches a specified format string containing wildcard characters, literal characters, or both.
[MATCH( )](r_match.html#id0ad1478f-e914-495c-9aac-0daa7f3defc7) Returns a logical value indicating if a value matches any of the values it is compared against.
[REGEXFIND( )](r_regexfind.html#id4b0c1531-a7a4-4afb-beb5-e850cb13f239) Returns a logical value indicating whether the pattern specified by a regular expression occurs in a string.
[SOUNDSLIKE( )](r_soundslike.html#id5cf498ed-ac9d-4418-937b-8a8a868ad105) Returns a logical value indicating whether a string phonetically matches a comparison string.
[TEST( )](r_test.html#id3440f0c4-d45f-4f50-8280-6526cc86dd8c) Returns a logical value indicating whether a specified string occurs at a specific byte position in a record.
[VERIFY( )](r_verify.html#id6dc8d56d-22cf-43a2-8306-70f04d1fb503) Returns a logical value indicating whether the data in a physical data field is valid.

## Math functions
[ABS( )](r_abs.html#id25e8f2dd-32b4-4649-8d0f-d5f92e005e30) Returns the absolute value of a numeric expression. The absolute value of a number is the number without its sign.
[COS( )](r_cos.html#ida873f36d-e248-44e2-b76a-41bc19ac4763) Returns the cosine of an angle expressed in radians, with a precision of 15 decimal places.
[EXP( )](r_exp.html#id84a2f616-1770-4925-8d16-2f95295e8e38) Returns the exponential value (base 10) of a numeric expression with a specified number of decimal places.
[INT( )](r_int.html#id66297e17-f4b6-40d4-8b9b-41d164627d7b) Returns the integer value of a numeric expression or field value.
[LOG( )](r_log.html#idee1955db-23fe-42cd-a7de-94e9ce6b8fbb) Returns the logarithm (base 10) of a numeric expression or field value with a specified number of decimal places.
[MAXIMUM( )](r_maximum.html#id9a4a3583-373f-4987-86db-3d3b7aea1224) Returns the greater value of two numeric values.
[MINIMUM( )](r_minimum.html#id1032d162-6b04-4ea2-8d34-b5ba17957eb3) Returns the lesser value of two numeric values.
[MOD( )](r_mod.html#idbb28b316-d0a4-4810-922d-0bcd689241e5) Returns the remainder from dividing two numbers.
[NORMDIST( )](r_normdist.html#ida9e3ce55-22a4-4f04-8856-a67aa7a6f34d) 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( )](r_normsinv.html#id1564545f-6cd8-4239-a0c1-adca0a2462c1) Returns the z-score associated with a specified probability in a standard normal distribution.
[PI( )](r_pi.html#idd3be9995-e0d5-4451-b35c-97ae89d7fcd0) Returns the value of pi to 15 decimal places.
[RAND( )](r_rand.html#id2bbf48ba-1d23-4b42-a4cd-f3780f4b81b3) Returns a random number between zero and the value of a numeric expression.
[ROOT( )](r_root.html#id8dbe9c0e-4c4c-4833-bff0-65f7a5685845) Returns the square root of a numeric expression.
[ROUND( )](r_round.html#idd65fc58c-4736-4891-bb25-393f35d52bf2) Returns a rounded whole number for a numeric value.
[SIN( )](r_sin.html#id3ee426b4-5212-440f-a72b-b330c65132c7) Returns the sine of an angle expressed in radians, with a precision of 15 decimal places.
[TAN( )](r_tan.html#idc4ec97c3-9b6b-461d-ac75-2b83c4cf1bd1) Returns the tangent of an angle expressed in radians, with a precision of 15 decimal places.

## Miscellaneous functions
[FILESIZE( )](r_filesize.html#idddfede70-1360-4cc7-91c7-09691e899883) Returns the size of the specified file in bytes.
[FREQUENCY( )](r_frequency.html#idd6425ea1-efa9-45f8-8552-e0c3605c250f) Returns the expected Benford frequency for sequential leading positive numeric digits to a precision of eight decimal places.
[FTYPE( )](r_ftype.html#id6d7c3b19-625a-4a07-8920-c286578efd0a) Returns a character identifying the data category of a field or variable, or the type of an _ACL_ project item.
[GETOPTIONS( )](r_getoptions.html#id2a92cedd-617b-403e-8f79-b9268e065cd2) Returns the current setting for the specified _ACL_ option (Options dialog box setting).
[LEADING( )](r_leading.html#id61d26de3-7460-492e-8268-fad5093cc8aa) Returns a string containing a specified number of leading digits.
[OFFSET( )](r_offset.html#id984f6cab-4ebb-4db9-80ad-55022033430d) Returns the value of field with the starting position offset by a specified number of bytes.
[PROPERTIES( )](r_properties.html#idbb054846-0ede-43fa-a4c9-44dfe60f2697) Returns properties information for the specified _ACL_ project item.
[RECLEN( )](r_reclen.html#idbd1bd08f-3ef4-4fb7-ae13-9815625bb528) Returns the length of the current record.
[RECNO( )](r_recno.html#idf8a28733-d872-4e57-a5a2-a26c9387a466) Returns the current record number.
[RECOFFSET( )](r_recoffset.html#id0ed61e47-dbd8-4397-9022-f4a2bfe47a94) Returns a field value from a record that is a specified number of records from the current record.
[ZSTAT( )](r_zstat.html#id1996800d-c26a-439e-82a9-cf6854864ef8) Returns the standard Z-statistic.

## String functions
[ALLTRIM( )](r_alltrim.html#idc6f00a88-000b-44db-8c7a-c133559c9120) Returns a new string containing a copy of the specified string with leading and trailing spaces removed.
[AT( )](r_at.html#id0ed82156-bbb3-4e72-933b-cf354d67e9f3) Returns a number specifying where a particular occurrence of a substring starts within a character value.
[BLANKS( )](r_blanks.html#id201e3705-6a2e-4912-acd1-6ad814bec8ac) Returns a string containing a specified number of blank spaces.
[CLEAN( )](r_clean.html#id73325755-d0a2-40a8-9fe8-f47cfde09c88) Returns a string where the first invalid character, and all subsequent characters, are replaced with blanks.
[DICECOEFFICIENT( )](r_dicecoefficient.html#id8f38cdf3-ae73-4b91-ba48-0a0aa7869e87) Returns the Dice’s Coefficient of two specified strings, which is a measurement of how similar the two strings are.
[EXCLUDE( )](r_exclude.html#id27c40174-576b-462c-a53d-bae89b7dd343) Returns a string containing a copy of the specified string with the excluded characters removed.
[INCLUDE( )](r_include.html#id83b9e3c6-945b-4f53-84b0-82dd8b5b64de) Returns a string with the specified included characters, and with all other characters removed.
[INSERT( )](r_insert.html#idc94f397b-4af1-4e4f-8b2d-737dcf1f37a0) Returns the original string contents with a specified string inserted in a specified location.
[LAST( )](r_last.html#id46bdeb66-094f-474c-bb2f-2cf793d9ad64) Returns a string containing a specified number of characters from the right side of a string.
[LENGTH( )](r_length.html#iddccf9128-9e08-4eab-a33e-28417db85e5e) Returns the length of a string.
[LEVDIST( )](r_levdist.html#id0bf2d3c3-93ea-4c20-860d-f2b85e6fbc01) Returns the Levenshtein Distance between two specified strings, which is a measurement of how much the two strings differ.
[LOWER( )](r_lower.html#idb0eac71c-5cae-4345-8469-221b77e30092) Returns a string with alphabetic characters converted to lowercase.
[LTRIM( )](r_ltrim.html#idf28098d6-34b7-4b53-b703-f9b9e7bbf209) Returns a string with leading spaces removed from the input value.
[OCCURS( )](r_occurs.html#ida0812656-e59f-4c1f-b67e-83c0d0807255) Returns a count of the number of times a substring occurs in a specified character value.
[OMIT( )](r_omit.html#id4f86aec6-7678-43c1-8b0d-0e49ec110485) Returns a string with one or more specified substrings removed.
[PROPER( )](r_proper.html#id8495ce15-95ae-4b3e-8c6c-631030bb50df) Returns a string with the first character of each word set to uppercase and the remaining characters set to lowercase.
[REGEXREPLACE( )](r_regexreplace.html#ide153d9ca-0176-4bba-b916-31dc8b2eeaa8) Replaces all instances of strings matching a regular expression with a new string.
[REMOVE( )](r_remove.html#id04b9cf70-511b-45ab-adc0-d7fb4f1a7941) Returns a string with all characters removed, except for a specified list of allowed characters.
[REPEAT( )](r_repeat.html#id9aa17fd6-601b-4e87-9f1a-acadb67e30a7) Returns a string that repeats a substring a specified number of times.
[REPLACE( )](r_replace.html#id3f41441a-f190-412c-bb87-3979009b44c8) Replaces all instances of a specified character string with a new character string.
[REVERSE( )](r_reverse.html#id59abe91a-03d2-4e8f-b11d-d444648654dd) Returns a string with the characters in reverse order.
[RJUSTIFY( )](r_rjustify.html#id791e59d1-a3b4-4cc1-99e0-22121b69c22d) Returns a right-justified string the same length as a specified string, with any trailing spaces moved to the left of the string.
[SOUNDEX( )](r_soundex.html#ide8015c54-c4e6-487c-9ebf-c3204430b910) Returns the soundex code for the specified string, which can be used for phonetic comparisons with other strings.
[SPLIT( )](r_split.html#idb1abfc0b-4b7d-4281-9d35-0be7f400f956) Returns a string containing the text between two separators in the specified string.
[SUBSTR( )](r_substr.html#id36411db1-8be9-4187-bf4e-01ed29e092ab) Returns a string containing only the specified substring from the input value.
[TRANSFORM( )](r_transform.html#id4f495e17-06ca-4330-be05-eaab7b5925b3) Reverses the display order of bi-directional text within a specified string.
[TRIM( )](r_trim.html#id9e46744d-509f-4c69-84d5-9ac13f84e116) Returns a new string containing a copy of the specified string with no trailing spaces.
[UPPER( )](r_upper.html#idbe38870c-3846-4d23-bf45-f5b576821403) Returns a string with alphabetic characters converted to uppercase.

**Related concepts**
[ACLScript function syntax conventions](../lang_ref_functions/c_aclscript_function_syntax_conventions.html)

**Related reference**
[ACLScript command reference](../lang_ref_commands/r_command_reference.html)


(C) 2015 ACL Services Ltd. All Rights Reserved.