Audit Command Language – Between Function ()




Welcome to another post in the series ‘Audit Command Language Tutorial for Beginners’. A lot of important topics have been covered so far in these series of posts. We certainly hope, all our readers are benefiting and learning from these posts. For all those who have just stumbled on this website, we urge you to start at the beginner of this series so as to get full benefit.

In this post we will be discussing the Between function. This function is a logical function i.e. it returns the values as true or false. The Between function is used to test the simple condition of whether or not a certain value lies in a given range. This test could be applied for a numeric, date or a character series. This implies this function works with all three major data types supported by the Audit Command Language.

Syntax: BETWEEN(TEST VALUE ,MIN_RANGE, MAX_RANGE)

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

OPEN EMPMAST
DELETE FIELD TEST_Field OK
DEFINE FIELD TEST_Field COMPUTED AS
“TRUE” IF Between(HireDate,`19820101`,`19830101`)
“FALSE”

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

TEST_Field Computed
“TRUE” IF Between(HireDate,`19820101`,`19830101`)
“FALSE”

See below the result of the BETWEEN function.

Easy enough to use…yes? Just a couple pf things to remember when using this function. The Between function is always used as part of the conditional statement or when filtering out data. There are quite a few scenarios where this function can be useful. For instance, creation of fields, testing values (to create flags) in a column and creating sub sets from existing data sets. Check out the video demo below:

Give it a go and share your experiences. Please sign up for our newsletter, so that we may keep you posted on the latest activity on our website and Youtube channel.