Audit Command Language – Append




Hi dear readers. Welcome to another post in the series ‘Audit Command Language Tutorial for Beginners’. We have been making reasonable progress on this series. We certainly hope all our readers have been finding the posts useful. We have been getting some comments to that effect and it is encouraging to get some feedback from readers. So please keep the input coming and we will try to improve as much and as quickly we can.

In this post we will be discussing an important concept. till now, we have only discussed techniques or concepts with which to manipulate data files within a single data set i.e. creating data fields or adding columns in a view and other things like. However, in a real world project situation, as handy as these basic tools are, we still need to understand how to play around with the whole data sets i.e. combine and multiple data sets and extracting relevant information from multiple data sets into a new data set. Some aspects Audit Command Language scripting are designed to exactly to facilitate these tasks. so with that, we will be covering the Append  statement in this post.

As the name suggests, the Append statement would allow us to append something. But what? how? etc. These should be questions that should come to your mind now. The Append statement allows us to vertically combine to two or more data set in the Audit Command Language. Just like all aspects of the ACL Audit Command Language, this can be achieved in the 2 ways i.e. via GUI or by audit command language scripts.

Before we discuss how to use the Append statement, we must know the requirements for this statement to work correctly. In order to use this statement, the data sets to be combined should be identical wit regards to the the number of fields, the data types of the fields and the fields lengths. If these criteria are not met, the results from this statement would be incorrect. The ACL tool would probably not even provide an error warning. Needless to say, these conditions should be checked before using the append command.

Check out the video demonstrating the Append Statement below:

The video gives a detailed description of how to use the Append statement. Listed below are the ways to understand the scripts used to achieve the same for the readers reference.

OPEN PAYROLL
EXTRACT FIELDS ALL TO TEMP IF RECNO < 10q

OPEN PAYROLL
EXTRACT FIELDS ALL TO TEMP IF RECNO >20 Append

The above scripts are simply creating a new table from the table ‘Payroll’ where the new table should only include the first 9 records and all records after the 20th records in the data set ‘Payroll’.

It is a simple enough statement to implement in your projects. We hope this post was helpful. 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 – Classify Command




Hello folks. We hope that you have been following along and more importantly this information has been helpful to you in some way. As always we are trying to add as much content on this site as regularly as possible so that readers can easily follow along and keep up the enthusiasm for learning.

In that spirit, we will keep on going further with another post in the ‘Audit Command Language Tutorial for Beginners’ series. In this post we will be discussing the Classify command. The Classify command is among one of the most frequently used commands in most ACL projects. The Classify command simply displays all the unique values along with the count of total occurrences of each of the unique values. This result is mostly show on the screen and/or it can be printed in the logs as well.

The Classify command clearly bares a lot of similarity to the the summarize command. The major difference between the two is that, when a data set is summarized, we are not sorting the data file and no additional fields besides the key field (the field on which data is classified) and any subtotal fields are allowed. Also, the  Classify command is faster than a summarize if we simply want to extract the unique values because it doesn’t bother with presorting the data, which is a requriement for summarizing any data set.

Let us now explore how to actually use the command. As all things in Audit Command Language, this operation can also be performed using the GUI of the tool and via scripts. to leverage the GUI open the table and simply go to the menu, choose ‘Analyze’ -> ‘Classify…’. A pop window should pop up like shown in the screenshots below:

In the above screenshot, we can select the one field on which we wish to classify the data, the subtotal fields and the any ‘IF’ conditions that we may want to apply in order to filter out the data.

If we move towards the ‘Output’ tab, we get the options to choose the output format i.e. whether the output from the classify command would be provided on screen or in a new table. Depending on the selections that a user would make, we get a small changes to the scripts. For the above set up the Audit Command Language Script would come out as:

OPEN PAYROLL
CLASSIFY ON WorkDept SUBTOTAL Gross_Pay TO “test.FIL” OPEN

For more detailed explanation, we urge you to view the video demonstration of the Classify command. See below:

