ACL Character Function – Exclude() Function

Greetings and welcome to the latest post in the series ‘Audit Command Language Tutorial‘ for Beginners. The next few posts are going to be dedicated to character functions as discussed in the last post. Each of the following posts will explore a character function in detail with an example. So let’s dive straight in.

The first of these functions is the Exclude function. A very important function for data cleansing purposes. Every so often there are certain special characters that get included in certain key fields in data sets. In order to ensure correct analysis on these key fields, it is required that these special characters be excluded from the field in order to normalize/standardize the data.

Syntax: Exclude(Data Field or string ,<Characters to exclude>)

Example in a script to create a new field using Exclude Function

DELETE FIELD NEW_GENDER OK
DEFINE FIELD NEW_GENDER COMPUTED AS
Exclude(FIELD_1,’M’)

Example in a workspace to create a new field using Exclude Function

New_GENDER                                Computed
EXCLUDE(FIELD_1,’M’)

Results from either of the above methods would be that any instance of the character ‘M’ will be removed from any relevant values in the column ‘Field_1’ when creating the new column ‘New_Gender’.

This is an easy enough function to use and apply in any project. The only thing to do is to identify the appropriate instance for implementation. Check out the video for a demo of the function :

This post and the subsequent entries should provide for considerable inputs for you to start playing around with data formatting efforts in your own projects.

Please keep practicing and feel free to reach out to us with your valuable feedback and comments. Please go to 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.




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.



Audit Command Language – Scripts

Welcome to the latest post in the series ‘Audit Command Language Tutorial for Beginners’. At this point, it is our hope that you are able to successfully navigate the GUI of the ACL tool. If there are still any doubts, go through the video below for a walkthrough of the tool before reading on further.

In this post, we will be discussing how to set up and start scripting in your ACL projects. Audit Command Language scripts are fairly straightforward and easy to write as compared to other tools. In a backhanded fashion, on the simplicity also limits the functionality available in other tools in the market.

Creating a new script: Right click on the project folder in the ‘Project Navigator’ -> ‘New’ -> ‘Script’

script-1

Writing your first lines of script: Try writing the below script to create a new column ‘new_acct’ in the table ‘sample’.

OPEN SAMPLE

DELETE FIELD NEW_Gender OK
DEFINE FIELD NEW_Gender COMPUTED AS
ALLTRIM(Field_1)

After writing the script, press the ‘play’ button. If the script completes successfully, you would see the small green ‘check’ sign in the bottom right section of the tool.

If there is any error, there would a red dot next to the line with the error and a red cross at the bottom right corner of the tool. You may watch the video below for the same walk through.

Of course, there are a number of things that can be done via scripting in any tool and the same is true for Audit Command Language Scripts. Besides the creation of fields, there are functions (character, numeric, date), joins etc. and other commands for various other manipulations that can be performed on data sets. All these different aspects will be covered in separate posts so as to explore each in a detailed and comprehensively.

If you wish to be proactive in learning how to script in ACL, I would urge you to fiddle around with the ACL GUI. Any command that is performed using the GUI is logged in the logs. These can be check as each command is executed in the ‘log’ tab at the bottom of the project navigator. Select the command and the corresponding script would appear ‘Define’ window next to the project navigator. See image below.

These scripts can be used to build simple projects very quickly and allow for practice for beginners. So play around with the tool to learn and practice as much as you can for Audit Command Language Scripts.

Please keep practicing and feel free to reach out to us with your valuable feedback and comments. Please go to 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.