Audit Command Language – Functions

Welcome to another post in the series ‘Audit Command Language Tutorial for Beginners’. At this point we have discussed two of the key aspects of the ACL tool; creation of scripts and workspaces. The next important piece of the puzzle is ‘Functions’. The remainder of this post is written assuming that the reader has some coding background only to follow along for the terminology.

Functions in any programming language are kind of stored procedures that come with the package to perform certain repetitive tasks. These tasks can be something like, extracting a section of a existing field, formatting data fields to be more presentable way or perhaps just to simply sum up two columns. There are a number of such routine tasks. The functionality of functions provides data analyst the ability to get to relevant data points faster.

Based on the most routinely required functionality, functions are broadly classified in the following three categories:

  1. Character Functions: As the name suggests, this category functions is used on character type data files i.e. imported as ASCII during data import in Audit Command Language software. There is often need for extracting certain sections in a field, or excluding/including/replacing certain characters from a data field and so on. These operations can only be performed on character data types. Some of the most commonly used functions are:
    • Exclude()
    • Include()
    • Replace()
    • Sub() or substring()
    • Alltrim()
    • last()
    • Value()
    • Match()
    • length()
    • string()
    • Split()
    • Upper()
    • Lower()
    • Between()
  2. Numeric Functions: Just like character functions, numeric functions are required to be integers i.e. imported as ‘Numeric’ data type into ACL. Some of the most commonly used numeric functions are:
    • Dec()
    • Round()
    • ABS()
    • INT()
    • Zoned()
    • Between()
  3. Date Functions: Dates are essentially numeric values stored in date formats. Since, the computation on dates are slightly different than regular numbers, there are a set of different functions to extract information from such fields like, current day, current month, day of the week, number of days between two dates and so on. The most regularly used date functions are:
    • CTOD()
    • CDOW()
    • CTOT()
    • DATE()
    • MONTH()
    • AGE()

These basic function types are briefly covered in the following three videos:

Character Functions

Numeric Functions

Date Functions

Besides the above mentioned categories there is another set of functions, leveraged solely for the purpose of data correction in case there are problems in the data file as discussed in the previous posts: data issues ‘split’ & ‘spill’. Most regularly summoned functions for such tasks are:

  1. Recoffset()
  2. Static

The goal of this post is to introduce the readers to functions that would be discussed in the upcoming posts. Each of the above mentioned functions would detailed with its own accompanying post with example and sample scripts that can be leveraged in your own projects.

Please keep practicing and feel free to reach out to us with your valuable feedback and comments. Please go through the website to review ACL script examples and ACL script commands sign up for our newsletter, so that we may keep you posted on the latest activity on our website and Youtube channel.