Since this command is so useful, it is important to understand clearly how it works by playing around the GUI and figuring out changes in output and the scripts created in the logs. This is a terrific way of understanding the Audit Command Language Scripts syntax. Try out this command and share your views in the comments.

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 – Sort Statement




Welcome to another post in the ‘Audit Command Language Tutorial for Beginners’. We have covered a lot of ground in just the last few weeks. So far we have covered a range of functions and statements which should be enough for entry level data analytics professionals. In that spirit let’s keep building this knowledge base.

In this post we will be discussing the Sort statement. It is quite obvious as to what this statement is used. This statement is used to sort a data set. However, there is a surely a ACL specific twist related to this simple task.

First lets see how we use this command via the ACL GUI. In order to use the GUI to implement the command go to menu -> Data -> Sort Records… . This should result in a pop up window. It should appear as shown below in the screen shots below:

At this stage, click on ‘Sort on’ button to select the field on which to sort the table.

At this you can choose the field by moving it to right column. At this point, you can further click on the arrow icon to sort data ascending or descending.

Once you set up the pop up window as shown, you should be able to get the new sorted table ‘Test’. The syntax would appear as follows:

OPEN PAYROLL
SORT ON Gross_Pay TO “Test” OPEN

In order to sort the data descending, the script would read as follows:

OPEN PAYROLL
SORT ON Gross_Pay D TO “Test” OPEN

To further aid your understanding of this statement, please refer to the demo video shown below:

This statement is a simple enough to implement. It can be argued that it is not very useful for investigations or advanced analysis, but it must be noted that sorting data is generally an intermediate step to other major operations like Summarizing data or joining data.

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 – Summarize Statement




Welcome to another post in the ‘Audit Command Language Tutorial for Beginners’ series. We hope things are moving along nicely for all our readers. It has indeed been a long enough journey up to this point and it is certainly our hope that it has been fruitful so far.

We are going to continue with the posts exploring the Audit Command Language statements. In this post, we will be discussion the ‘Summarize’ statement.

The summarize statement performs a rather simple task but one which has quite an impact in any and all data analytics projects. Lets put it this way, if you haven’t found any major insights into your analytics projects, it simply means that the summarize statement has probably not come into play yet.

Before we discuss some of the most common uses of the statement, let us quickly go through the application portion i.e. syntax and GUI implementation.

Syntax:

OPEN PAYROLL
SUMMARIZE ON WorkDept SUBTOTAL Gross_Pay Net_Pay Tax_Amount OTHER Cheque_No TO “summ_test.FIL” OPEN PRESORT

It is important to understand what this statement is doing to get a grasp of the syntax. Firstly, it opens the table ‘Payroll’. Then the field on which the data set is to be summarized, will be provided. Here we are summarizing the data set on field ‘WorkDept’ i.e. the resulting table or view would only have the unique values present in the field ‘WorkDept’. The next part of the statement is listing fields (specifically numeric fields) to be totaled for each of the ‘WorkDept’ values in the data set. the PRESORT at the end of the statment indicates that the ‘Payroll’ data set is sort prior to the use of the statement. Please note, it is critical that a any data set be presorted before summarizing the same, else the results would be incorrect.

To summarize the resulting data set created from the above example would be displaying the total ‘Gross_Pay’, ‘Net_Pay’ & ‘Tax_Amount’ across each of the unique ‘WorkDept’ in the ‘Payroll’ data set.

To accomplish the same using the ACL GUI, please refer to screenshots below:

Go to Menu -> Analyze -> Summarize. Thereafter you should get a pop  up window. Update it as shown in the screenshots:

Please feel free to play around with the interface for this statement. It has a variety of options, all of which cannot be explored in just one post. We can create another post more specific to any specific queries that we may receive.

Additionally, you may prefer to the videos provided below for a demonstration of the summarize statement:
Part 1

Part 2

The above videos should provide even more clarity about the Summarize statement. This statement is a powerful statement because it provides the unique values in a specified column in a data set. Since this statement provides this specific information, it allows for numerous possibilities when combined joins and merges in the Audit Command Language tool overall. The scope of the analysis that can be undertaken simply by including this statement in your arsenal has more impact than all the functions combined. Not to get too dramatic about it, but once you grasp this concept well, you can pick it up very quickly in any scripting language very quickly and start being super productive from the start.

Try out these examples and keep experimenting. The more you fiddle around the more your learn.

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 – Extract Statement




Hello again my fellow data analysts. I hope you are having fun. A good sign would be to check if you feel you are making some progress in your professional projects at the work. A sense of progress is a kind of learning. Hoping that is the case, lets continue with ‘Audit Command Language Tutorial for Beginners’.

We will be continuing our discussion on ACL statements. In this post, we will look at the extract statement. The name can be misleading as it may lead some folks to confuse it with the ‘Export’ statement. Unlike the Export statement, which exports the contents of a data set into a new an external application, the extract statement simply extract the contents (as it is or a subset) of one data set into a new or an already existing data set. The sample script below would give a sense of the syntax and application of the statement.

Syntax:

OPEN PAYROLL
EXTRACT FIELDS ALL TO TEST

What is this script is doing is it simply opens  the table ‘Payroll’ and extracts its contents into a new table ‘Test’. These two tables would be exactly alike. Let us consider another example where we only extract a subset of the original table.

OPEN PAYROLL
EXTRACT FIELDS ALL TO TEST_A if alltrim(WorkDept) = “B01”

In the above script, the new table, would only contain lines from the original ‘Payroll’ table where the field ‘WorkDept’ has the value ‘B01’.

In  another scenario, we may also extract the contents of an existing table into another already existing table. This can be done by using the ‘Append’ keyword at the end of the statement. This would only be possible if the both the tables have the same layout i.e. same number of fields with the same lengths for all fields. Such a statement would be written as:

OPEN PAYROLL
EXTRACT FIELDS ALL TO TEST_A if alltrim(WorkDept) = “C01″ APPEND

In the above example we have combined the tables created the in previous example ‘Test_A” with the entries from the original table ‘Payroll’ where the field ‘WorkDept’ has values ‘B01’ & ‘C01’.

The same can be done using the GUI as well. See the screenshots below to achieve the results as per the example above:

For your reference, the above procedure is also detailed in a video. Please see the video demo below:

Try out these examples and keep experimenting. The more you fiddle around the more your learn.

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 – Export Statement




Welcome to another post in the ‘Audit Command Language Tutorials for Beginners’ series. We hope all the posts thus far have contributed to you learning the ACL Audit Command Language. At this point you should be able to work on small to medium level data analytics projects comfortably and dazzling your bosses at work. 😉

In the previous posts we have explored various functions which are used for creation of new tools within using Audit Command Language scripts. Going forward, this site will keep adding more posts related functions over time to build a repository for all useful ACL functions. For now, we are going to start exploring some most frequently used commands/statements in the ACL Audit Command Language.

In this post we will discuss the Export Command. It does exactly as it sounds. The command is used whenever we are required to extract the contents of a data set in ACL to an external file. The data can be extracted to any file format, ranging delimited text files to Access files. Needless to say, that commands are only executed via the GUI or via Audit Command Language Scripts. See below for sample script detailing the appropriate syntax.

Syntax: OPEN PAYROLL
EXPORT FIELDS all DELIMITED TO “extract” KEEPTITLE SEPARATOR “|” QUALIFIER NONE

The above script, simply opens the table ‘Payroll’ and then exports all the fields (with header names) into a pipe delimited file.

In order to achieve the same result via the GUI. See screenshots below:

Go to Menu -> Data -> ‘Export to Other Application…’. The below window should pop up.

Be sure to populate and select the values as shown in the screenshot in order to match the sample script provided in the example above. Once you are done, simply click ‘OK’ and check the logs for the executed script. You should get the names of all the fields instead of the ‘All’ we have used in the above example. Both scripts would work just fine.

Now that you are somewhat comfortable using the Wizard for performing the export function, feel free to try out different combinations in the wizard and check out the scripts generated. Keep in mind, that the script would vary slightly for each type of file and the number of the fields (with or without headers) that are to be extracted. For your reference, you may also check out the video detailing the same process as discussed in the post.

 

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.