Version
7 Reference Manual
Reference Manual
ACL for Windows
™
7
E-mail: info_europe@acl.com Web: www.acl.com
Singapore 339505
Tel: +65-299-3350 Fax: +65-299-5110
E-mail: info_asia@acl.com Web: www.acl.com
Reference Manual
Version 7
Copyright © 2001 ACL Services Ltd.
All rights reserved.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or
by any means (photocopying, electronic, mechanical, recording, or otherwise), without permission in
writing from the publisher, except by a reviewer who may quote brief passages in a review.
This manual may contain dated information. Use of these materials is based on the understanding that this
manual may not contain all the information, or the most current information relevant to situation or
intended application. Support and update services are available from ACL, by separate written agreement.
Printed in Canada 10 9 8 7 6 5 4 3 2 1
ISBN 1-894497-12
“ACL” and “Audit Command Language” are registered trademarks of ACL, or one of its subsidiaries or
licensors. Microsoft, Windows, the Windows logo, and Windows NT are registered trademarks of
Microsoft Corporation. SAP is a trademark of SAP AG. Other brands or products referenced in the
software, or associated with it, are the trademarks or registered trademarks of their respective holders, and
should be treated as such.
Use of a term in this manual should not be regarded as affecting the validity of any trademark or service
mark.
iii
Contents
VAXfloat ................................................................................................ 22
Zoned ..................................................................................................... 22
Chapter 2: Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Summary of Functions .......................................................................... 23
ABSOLUTE( ) ........................................................................................ 28
AGE( ) .................................................................................................... 28
ALLTRIM( ) ........................................................................................... 29
ASCII( ) .................................................................................................. 29
AT( ) ....................................................................................................... 30
BETWEEN( ) ......................................................................................... 32
BIT( ) ...................................................................................................... 33
BLANKS( ) ............................................................................................. 35
BYTE( ) .................................................................................................. 35
CDOW( ) ............................................................................................... 36
CHR( ) .................................................................................................... 36
CLEAN( ) ............................................................................................... 37
CTOD( ) ................................................................................................. 38
DATE( ) .................................................................................................. 39
DECIMALS( ) ........................................................................................ 40
DIGIT( ) ................................................................................................. 41
DOW( ) .................................................................................................. 42
EBCDIC( ) .............................................................................................. 42
EFFECTIVE( ) ....................................................................................... 43
EXCLUDE( ) .......................................................................................... 44
EXPONENT( ) ....................................................................................... 44
FILESIZE( ) ............................................................................................ 45
FIND( ) ................................................................................................... 46
FREQUENCY( ) .................................................................................... 47
FTYPE( ) ................................................................................................ 48
FVANNUITY( ) ..................................................................................... 49
FVLUMPSUM( ) ................................................................................... 50
HEXADECIMAL( ) ............................................................................... 51
INCLUDE( ) ........................................................................................... 51
INSERT( ) .............................................................................................. 52
INTEGER( ) ........................................................................................... 52
ISBLANK( ) ............................................................................................ 53
LAST( ) ................................................................................................... 54
LEADING( ) ........................................................................................... 54
Contents v
LENGTH( ) ............................................................................................. 55
LOGARITHM( ) ..................................................................................... 55
LOWER( ) ............................................................................................... 56
LTRIM( ) ................................................................................................ 56
MAP( ) .................................................................................................... 57
MASK( ) .................................................................................................. 58
MATCH( ) .............................................................................................. 59
MAXIMUM( ) ........................................................................................ 60
MINIMUM( ) ......................................................................................... 61
MOD( ) ................................................................................................... 62
NOMINAL( ) .......................................................................................... 62
NPER( ) .................................................................................................. 63
OCCURS( ) ............................................................................................. 64
OFFSET( ) ............................................................................................... 64
PACKED( ) ............................................................................................. 65
PMT( ) .................................................................................................... 65
PROPER( ) .............................................................................................. 66
PVANNUITY( ) ..................................................................................... 67
PVLUMPSUM( ) .................................................................................... 68
RAND( ) or RND( ) ............................................................................... 69
RATE( ) .................................................................................................. 69
RECLEN( ) .............................................................................................. 70
RECNO( ) ............................................................................................... 71
REMOVE( ) ............................................................................................ 72
REPEAT( ) .............................................................................................. 73
REPLACE( ) ........................................................................................... 73
REVERSE( ) ............................................................................................ 75
RJUSTIFY( ) ........................................................................................... 75
ROOT( ) .................................................................................................. 75
ROUND( ) .............................................................................................. 76
SHIFT( ) .................................................................................................. 76
SOUNDEX( ) .......................................................................................... 77
SOUNDSLIKE( ) .................................................................................... 77
SPLIT( ) .................................................................................................. 78
STRING( ) .............................................................................................. 79
SUBSTRING( ) ....................................................................................... 79
TEST( ) ................................................................................................... 80
TIME( ) ................................................................................................... 81
TRANSFORM( ) .................................................................................... 81
vi Contents
TRIM( ) .................................................................................................. 82
UNSIGNED( ) ........................................................................................ 82
UPPER( ) ................................................................................................ 83
VALUE( ) ............................................................................................... 84
VERIFY( ) .............................................................................................. 84
ZONED( ) .............................................................................................. 85
ZSTAT( ) ................................................................................................ 86
Related Publications
ACL for Windows User Guide
The user guide will help you start using ACL for Windows Version 7. It shows you how to:
Read or import data from external source data files
View, analyze, and report on data
Automate custom analytical routines
Use ACL for Windows together with ACL for OS/390 in a client/server
environment
The ACL for Windows User Guide is provided to licensed users of ACL. To purchase
additional copies, visit www.acl.com.
Document Conventions
This manual uses the following conventions to describe the command mode syntax of
ACL commands and functions.
Need Help?
Resources
For assistance in using ACL, refer to these additional resources:
ACL for Windows User Guide
ACL for Windows online Help
ACL for Windows Workbook
Your company’s internal ACL technical support center, if available
Contacting Us
If you can not find the solution to your problem and you are a supported user, you can
contact ACL for assistance. Before contacting ACL, be sure you have the following infor-
mation:
Your ACL serial number. You can find this on the back of your CD case, or in ACL
for Windows, select Help from the menu bar and choose About ACL.
The type of hardware you are using, and whether it is connected to a Local Area
Network (LAN).
A description of what happened, and what you were doing when the problem
occurred.
The error message, if any, displayed by ACL.
About this Manual 3
Categories of Data
Computer generated data exists in binary form. Many encoding schemes have been
developed to represent specific types of data with binary code. These encoding schemes
are broadly grouped under four major categories:
Character
Numeric
Logical
Date
In the ACL interface, these categories are sometimes represented by the letters C, N, L,
and D.
Character ASCII
EBCDIC
Custom
PCASCII
5
6 ACL for Windows 7 Reference Manual
Categories of Data
Numeric ACL
ACCPAC
Basic
Binary
Float
Halfbyte
IBMFloat
Micro
Numeric
Packed
Unisys
Unsigned
Vaxfloat
Zoned
Logical Logical
Date Date
Character Data
Character data is normally used to represent text strings or date information. When
digits appear in a character field, they are treated as text characters, not as numbers.
Numeric Data
A great number of data types have been developed to represent numeric data. ACL can
read almost any numeric data type, and recognizes most data types automatically.
Chapter 1 Field Types 7
Categories of Data
Logical Data
Logical data has only two values, one to represent True and another to represent False.
Logical data is usually stored in a character field, in a form such as T/F, Y/N, or On/Off.
Sometimes it is stored in a numeric or a character field where zero denotes False, and
any other value denotes True.
ACL recognizes most logical data automatically.
Date Data
Date information is usually stored as character data, and sometimes as numeric data.
There are no data types designed specifically to represent dates, and there is no universal
convention for representing date information.
ACL recognizes most date data automatically. You may sometimes need to manually
specify the date format.
Real Float
ACCPAC
Reads numeric fields in ACCPAC data files.
This field type refers to the numeric format used in the ACCPAC series of accounting
packages. The length of this data field is always 6 bytes (ACL overrides any other
specified length).
ACL
Reads the values of ACL-generated computed fields and variables stored in a data file.
The ACL field type is an 8 or 12 byte field that stores the results of ACL computations. It
is designed to store large numbers and is not a printable field.
You do not need to define an ACL field type, because ACL does this automatically.
ASCII
Reads data encoded according to the American Standard Code for Information Inter-
change (ASCII).
ASCII is a special coding convention for characters. It is the native character set of most
minicomputers and all personal computers. The maximum length of an ASCII field is
32767 bytes. An ASCII field corresponds to an “X” in a COBOL PICTURE clause. For a
description of the other major form of character data, see “EBCDIC” on page 15.
BASIC
Reads numeric data generated by interpretive BASIC.
This field type specifies the interpretive BASIC (IBM PC) standard adopted by most
BASIC language microcomputer software for floating point representation. However, it
differs from the 8087 and 80287 mathematical co-processors, the 486 and Pentium
CPUs, and most other PC software.
As is the norm for microcomputer numeric field types, the least significant byte of the
significand (mantissa) is sequentially stored first, through to the most significant byte of
the exponent. In other words, the bytes are stored in reverse order. The length of this
field type is either 4 or 8 bytes, as defined by the standard. See “Float” on page 16 for a
description of the 8087 Institute of Electrical and Electronic Engineers (IEEE) format.
10 ACL for Windows 7 Reference Manual
Binary
Binary
Reads unsigned binary numeric data, corresponding to the PL/1 field type, fixed binary
or the COBOL data type, COMPUTATIONAL-1.
Binary is interpreted as a number with the most significant byte first (left most) and the
least significant byte last, as is the norm for mainframe data. This field type is not appro-
priate for Micro binary (integer) fields, which usually store the least significant byte first.
Micro Binary is supported via the micro field type.
The length of the binary field type is a maximum of 8 bytes. The number of decimals is
the implied number of decimal digits, and cannot exceed the number of digits specified
by the length.
Binary fields of even length are treated as signed binary fields (two’s compliment), and
odd lengths are treated as unsigned fields (implicit high-order zero bytes are added).
Custom
Reads non-standard character sets. The custom data type can be useful in
foreign-language applications where certain characters are implemented in a
non-standard or unsupported way.
By default, the custom data type is ASCII. However, you can create a special file named
custom.dat that contains substitute values for any or all standard ASCII character
values. There are no restrictions on the character substitutions that can be made.
You can create the custom.dat file using any text editor. Include the file in the same
directory as your other ACL executable files.
Custom.dat is a standard text file with two values on each line. The first value is the
character to be replaced; the second value is the character to replace it with. The values
can be specified as characters, decimal values, or in hex:
Decimal values are specified as simple numbers, such as 65 for the character “A.”
Hex values are the two hex digits preceded by an X, such as X41 for the character
“A.”
Character values are specified as the character itself, preceded by a C, such as CA
for the character “A.”
Any of these three conventions can be used and intermixed.
The custom.dat file is read when ACL starts up, so you cannot edit the file while ACL is
running. None of the values specified in custom.dat should exceed 255, which is the
Chapter 1 Field Types 11
Date
largest value that can be stored in a byte. You can use any text editor to view the
custom.dat file.
Examples
If the data field to be read is ASCII, but the system uses a hex A4 for a dollar sign ($), a
hex A5 for a comma, and the decimal value 5 for a decimal point, you can define the field
as a custom field. The contents of the custom.dat file would be:
XA4C$
XA5C,
5C.
Date
Interprets date information and converts it to the ACL date field type. For ACL to
recognize date information, it must be stored in an uncompressed form, and be recog-
nizable as date information in the source data file.
Date information is stored in many different forms. Dates are usually represented with a
combination of characters, numbers, and punctuation characters. Sometimes dates are
represented with numbers alone. ACL automatically recognizes date information in
most data files.
ACL uses a date format to identify the byte positions in the source data file that represent
the day, month and year information. The date format is created automatically when
data is defined using the Data Definition Wizard. ACL presents you with its assessment
of the date format and lets you confirm or modify it.
The date format does not affect the way dates are displayed in ACL. To change the way
dates are displayed in ACL, see “Date Options” on page 290 of the ACL for Windows User
Guide.
Tip: Dates entered manually using a keyboard must be enclosed in reverse quotes.
12 ACL for Windows 7 Reference Manual
Date
Two-Digit Years
Many data files use two digits to represent the year. The year used to denote the earliest
date in the last century varies from one set of data files to the next. The two-digit year
that indicates the oldest record in the last century is often called the start of century date
or the pivot date.
The way that ACL reads two-digit years depends on your Start of Century preference
setting. With the default setting of 40, ACL interprets the years 40 to 99 as 1940 to 1999,
and the years 00 to 39 as 2000 to 2039. ACL uses this setting whenever it encounters data
that uses two digits to represent the year in an input file. It will not affect data that uses
three or four digits to represent the year.
To change the default setting, see “Start of Century Date” on page 291 of the ACL for
Windows User Guide. See also “Set” on page 309 in the ACL for Windows Reference
Manual.
Serial Dates
Dates are sometimes represented with a serial number. Serial date schemes represent the
date as the number of days that have elapsed from some arbitrary starting date, such as
January 1, 1900. When you create an input file definition, ACL recognizes the serial
number as numeric data.
Serial dates cannot be converted automatically to the ACL date field type. You must use
ACL functions later to convert the serial number to a date in a new computed field. See
“Serial Dates” on page 266 of the ACL for Windows User Guide.
Example
You need to specify the date format when dates are stored in compressed numeric fields,
such as packed fields.
1. Select Edit from the menu and choose Input File Definition. ACL displays the Input
File Definition window.
2. Under the [Fields/Expressions] tab, in the field list view, double-click the packed
numeric field you want to edit. ACL displays the field format options.
3. Click the Date parameter check box.
4. Specify the date format in the Format drop-down list.
Field attributes
Designates date
field modifier
Parameters
For example, if the date in the source data file has the format YYMMDD, you would
select the same format from the drop-down list. Note that numeric fields cannot contain
punctuation in the format.
14 ACL for Windows 7 Reference Manual
Date
Date Formats
When you define the format of a date field, you tell ACL which characters represent the
day, the month, and the year. ACL uses the following format characters to represent the
elements of a date field:
DD Day (1 – 31)
MM Month (1 – 12)
Put separators such as the slash symbol (/) in the same relative position as they are in the
source data file. If you do not, ACL will not interpret the date correctly. The format that
you define must match the format of the stored date. The following table shows different
ways in which a date may be stored in an input file, and how you would describe the
format to ACL.
991231 YYMMDD
12311999 MMDDYYYY
31DEC1999 DDMMMYYYY
12/31/99 MM/DD/YY
99365 YYDDD
Example Using
Common Date Format Type December 31, 1999
Note: NDATE is the command line equivalent to the date parameter in the field definition
screen of the input file definition window. It is most commonly used to define dates in
packed numeric date fields.
EBCDIC
Reads data encoded according to the Extended Binary Coded Decimal Interchange
Code (EBCDIC).
Like ASCII, EBCDIC refers to printable characters. This field type is the norm for all
IBM mainframe and minicomputers. The length of this field type is a maximum of
32767 bytes.
For more information, see “ASCII” on page 9 for a description of the other major form
of character data.
16 ACL for Windows 7 Reference Manual
Float
Float
Reads data encoded according to the IEEE standard for double precision floating point
numbers, such as data produced with the 8087 co-processor or 486 and higher CPUs.
Float is the standard adopted for most microcomputer software, however it is not the
one used by interpretive BASIC. Float stores the least significant byte of the significand
(mantissa) first (left most) and the most significant byte rightmost. The length of the
field type is 4 or 8 bytes.
Halfbyte
Reads half byte aligned packed data, which is often found in Unisys/Burroughs environ-
ments. Signed numbers must follow the Unisys/Burroughs convention.
Unlike any of the other field types supported by ACL, the start and length for this field
type is specified in half bytes, rather than bytes.
For example, to define a halfbyte field that starts halfway through byte 3 and has a length
of 10, you would click and drag to highlight the field in the Input File Definition window,
as usual.
You must then manually convert the starting position of the field in bytes (n) to half
bytes, using the formula (n*2)-1:
(3*2)-1=5
In our example, you would enter 5 in the Start text box and select HALFBYTE from the
Field Type drop-down before clicking to complete the field definition.
If the data is byte-aligned, it may be more convenient to use the unsigned or Unisys field
types.
IBMfloat
Reads IBM floating point data.
The IBMfloat field type is uncommon, found mainly in mainframe scientific applica-
tions. IBMfloat fields can be either 4 or 8 bytes long.
Chapter 1 Field Types 17
Logical
Logical
Reads ASCII or EBCDIC data that has a logical value of either true or false.
Logical refers to a one-byte long field that is either zero (false), or non-zero (true).
Note: ACL treats ASCII and EBCDIC “F” (for false), “0” (for zero) or “N” (for No) fields
(in upper or lowercase) as false, although it usually evaluates the non-zero value as true.
This is to accommodate the use of “T” and “F”, “0 and 1”, or “Y” and “N” characters as
logical values. ACL also considers an ASCII blank (hex 20) as false for compatibility with
dBASE products.
Micro
Reads unsigned binary numeric data created on PCs and DEC minicomputers.
Micro refers to a binary number that stores the least significant byte first and the most
significant byte last. This field type is not for mainframe and minicomputer binary
fields, which usually store the most significant byte first. For more information, see
“Binary” on page 10.
The length of the micro field type is a maximum of 8 bytes. The number of decimals is
the implied number of decimal digits, and cannot be larger than the number of digits
implied by the length.
Micro fields with even lengths are treated as signed binary fields (two's compliment),
and fields with odd lengths are treated as unsigned fields (implicit high-order zero bytes
are added). This field type is appropriate where microcomputer integer or long data is
represented.
Numeric
Reads printable numeric ASCII or EBCDIC data that corresponds to the COBOL
display field type.
Numeric refers to printable numbers in either ASCII or EBCDIC, as opposed to packed
or zoned. This field type can include any punctuation, but most commonly includes
leading or trailing blanks, an optional leading or trailing sign, embedded commas, and
18 ACL for Windows 7 Reference Manual
Packed
an explicit decimal point. Numeric treats leading zeros as blanks. It has a maximum
length of 40 bytes (up to 22 digits).
Note: Decimal places refers to implicit decimal digits. If a field definition includes
decimals but no explicit decimal point, a decimal point is implied. For example, in a field
with two decimal places, ACL interprets 123 as 1.23; 12.3 as 12.30; and 12. as 12.00.
If the specified decimal places differ from the explicit decimals in the field, the field is
rounded to the appropriate number of decimals.
ACL correctly interprets parentheses and “CR” as negative, but ignores commas and
other punctuation, such as $. Signs can be either leading or trailing, fixed, or floating.
Packed
Reads the packed numeric field type generated by mainframes.
Packed refers to the mainframe packed numeric field type that stores two numeric digits
per byte. The rightmost byte contains a sign indication in the lower half of the byte
(usually HEX “C” for positive and HEX “D” for negative). The upper half of the
rightmost byte, and each half of all other bytes, contain one hexadecimal digit repre-
senting the numeric digit of that position in the number.
The length of this field type is a maximum of 12 bytes (23 digits); however, ACL
generates an error message if it encounters a number larger than 22 digits. Consequently,
when you define a packed numeric field in the Input File Definition window, the number
of decimals that you specify in the Format text box must not result in numbers longer
than 22 digits. For example, if your data contains seven-digit figures, you cannot specify
more than 15 decimal places (22 digits – 7 digits).
The packed numeric field type corresponds to the PL/1 fixed decimal and the COBOL
computational-3 data types.
Note: Although the IBM specification for this type of field indicates that signs of hex “B”
and “D” represent negative values, almost all software uses only the “D” for negatives.
Therefore, ACL treats “B” as positive for compatibility with some non-IBM hardware. If
this causes a problem in your environment, contact Technical Support for assistance.
For more information on Unisys packed data, see “Unisys” on page 21.
Chapter 1 Field Types 19
Packed
PCASCII
Reads data encoded according to the American Standard Code for Information Inter-
change.
The PCASCII field type is almost the same as the ASCII field type. You can use it when
the data in a file is created by a DOS application, or when the file includes foreign
language characters. The PCASCII field type ensures that the foreign language
characters are correctly interpreted.
The field type format is identical to the format of the ASCII field type.
Print
Reads printable numeric ASCII or EBCDIC data.
This field is exactly the same as numeric, except for its treatment of fields with no explicit
decimal point. If a field definition includes decimal places but no explicit decimal point,
print assumes there are no decimals for that record.
Chapter 1 Field Types 21
Unisys
For example, in a field with two decimal places, 123 is interpreted as 123.00; 12.3 as
12.30; and 12. as 12.00.
The length of this field type is a maximum of 40 bytes, however, ACL generates an error
message if a number larger than 22 digits is encountered.
The print field type corresponds to a COBOL display field type, complete with period,
sign and commas. Not only does it ignore commas, but print correctly interprets paren-
theses and “CR” as negative. Signs can be either leading or trailing, fixed or floating, and
any other punctuation (such as $) is ignored.
Unisys
Reads byte-aligned Unisys/Burroughs packed data.
Unisys/Burroughs packed fields, unlike IBM packed fields, have the sign on the left
instead of the right. The Unisys field type refers to the Unisys/Burroughs mainframe
packed field type that stores two decimal digits per byte. This field type is not printable.
The left most byte of the field contains a sign indication in the upper half of the byte,
which is usually hexadecimal “C” or “F” for positive and hexadecimal “D” for negative.
Each half of all other bytes contains one hex digit that is the value of the number in that
position.
The length of this field type is a maximum of 12 bytes, but ACL generates an error
message if a number larger than 22 digits is encountered. The number of decimals is the
implied number of decimal digits, and cannot exceed the number of digits implied by
the length.
Unsigned packed Unisys data should be specified as unsigned because its format is the
same as IBM.
Note: Unisys computers support half-byte aligned data and half-byte length data, but the
Unisys field type is incompatible with them. To read such data, use the halfbyte field type as
described in “Halfbyte” on page 16.
Unsigned
Reads unsigned packed mainframe data.
Unsigned refers to an unsigned packed field type for mainframe data, storing two
decimal digits per byte.
22 ACL for Windows 7 Reference Manual
VAXfloat
Unlike the packed type, unsigned does not contain a sign indication in the lower half of
the rightmost byte. Each half of a byte contains one hexadecimal digit representing the
decimal digit of that position in the number. The length of this field type is a maximum
of 11 bytes or, in other words, 22 decimal digits. The number of decimal places cannot
exceed the maximum number of digits possible for this field.
VAXfloat
Reads DEC VAX type D floating point data, which is the most common of the four VAX
floating point representations.
The length of this field type is either 4 or 8 bytes.
Zoned
Reads numeric ASCII or EBCDIC data of field type zoned decimal (IBM) or PIC S9(n)
(COBOL). In other words, it reads any zoned data, including that generated by DEC,
Honeywell, and IBM machines.
ZONED() refers to mainframe zoned numeric fields, one digit per byte, either encoded
in ASCII or EBCDIC. Leading zeros must be retained. The upper half of the rightmost
byte of the field includes the minus sign. The maximum length of a zoned field is 22
bytes.
The IBM zoned decimal field type and COBOL field type PIC S9(n) are commonly
displayed as a number of digits followed by a letter indicating the sign.
The zoned field type supports DEC DIBOL field types, in which a lowercase letter
between “p” and “y” indicates negative values. ACL automatically detects and adjusts
for zoned fields conforming to the IBM, Honeywell, and DEC formats.
Chapter 2 F UNCTIONS
Summary of Functions
ACL functions are divided into eight categories to help you identify their purpose. When
you are working in the Expression Builder, you can view the functions in the Functions
drop-down list. To view all the functions, select All from the list. To view a subset of the
functions, select a category from the list.
Bit/Character Functions
ASCII( ) Returns the ASCII decimal value of the first character of an expression.
CHR( ) CHR( ) returns the ASCII character corresponding to the decimal value
that you specify.
MASK( ) Extracts individual bits from the first byte of a character expression.
Conversion Functions
PACKED( ) Converts numeric data into a PACKED data type of a specified length.
UNSIGNED( ) Converts numeric data into an UNSIGNED data type of a specified length.
23
24 ACL for Windows 7 Reference Manual
Summary of Functions
AGE( ) Returns the age (in days) of a date compared to a specified cutoff date or
the current system date.
CDOW( ) Returns the name of the day of the week for a specified date.
DATE( ) Converts a date expression, the current system date, or a date field value
into a character string readable as a date.
DOW( ) Returns a numeric value representing the day of the week for a specified
date.
TIME( ) Returns the time and date from the system clock.
Logical Functions
Mathematical Functions
FREQUENCY( ) Returns the expected Benford frequency for sequential leading positive
numeric digits to a precision of eight digits.
RANDOM( ) Returns a random number between zero and the value of a numeric
expression.
Financial Functions
PVLUMPSUM( ) Returns the present value of a lump sum due in a number of periods.
Miscellaneous Functions
ALLTRIM( ) Removes leading and trailing blanks from character strings. Does not
affect blanks inside the string.
CLEAN( ) Discovers any invalid characters in a string and replaces them and all
subsequent characters with blanks.
EXCLUDE( ) Compares two strings and returns a string containing only those
characters not common to both.
INCLUDE( ) Compares two strings and returns a string containing only those
characters common to both.
OCCURS( ) Counts the number of times a character string occurs within a longer
string.
ABSOLUTE( )
ABS( ) returns the absolute value of a numeric expression.
Use ABS( ) to determine the absolute value of a population before generating a random
sample.
Function Format
ABS(N)
The ABS( ) function returns the absolute value of the specified numeric expression N.
Examples
ABS(-7.2)= 7.2
ABS(88.2)= 88.2
ABS(5)= 5
To create a field that is the difference between two fields (AMT1 and AMT2), specify:
ABS(AMT1 - AMT2)
AGE( )
AGE( ) returns the age, in days, of a specified date compared to a specified cutoff date.
Use AGE( ) when comparing two dates to determine overdue accounts or to perform
aged analyses of balances.
Function Format
AGE(C|D <,C|D>)
AGE( ) returns a numeric value denoting the age difference in days between two dates.
When you omit the second parameter, ACL uses the current system date. But when you
include the second parameter, ACL calculates age relative to fiscal year ends or other
cutoff dates.
Regardless of the format in which a date field is stored, when using constants, the
constant must be:
A character string or expression of the form YYMMDD or YYYYMMDD
A date constant of the form YYMMDD or YYYYMMDD
A valid ACL date expression
Dates older than the cutoff date return a positive value. Dates more recent than the cutoff
date return a negative value.
Chapter 2 Functions 29
ALLTRIM( )
Acceptable dates are in the range January 1, 1900 to December 31, 9999.
Examples
Assuming a current system date of January 1, 1996:
AGE(`951220`) = 12
AGE(`19960108`) = -7
AGE(`19941220`,`950101`) = 12
AGE(Datefld) = 65
AGE(DueDate,`961231`) = 80
To extract the name, amount, and invoice date for all items more than 180 days old (as
at the fiscal year end), specify:
AGE(DATE,`961231`)>180
AGE(DATE,`961231`)>180
ALLTRIM( )
ALLTRIM( ) returns a variable length string with leading and trailing blanks removed.
Blanks inside the character string are not removed.
ALLTRIM( ) is similar to LTRIM( ), which removes leading blanks, and to TRIM( ),
which removes trailing blanks.
Function Format
ALLTRIM(C)
Examples
ALLTRIM(" abc ") = "abc"
ALLTRIM(" a bc ") = "a bc"
ASCII( )
ASCII( ) returns the ASCII decimal value of the first character of a specified character
expression or character field. This function is the inverse of the CHR( ) function.
Use ASCII( ) to test character field values when they are not printable characters, such as
tabs.
30 ACL for Windows 7 Reference Manual
AT( )
Function Format
ASCII(C)
ASCII( ) analyzes the first character in the character expression C and returns a decimal
number representing the value.
Ensure that C is enclosed in quotes if it is a constant.
Examples
ASCII("A") = 65
ASCII("1") = 49
To extract records that have a tab character (decimal value = 9) at the start of field DESC,
specify:
ASCII(DESC) = 9
AT( )
AT( ) returns the position of a character string within another character string. You
must specify which occurrence of the string to search for. A value of zero is returned if
the string is not found.
For most applications that are just concerned with whether a string is present, the
FIND( ) function is an easier alternative. AT( ) is still required if you need the location of
the string, or if you are looking for multiple occurrences.
Use AT( ) to look for a particular value in a free text field (such as a description, name or
address).
Function Format
AT(N,C1,C2)
AT( ) searches for strings inside other strings and takes three arguments: N, C1 and C2.
N specifies which occurrence of string C1 to search for.
The value returned is a location within the searched string, C2. AT( ) can be interpreted
as “at what position is the Nth occurrence of the string C1 in the string C2?”.
Chapter 2 Functions 31
AT( )
If C1 is found N times in C2, AT( ) returns the position of the first character of the Nth
occurrence in C2. If C1 does not occur N times in C2, AT( ) returns zero.
Note: AT( ) is case-sensitive, so “a” is not equal to “A.” If you are searching for values in
mixed case data, you should consider converting the data to uppercase with the UPPER( )
function.
Examples
AT(1, "ABC", "ABCDEFG")= 1
AT(2, "ABC", "ABCDEFGABCDEFG")= 8
AT(2, "A", "ABCDEFGH")= 0
AT(3, "ABC", "ABCDEFGABCDEFG")= 0
To extract every record in which the address is on Wild Street, specify:
Extract records
Condition
The UPPER( ) function is used so that the search is not case-sensitive. If the AT( )
expression returns a value greater than zero, then “Wild” was found in the Address field,
and the record is extracted.
Note: This test also finds “Wilder St.” and “Swilden Ave.” To be more specific, you can
include a blank space before and after “WILD.”
To count the number of records in a file in which the name is Doe, specify:
32 ACL for Windows 7 Reference Manual
BETWEEN( )
BETWEEN( )
BETWEEN( ) returns True or False depending on whether a specified value is between
a minimum and maximum value, inclusive of the end points.
Use BETWEEN( ) to test for ranges of values, such as whether a quantity is between
20,000 and 60,000 inclusive. You can also use it to test for ranges of dates, or ranges of
alphabetic characters.
Chapter 2 Functions 33
BIT( )
Function Format
BETWEEN(value,min,max)
or
BETWEEN(value,max,min)
All three parameters must be of the same type: numeric, date, or character.
BETWEEN( ) returns True if value is between min and max inclusive, and False if it is
not. Values equal to the minimum or the maximum will also return True.
When numeric fields have different decimal precision, the comparison uses the highest
level of precision found in any of the fields.
Date formats can differ for all three parameters because ACL evaluates the date indepen-
dently of how it is stored in a data file or displayed in a view.
Character comparisons are case-sensitive. The character sort order depends on the
language selected in the [Input File Options] tab of the Edit ACL Preferences dialog box.
ACL’s Exact Character Comparison options govern the way ACL compares character
strings. If the SET EXACT option is OFF, “A” is considered equal to “ABC” and
“ABXYZ.” If the SET EXACT option is ON, “A” is not considered equal to “ABC.” The
default setting for this option is OFF.
For more information about changing Exact Character Comparison options, see “Exact
Character Comparisons” on page 284 of the ACL for Windows User Guide.
Examples
BETWEEN(5,4,7) = T
BETWEEN(5,5,7) = T
BETWEEN(5,6,7) = F
BETWEEN("abc","A","B") = F (Note: A False value is returned
because the comparison is case-sensitive)
BETWEEN("ABC","A","B") = T
BETWEEN("BCD","ABC","BB") = F
BETWEEN(`20011131`,`20011031`,`20011131`) = T
BIT( )
BIT( ) returns the bit string representing a specified byte position in the current record.
Use BIT( ) to examine the individual bits in a byte. BIT( ) operates in a manner similar
to the function “BYTE( )” on page 35.
34 ACL for Windows 7 Reference Manual
BIT( )
Function Format
BIT(N)
BIT( ) converts the byte at location N in the current record into an eight-character-long
string of 0s and 1s that represents the byte.
Examples
To assign the bit values for bytes 8, 9, and 17 to the variables b8, b9, and b17, specify:
ASSIGN b8 = BIT(8)
ASSIGN b9 = BIT(9)
ASSIGN b17 = BIT(17)
You will find:
b8 = “00110001” if the eighth byte contains “1”
b9 = “01000001” if the ninth byte contains “A”
b17 = “01100001” if the seventeenth byte contains “a”
Assume that byte position 17 contains a set of 8 credit flags. To extract all customer
records that have the third bit set to one (meaning “do not ship”), specify:
Extract records
Condition
BLANKS( )
BLANKS( ) creates a character string of specified length consisting solely of blanks.
Use BLANKS( ) to format a field with blanks, to initialize a variable, or to make a field
larger by adding a fixed number of blanks.
Function Format
BLANKS(#)
BLANKS( ) returns a string containing a specified number of blanks. The string length
# must be a numeric constant.
Examples
BLANKS(5) = " "
BLANKS(10) = " "
In the following example, blanks are added to the character string “abc”:
"abc" + BLANKS(5) = "abc "
BYTE( )
BYTE( ) returns the ASCII character interpretation of a byte at a specified position in
the current record.
Use BYTE( ) to examine the contents of a position in a record, without having to define
a field for the purpose. If you use this function on EBCDIC data, the value returned will
also be EBCDIC. You may have trouble comparing this to character values.
Function Format
BYTE(N)
The BYTE( ) function allows access to individual bytes in the input record. The value N
refers to a position in the record (counting from 1), irrespective of any field definitions.
The function accesses the byte at position N, and returns the contents as a single
character string.
36 ACL for Windows 7 Reference Manual
CDOW( )
Examples
Given a record containing:
10072DOE JOHN 123188
....|....1....|....2....|....3....|....4....|
BYTE(4) = "7"
BYTE(25) = "H"
BYTE(30) = " "
CDOW( )
CDOW( ) returns the name of the day of the week for a specified date.
To display the day of the week as a number, use the DOW( ) function.
Function Format
CDOW(D,#)
D specifies the date.
# specifies the field length. To display abbreviated names, specify a shorter field length.
Examples
To display the name of the day of the week:
CDOW(`20000801`,7) = "Tuesday"
CDOW(`20000802`,9) = "Wednesday"
CDOW(`20000801`,3) = "Tue"
CHR( )
CHR( ) returns the ASCII character corresponding to the decimal value that you specify.
It allows you to reference any ASCII character, especially those that cannot be entered
directly from a keyboard or are unprintable.
CHR( ) is the inverse of the ASCII( ) function.
Chapter 2 Functions 37
CLEAN( )
Function Format
CHR(N)
CHR( ) returns the ASCII character corresponding to the decimal value N. The value of
N should be between 1 and 256.
Note: The character of value zero is used as a string delimiter by ACL and produces unpre-
dictable results if used.
Examples
You could use CHR( ) to add the Pound Sterling Currency Symbol £ (ASCII character
163) to values in a currency field for formatting purposes:
CHR(163)+"123.45"= "£123.45"
You could also use CHR( ) as part of a test to search fields or records for the existence of
a specific non-printable character.
CLEAN( )
CLEAN( ) searches for any invalid characters in a string and replaces them and all
subsequent characters with blanks.
Use CLEAN( ) to ensure that fields containing invalid data are printed correctly. You can
also use CLEAN( ) to isolate parts of a field, such as the last name in a customer field that
includes both the first and last name of the customer.
Function Format
CLEAN(C1 <,C2>)
The CLEAN( ) function scans a character field or expression C1 from left to right and
searches for any invalid characters. If it finds one, CLEAN( ) replaces the invalid data
and the remainder of the string with blanks.
The optional second parameter C2 allows you to specify additional character values that
are to be considered invalid for the purposes of the test. You must put the values for this
parameter in quotes.
You can apply the CLEAN( ) function automatically to all character fields by turning on
the Blank Invalid Data preference. To do so, select Edit from the menu bar, choose
Preferences, click the [Numeric Options] tab, and check the Blank Invalid Data check
box.
38 ACL for Windows 7 Reference Manual
CTOD( )
Examples
CLEAN("ABC%DEF","%") = "ABC "
CLEAN("1234.56,111,2",",") = "1234.56 "
In the following example, # represents invalid character data:
CLEAN("DOE, JOHN##102891231") = "DOE, JOHN "
CLEAN("DOE, JOHN##102891231", ",") = "DOE "
CTOD( )
CTOD( ) converts a character or numeric expression into a valid date expression.
Use CTOD( ) to create a date for purposes of comparison with date field values,
especially if the date is not a constant. For example, to identify all dates before a certain
date, you could use the test:
DATE<CTOD(year+month+day)
Note: ACL uses a start date of January 1, 1900, for determining the appropriate date value.
This usage has largely been replaced by the use of date constants. For more information,
see “Dates” on page 264 of the ACL for Windows User Guide.
Function Format
CTOD(C|N <,C>)
The CTOD( ) function (short for “Character To Date”) converts character strings or
numeric values into valid dates. CTOD( ) is the standard function name used by a
variety of other software. Unlike other software packages, ACL also converts numeric
expressions to dates.
If the first parameter is a number, it is automatically converted to a string before
conversion.
Chapter 2 Functions 39
DATE( )
Note: The format string has the same form as Set Date and the date field type. Punctu-
ation can be included in the string to be converted. Because the format string is actually a
character string, rather than a date, it should be enclosed in matching double or single
quotes, not reverse quotes.
Examples
Assume you have an accounts receivable transaction file that includes a due date field
named Due. You want to view all the transactions that have a due date before July 1,
1995. To do this you need to compare the Due field to the value of July 1, 1995. Because
the Due field is interpreted by ACL as a unique number, you cannot simply compare it to
07/01/95 or 950701. You must convert July 1, 1995, into another number.
To do this, use an IF test or filter as follows:
Due<CTOD(950701)
All of these expressions return the value of December 31, 1995:
CTOD("951231")
CTOD(311295,"DDMMYY")
CTOD("19951231")
CTOD("951231", "YYMMDD")
CTOD("311295", "DDMMYY")
CTOD(951231)
CTOD(95365, "YYDDD")
CTOD("31/12/1995", "DD/MM/YYYY")
Assuming a date display format of MM/DD/YY:
CTOD("951220") = "12/20/95"
CTOD("DEC2095","MMMDDYY") ="12/20/95"
DATE( )
DATE( ) converts a date expression, the current system date, or a date field value into a
character string representation of the date.
Use DATE( ) when you need to display the current date as a string.
40 ACL for Windows 7 Reference Manual
DECIMALS( )
Function Format
DATE(<D>)
If no parameter is supplied, the system date is converted. Otherwise, the supplied date D
is converted.
The date is returned as a 12-byte character string in the format specified by SET DATE.
If SET DATE specifies a format shorter than 12 bytes, the returned value is padded with
blanks. For more information on the Set Date command, see “Set” on page 309.
Examples
Using the default Date Settings of MM/DD/YY, a system date of Nov 22, 1995, and a date
field value of Dec 31, 1995:
DATE() = "11/22/95 "
DATE(DATEFLD) = "12/31/95 "
DECIMALS( )
DEC( ) allows you to specify the number of decimal places for a numeric expression or
field value. Use it when you want to adjust decimal places in mathematical calculations,
or when you want to round a result to a specified number of decimal places.
Function Format
DEC(N,#)
Where # is a numeric constant representing decimal places that cannot change from
record to record.
DEC( ) takes the value of the numeric expression N and adjusts the number of decimals
to that specified by #. If the number of decimals is being reduced, ACL rounds the result.
You cannot use the DEC( ) function after a calculation to reverse rounding. For
example, DEC(3/2,4) = 1.0000, not 1.5000.
Note: The number of decimals is a constant and you cannot change it during processing.
Examples
DEC(7,2) = 7.00
DEC(7.5647,3) = 7.565
To create a daily interest rate field (with six decimals) from an annual rate field, specify:
Chapter 2 Functions 41
DIGIT( )
DIGIT( )
DIGIT( ) returns the upper or lower value of a packed byte at a specified position in the
record.
Use DIGIT( ) when you require access to individual half-bytes in applications such as
Unisys and NCR, which use half-byte-aligned packed fields.
Function Format
DIGIT(N,1|2)
The DIGIT( ) function separates individual halves of a byte. The first parameter allows
you to specify a byte position in the record and the second parameter allows you to
specify 1 to return the upper half of the byte or 2 to return the lower half of the byte. In
both instances, the half-byte value is returned as a digit between 0 and 15.
Examples
A packed field with the value 123.45 (00 12 34 5C), containing two decimals, and
starting in byte location 10, appears in the data record in the following format:
Position
10 11 12 13
UPPER (1) 0 1 3 5
LOWER (2) 0 2 4 C
42 ACL for Windows 7 Reference Manual
DOW( )
To find what digit appears in the 12th position in the upper half of the byte, use:
DIGIT(12,1) = 3
To find what digit appears in the 12th position in the lower half of the byte, use:
DIGIT(12,2) = 4
For more information on working with UNISYS data, see “Unisys” on page 21.
DOW( )
DOW( ) returns a character string containing a digit from 1 to 7 which represents the
day of the week. The digit “1” represents Sunday.
To display the name of the day of the week, use the CDOW( ) function.
Function Format
DOW(D)
Example
To display the day of the week as a single digit number:
DOW(`19991124`) = 4
EBCDIC( )
Converts a string to EBCDIC characters.
Use EBCDIC( ) to convert data for export to applications on non-ASCII based
platforms such as OS/390, or AS400.
Function Format
EBCDIC(C)
EBCDIC( ) converts the value of string C to EBCDIC.
Chapter 2 Functions 43
EFFECTIVE( )
Example
To create a field containing the EBCDIC value of the Name field for uploading to a
mainframe, specify:
EBCDIC(NAME)
EFFECTIVE( )
EFFECTIVE( ) calculates the effective annual interest rate on a loan.
Use EFFECTIVE( ) to determine the effective annual interest rate when you know the
stated interest rate and the number of compounding periods. For example, if you know
the interest rate charged on your credit card is compounded monthly, but want to know
the equivalent annual rate, taking compound interest into account, you would use this
function. For more information, see “Financial Functions” on page 25.
Function Format
EFFECTIVE(nominal_rate, periods)
nominal_rate is the nominal annual interest rate.
Example
If you know that your credit card is charged 18%, compounded monthly on overdue
balances, to calculate the effective annual rate, specify:
EFFECTIVE(.18,12) = .19561817
This shows that the effective annual rate is 19.561817%.
44 ACL for Windows 7 Reference Manual
EXCLUDE( )
EXCLUDE( )
EXCLUDE( ) returns a variable length string, excluding characters that you specify from
the result.
EXCLUDE( ) is the opposite of the INCLUDE( ) function.
Function Format
EXCLUDE(C1,C2)
EXCLUDE( ) returns a string containing the characters in C1, excluding any characters
that appear in C2, in the same order that they appear in C1.
See also “Functions” on page 23.
Examples
EXCLUDE("123 any street","0123456789")=" any street"
To remove a comma, a forward slash, and a number sign from the Prodno field, specify:
EXCLUDE(Prodno,",/#")
EXPONENT( )
EXP( ) returns the exponential value (base 10) of a numeric expression.
Use EXP( ) for financial applications requiring complex mathematical calculations.
EXP( ) performs an operation similar to the exponentiation operator “^”, but can be
useful in applications that also use the LOG( ) function.
EXP( ) is the opposite of the LOG( ) function.
Function Format
EXPONENT(N,#)
Where # is a numeric constant representing decimal places that cannot change from
record to record.
EXP( ) returns the exponential value (base 10) of the numeric expression or field value
N with # decimal places. The exponential value of a number is defined as 10 raised to the
Nth power. Therefore, the exponential value of 3 is 1000. The inverse of an exponent is
its logarithm.
Chapter 2 Functions 45
FILESIZE( )
Examples
EXP(3,2) = 1000.00
EXP(4.86,6) = 72443.596007
To create a field that is the cube root of the field X to two decimal places, specify:
EXP(LOG(X,6)/3,2)
Note: You can determine the Nth root by dividing the log of the value by N and taking the
exponential of the result.
FILESIZE( )
FILESIZE( ) returns the size of a file.
Use FILESIZE( ) to determine the size of a file in bytes or whether the file exists at all.
The FILESIZE( ) function returns the size of a file in bytes or -1 if the file does not exist.
Typically, this function is used to test for the existence of a file in order to control the
execution of a batch, or to use the size returned for some useful calculation.
Function Format
FILESIZE(filename)
Filename is the name of the file for which you want to determine the size. If the file is
in the same directory as the ACL Project, then you do not need to specify the full path.
For files in other directories, either enter a relative path such as data\filename.fil or an
absolute path such as c:\acl\data\filename.fil.
Examples
To execute the batch TEST only if the file Demo.fil exists:
do TEST if FILESIZE("Demo.fil")>0
In the Expression Builder, you can select FILESIZE( ) from the Functions drop-down
list by double-clicking that item in the list. The selected function is inserted in the
46 ACL for Windows 7 Reference Manual
FIND( )
Expression text box. If the file to be sized is not in the same directory, you must insert the
either a relative path or an absolute path for the file.
FILESIZE("c:\directory\subdirectory\Demo.fil")
To display the size of Demo.fil, in the command log use the Calculate command.
Calculate FILESIZE("Demo.fil")
FIND( )
You can use FIND( ) to test for the presence of a string of characters in a field or record.
The Find function is case-insensitive (finds both uppercase and lowercase), as well as
ASCII and EBCDIC characters. FIND( ) returns True if the string is found and False
otherwise.
Function Format
FIND(C,<field>)
FIND( ) searches for the string C in the field specified by field. If field is omitted,
then FIND( ) searches for the string C in the entire record.
Examples
FIND("New York",ADDRESS)
FIND("New York",)
Note: The Find function is designed to find multiple characters in a field or record.
Because FIND( ) locates both ASCII and EBCDIC characters, this function will return True
when it finds the hexadecimal equivalent of either an ASCII or EBCDIC character.
To look in the Address field for companies located in New York, do the following:
1. Click (Edit View Filter) in the View window. ACL displays the Edit view filter
dialog box.
2. Enter FIND("New York",ADDRESS) in the Expression text box:
Chapter 2 Functions 47
FREQUENCY( )
Find function
If you think you may use this filter again, enter a name in the Save As text box to save
this filter for later use.
3. Click [OK]. Since the function returns True if the string is found, and False if
otherwise, ACL filters out the records that are not from New York.
FREQUENCY( )
FREQUENCY( ) returns the expected Benford frequency for sequential leading positive
numeric digits to a precision of eight digits. It lets you perform limited Benford tests for
specific situations.
Use FREQUENCY( ) in place of a full Benford analysis when you only want to focus on
specific digit combinations. For example, when auditing insurance claims that have
approval limits at specified claim amounts, you could use the FREQUENCY( ) function
to investigate amounts just under an approval threshold. To investigate claims valued
close to an approval limit of $5,000, you could select the range from $4,900 through
48 ACL for Windows 7 Reference Manual
FTYPE( )
$4,999. First, count the total number of records, then use a filter to count the records for
which LEADING( ) returns ‘49’, and compare the ratio of the two counts to the value
you get for FREQUENCY(49). This is faster than running a complete analysis on a data
file of a million records, and it does not generate a large data file or lengthy entries in the
command log.
Function Format
FREQUENCY(C)
C is a character string that consists only of the digits 0 to 9 and has an overall value
greater than zero. FREQUENCY( ) ignores any leading zeros in the character string.
Note: Specifying strings longer than six digits can result in zero values. Calculations for
strings longer than six digits may require greater precision than ACL’s limit of eight decimal
places.
Examples
FREQUENCY("43") =.00998422
FREQUENCY("87654321") = 0.00000000
The frequency of 87654321 is 0.00000000495. ACL computes to a precision of eight
decimal places, and therefore returns a zero value.
FTYPE( )
FTYPE( ) returns a value to identify a type of field, or other item.
Use FTYPE( ) to test field types when running a batch.
Function Format
FTYPE(C)
If C is the name of the current field, the value returned is uppercase “C”, “N”, “L”, or
“D”, indicating that the field is of character, numeric, logical, or date type, respectively.
If C is a variable name, the value returned is lowercase “c”, “n”, “l”, or “d”, indicating that
the field is of character, numeric, logical, or date type, respectively.
If C is the name of a batch, “b” is returned. Similarly, FTYPE( ) returns “Y” for an input
file definition, “w” for a workspace, “i” for an index, and “r” for a report.
If C is none of the above, the value returned is “U” (Undefined).
Chapter 2 Functions 49
FVANNUITY( )
If C is a field, variable, or batch name, ensure that you specify it in matching single or
double quotes.
Note: FTYPE( ) only works with the names of the items or fields, not their contents.
Examples
If Letter represents a character field and Number represents a numeric field:
FTYPE("Letter") = "C"
FTYPE("Number") = "N"
If you have a standard application that makes use of the Amount field for totalling
purposes, you would want to ensure that there is an Amount field and that it is numeric
before starting the standard application.
The following batch executes only if Amount is a numeric field:
FVANNUITY( )
FVANNUITY( ) calculates the future value of a series of payments.
Use FVANNUITY( ) when you want to determine how much an annuity will accumulate
over time. The future value of a series of payments is the total amount that the series will
add up to, with compound interest. For example, when you automatically put the same
amount of money in the bank every month, the ending bank balance is the future value
to you; that is, the sum of the payments plus accumulated compound interest. For more
information, see “Financial Functions” on page 258 of the ACL for Windows User Guide.
Function Format
FVANNUITY(rate,periods,amount)
rate is the interest rate per period.
amount is the payment made at the end of each period. It cannot change over the life of
the annuity.
50 ACL for Windows 7 Reference Manual
FVLUMPSUM( )
Examples
To calculate the future value that would accumulate if you put $1000 per month for a
year into an account earning 1% per month, specify:
FVANNUITY(.01,12,1000) = 12,682.50
To calculate the amount of money that would accumulate if you put $2000 per month for
three years into an account earning 7% per annum compounded monthly, specify:
FVA(.07/12,36,2000) = 79,860.20
FVLUMPSUM( )
FVLUMPSUM( ) calculates the future value of a lump sum after a number of periods.
Use FVLUMPSUM( ) to determine the future value of an investment. The future value is
the total amount that an amount will add up to, with compound interest. For example,
when you put a lump sum in the bank and leave it, the ending bank balance is the future
value. For more information, see “Financial Functions” on page 258 of the ACL for
Windows User Guide.
Function Format
FVLUMPSUM(rate,periods,amount)
rate is the interest rate per period.
Example
Let’s say you earn 1% per month in the bank compounded monthly. If you deposit
$1000, to calculate how much you would have accumulated after 12 months, specify:
FVLUMPSUM(.01,12,1000) = 1126.83
HEXADECIMAL( )
HEX( ) returns a hexadecimal string that is equivalent to an expression or field value
that you specify.
Use HEX( ) when you are unsure about the exact contents of a field.
Function Format
HEXADECIMAL(F)
HEX( ) converts the field value or expression F into a hexadecimal string. The resulting
string is twice as long as F. The digits 0 to 9 and the letters A to F (for the digits 10 to 15)
represent the 16 hex values.
In general, you should apply this function to fields rather than expressions because
HEX( ) displays a representation of the internal storage format of expressions, which is
not likely to be useful.
The operation of this function is similar to BIT( ), in that it converts data to a lower form
text string. However it accepts a field or expression as its parameter, rather than a byte
location.
Examples
To find the hex value of field X that contains the string 12345:
HEX(X) = "3132333435"
To add a field to your view that is the hex value of the Count field, specify:
HEX(COUNT)
INCLUDE( )
INCLUDE( ) returns a variable length string, including only specified characters in the
result.
INCLUDE( ) is the opposite of the EXCLUDE( ) function.
52 ACL for Windows 7 Reference Manual
INSERT( )
Function Format
INCLUDE(C1,C2)
INCLUDE( ) returns a string consisting of only those characters from C1 that appear in
C2, in the same order that they appear in C1.
Examples
INCLUDE("123 any street","0123456789")="123"
To create a Prod field that retains only the digits from the Prodno field, specify:
INCLUDE(Prodno,"123456789")
INSERT( )
INSERT( ) inserts characters or blanks into a character string, in any position.
Use INSERT( )to normalize data for formatting, for duplicate matching, and for Join
and Relations commands, which require identical fields.
For example, part numbers in one file may be in the format “12345”, and in another file,
“12-345.” You can use INSERT( ) to insert a hyphen (-) in position 3.
Function Format
INSERT(C1,C2,N)
INSERT( ) returns a string where the string C2 is inserted into the string C1, at the
position N. If N is greater than the length of string C1, string C2 is placed at the end of
string C1. If N is less than or equal to 1, string C2 is placed in front of string C1.
Examples
INSERT("abcde","XXX",2) = "aXXXbcde"
INSERT("abcde","XXX",8) = "abcdeXXX"
INSERT("abcde","XXX",0) = "XXXabcde"
INTEGER( )
INT( ) returns the integer value of a numeric expression or field value.
Use INT( ) to either ignore or isolate the fractional part of an expression.
Chapter 2 Functions 53
ISBLANK( )
Function Format
INTEGER(N)
The INT( ) function returns the integer value of the numeric expression or field value N.
Note: Some other software packages define the INT of a negative value as being the next
lower value, that is, INT(-7.9) = -8. This is not the case with ACL, as negative values tend
to mean accounting credits in financial data, and not truly negative amounts.
Examples
INT(7.9)= 7
INT(-7.9)= -7
To create the field Cents, which is the portion of the Amount field you are interested in,
specify:
Amount - INT(Amount)
ISBLANK( )
ISBLANK( ) returns True or False, depending on whether a string consists entirely of
blanks.
Use ISBLANK( ) to find records with missing information. This function searches for
blank entries in fields that should not contain them, and is intended for logical testing.
Function Format
ISBLANK(C)
ISBLANK( ) returns True if the string C consists entirely of blanks and False if it does
not. ISBLANK( ) only identifies true blanks in printable data, not invalid characters that
appear as blanks in a view.
ISBLANK( ) may not return useful results with character fields that contain null
characters (binary zeros). ACL and some programming languages use the null character
to indicate the end of a string. Consequently, ISBLANK( ) will not read any character
data that follows a null character, including blanks.
Examples
ISBLANK(" A") = F
ISBLANK(" ") = T
ISBLANK("") = T
54 ACL for Windows 7 Reference Manual
LAST( )
LAST( )
LAST( ) returns a specified number of characters from the end of a string.
Function Format
LAST(C,#)
Where C is the source string, and # is a numeric constant.
LAST( ) returns a string containing the last # of characters from the end of string C.
When there are insufficient characters to fill the resulting string, blanks are added to the
left of the string.
Examples
LAST("abcdefghi",5) = "efghi"
LAST("abcdefghi ",5) = "ghi "
LAST("abc",6) = " abc"
LEADING( )
LEADING( ) returns a character string containing a specified number of leading digits.
Use LEADING( ) to filter out non-digit elements such as leading zeros, non-numeric
digits, and punctuation such as decimals or dollar signs.
Function Format
LEADING(N,#)
N must be a positive whole number greater than 0.
Examples
If a numeric field called Amount contains the value $-6,234.56, the value analyzed is:
LEADING(Amount,3) = "623"
LEADING(Amount,5) = "62345"
If a numeric field called Amount contains the value $0.00, the value analyzed is:
LEADING(Amount,3) = "000"
LEADING(Amount,5) = "00000"
If a numeric field called Amount contains the value $3.55, the value analyzed is:
LEADING(Amount,3) = "355"
LEADING(Amount,5) = "35500"
Chapter 2 Functions 55
LENGTH( )
LENGTH( )
LENGTH( ) returns the length of a specified string.
Function Format
LENGTH(C)
LENGTH( ) counts the number of characters in C and returns that number.
Note: ACL counts any trailing blanks in the length. If you do not want trailing blanks to be
counted, use the TRIM( ) function to remove the trailing blanks.
Examples
LENGTH("ABCDE")=5
To create a field that is the length of the Name field excluding trailing blanks, specify:
LENGTH(TRIM(Name))
LOGARITHM( )
LOG( ) returns the logarithm (base 10) of a numeric expression or field value with a
specified number of decimal places.
LOG( ) is the inverse of the EXP( ) function.
Use LOG( ) for financial applications requiring complex mathematical calculations.
Function Format
LOGARITHM(N,#)
Where # is a numeric constant representing decimal places that cannot change from
record to record.
LOG( ) returns the common logarithm (base 10) of the numeric expression or field
value N with # decimal places. The logarithm of a number is the exponent (or power) of
10 needed to generate that number. Therefore, the logarithm of 1000 is 3. The inverse of
a logarithm is its exponent.
56 ACL for Windows 7 Reference Manual
LOWER( )
Examples
LOG(1000,4) = 3.0000
LOG(72443,2) = 4.86
To create a field that is the cube root of the field X to two decimal places, specify:
EXP(LOG(X,6)3,2)
Note: You determine the Nth root by dividing the log of the value by N and taking the
exponential value of the result.
LOWER( )
LOWER( ) converts all alphabetic characters of an expression or field to lowercase.
Use LOWER( ) when you search for data that is in mixed or unknown case, or when you
want data in lowercase for formatting.
LOWER( ) is the inverse of the UPPER( ) function.
Function Format
LOWER(C)
The LOWER( ) function converts all alphabetic characters in a string C to lowercase. All
non-alphabetic characters are left unchanged. For more information, see “PROPER( )”
on page 66, which converts alphabetic characters to uppercase and lowercase; and
“UPPER( )” on page 83, which converts alphabetic characters to uppercase.
Examples
LOWER("ABC")= "abc"
LOWER("abc 123 DEF")= "abc 123 def"
LOWER("AbCd 12")= "abcd 12"
To create a Name field in lowercase, specify:
LOWER(Name)
LTRIM( )
LTRIM( ) returns a variable length string with any leading blanks removed.
LTRIM( ) is similar to the TRIM( ) function, which removes any trailing blanks from a
string, and to ALLTRIM( ), which removes leading and trailing blanks.
Chapter 2 Functions 57
MAP( )
Function Format
LTRIM(C)
The string C is copied to the result and any leading blanks are omitted.
See also “TRIM( )” on page 82.
Examples
LTRIM(" AB C ")="AB C "
LTRIM("ABC")="ABC"
LTRIM(" A ")="A "
MAP( )
MAP( ) performs a character-by-character comparison of a source string with a
specified format string, and returns a True or False value. The format string can contain
wildcard characters, literal characters, or both.
Use MAP( ) to perform wildcard or literal comparisons in ACL, particularly for creating
filters that are not based on literal text.
Function Format
MAP(C1,C2)
Where C1 is the source string to be compared and C2 is the format string.
If C2 is longer than C1, the result will be False. If C2 is shorter, MAP( ) only compares
characters to the length of C2. The remaining characters in the string C1 will not affect
the returned value.
MAP( ) returns True if C1 matches C2. It returns False if C1 does not match C2.
The format string (C2) can contain literal characters, which match only if the same
character exists in the same position in the source string. You can also specify the
following character types:
The alphabetic character type is not case-sensitive. You can use “X” or “x.”
Blanks can be entered as blanks, without “\” in front.
Use “\” before any formatting character that must be literally present in the format
string. For example, to specify “X” as literal, enter “\X” in the format string. To specify a
backslash as literal, enter “\\”. A single “\” as the last character in the string C2 will be
ignored.
Examples
MAP("ABC123","xxx999") = T
MAP("ABC123","XX999") = F
MAP("A bc123","X XX999") = T
MAP("A bc123","XXX999") = F
MAP("ABC123","ABC999) = T
MAP("ABC123","XXC999") = T
MAP("WXY123","W\XY999") = T
MAP("ABC123","XXX 9999") = F
MAP("A1 B23","XXXX") = F
MAP("A1 B23","!!!!") = F
MASK( )
MASK( ) extracts individual bits from the first byte of a character expression.
Use MASK( ) to identify specific bit patterns in a byte of data.
Function Format
MASK(C1,C2)
MASK( ) performs a bit-wise logical AND operation on the first characters of C1 and
C2, returning a one-character-long string. If either parameter is longer than one byte,
subsequent characters are ignored. The usual usage is to have the byte in question as C1
and a mask value as C2.
A bit-wise AND operation compares the two bytes, one bit at a time. The result for each
bit position is 1 if both the corresponding bits are 1. Otherwise, the result is 0 for that bit.
Chapter 2 Functions 59
MATCH( )
Example
MASK("A",CHR(15)) = CHR(1)
(where “A” = 65 = 11000001, 15 = 00001111, A and 15 = 00000001)
MATCH( )
MATCH( ) compares an expression or field value of any type to a series of specified
expressions or field values to determine whether there is at least one match. The value
returned is either true or false.
Use MATCH( ) to eliminate the need to repeat arguments in a test.
Function Format
MATCH(comparison_value,test1,test2 <,test 3...>)
MATCH( ) returns a true or false value, depending on whether the comparison value is
equal to any of the subsequent tests. Any number of tests can be included, each
consisting of a constant, field value, or expression. The tests can be of any type
(character, numeric, or logical), as long as all are the same type. For example:
IF LOC = 7 OR LOC = 9 OR LOC = 13 OR LOC = 21 OR LOC = 44
can be replaced with:
IF MATCH(LOC, 7, 9, 13, 21, 44)
Examples
MATCH(7,1,3,5,7,9) = T
because 7 is included in 1, 3, 5, 7, 9
MATCH(7,2,4,6,8,10) = F
because 7 is not included in 2, 4, 6, 8, 10
MATCH('BILL','JOHN','ANDY') = F
If locations 01, 02, and 22 represent your research division, to create a Research filter that
excludes all other departments, specify:
60 ACL for Windows 7 Reference Manual
MAXIMUM( )
Extract records
Condition
MAXIMUM( )
MAXIMUM( ) returns the greater of two numbers.
MAXIMUM( ) is the opposite of the MINIMUM( ) function.
Chapter 2 Functions 61
MINIMUM( )
Function Format
MAXIMUM(N1,N2)
If N1 is greater than N2, MAXIMUM( ) returns N1. Otherwise, it returns N2.
If the number of decimals in the two number parameters is different, the result is
adjusted to the greater number of decimals.
Examples
MAX(4,7)= 7
MAX(7.5,4)= 7.5
MAX(7,4.55)= 7.00
If you have a file of overdue accounts, to create an Interest_Due field that has a minimum
value of $1.00 or greater, specify:
MAXIMUM(BALANCE * ANNUAL_RATE,1)
If the balance multiplied by the interest rate is less than one dollar, MAX( ) returns 1.
Otherwise, MAX( ) returns the calculated interest amount.
MINIMUM( )
MINIMUM( ) returns the lesser of two specified numbers.
MINIMUM( ) is the opposite of the MAXIMUM( ) function.
Function Format
MINIMUM(N1,N2)
If N1 is smaller than N2, MINIMUM( ) returns N1. Otherwise, it returns N2.
If the number of decimals in the two numbers is different, MINIMUM( ) adjusts the
result to the greater number of decimals.
Examples
MIN(4,7)= 4
MIN(7.5,4)= 4.0
MIN(7,4.55) = 4.55
In an inventory file, to create a field containing the lower of the Cost and Sale price,
specify:
MINIMUM(Cost,Salepr)
62 ACL for Windows 7 Reference Manual
MOD( )
MOD( )
MOD( ) divides two numbers and returns the remainder.
Use MOD( ) to test if two numbers divide evenly or to isolate the remainder of a division
calculation.
Function Format
MOD(N1,N2)
MOD( ) returns the remainder left over after the second number N2 is divided into N1.
The remainder has the same number of decimals as the larger of the two numbers.
Examples
MOD(93,10)= 3
MOD(66,16.00)= 2.00
MOD(53.45,10)= 3.45
In a payroll file, to define a field that shows the number of months since the last
anniversary, specify:
MOD(Months_Of_Service,12)
NOMINAL( )
NOMINAL( ) calculates the annual nominal interest rate of a loan.
Use NOMINAL( ) to determine the nominal annual interest rate, given the effective rate
and the number of compounding periods per year. For example, if you know the
effective annual rate on your credit card, but want to know the rate actually used to
calculate interest on a monthly basis, you would use this function. For more infor-
mation, see “Financial Functions” on page 258 of the ACL for Windows User Guide.
Function Format
NOMINAL(effective_rate, periods)
effective_rate is the effective annual interest rate.
If you enter an obviously invalid parameter such as a negative interest rate, ACL returns
an error.
Example
If you know that the effective annual rate on your credit card is 19.56%, to calculate the
rate used monthly, specify:
NOMINAL(.1956,12) = 0.17998457
This shows that the monthly rate is 18%.
NPER( )
NPER( ) calculates the number of periods required to pay off a loan.
Use NPER( ) to determine how long it will take to repay a debt. For example, if you are
paying $500 monthly on your car loan, you could use this function to know when the
debt will be cleared. For more information, see “Financial Functions” on page 258 of the
ACL for Windows User Guide.
Function Format
NPER(rate,payment,amount)
rate is the interest rate per period.
NPER( ) assumes that payments are made at the end of the period.
The result is returned to two decimal places. For example, 8.33 periods indicates that the
balance outstanding after eight periods is approximately one third of a payment.
If you enter an obviously invalid parameter such as a negative interest rate, ACL returns
an error.
Example
To calculate the number of periods required to repay a 1,000 loan with monthly
payments of 50 at 8%:
NPER(.08/12,50,1000) = 21.54
This shows that the loan will be repaid in 22 months.
64 ACL for Windows 7 Reference Manual
OCCURS( )
OCCURS( )
OCCURS( ) counts the number of times a character string occurs within another
character string.
You could use OCCURS( ), for example, to find out how many times “New York” occurs
in an address field.
Function Format
OCCURS(C1,C2)
OCCURS( ) returns the number of times string C2 occurs in string C1. All comparisons
are case-sensitive.
Examples
OCCURS("abc/abc/a","ab") = 2
OCCURS("abc/abc/a","a") = 3
OFFSET( )
OFFSET( ) adjusts the starting position of a field in the current record.
Use OFFSET( ) to process variably occurring data, such as that defined with a COBOL
OCCURS clause.You can also use OFFSET( ) in very complex record structures (such as
IBM SMF files), in which a block of data has a variable starting position or an array has
a variable number of values.
Function Format
OFFSET(F,N)
The OFFSET( ) function temporarily offsets the starting position of a field by N, where N
is any valid positive numeric expression.
Note: Be careful when using the OFFSET( ) function with conditional fields, because the
fields referred to in the IF test will also be offset.
Examples
Given record “01234567890” and numeric field X starting in position 1 with a length of
3 and no decimals:
X = 12
OFFSET(X,1) = 123
OFFSET(X,6) = 678
Chapter 2 Functions 65
PACKED( )
If a record contains a variable length field followed by another field X, use OFFSET( ) to
define the field location. Assume field L is the length of the variable field and that you
have already used the Input File Definition window to define field X as starting in
position 54 if L is zero. To read the contents of field X, define the following field:
OFFSET(X,L)
PACKED( )
PACKED( ) converts a number to a packed field type of a specified length.
Use PACKED( ) to create numeric data in packed format. This may be required when
creating data to be read by external applications. For information on the packed field
type see “Packed” on page 18.
See “UNSIGNED( )” on page 82 for an alternative method of converting numeric data.
Function Format
PACKED(N1,#)
PACKED( ) converts N1 to PACKED data with the length, in bytes, specified by #. If # is
too short to store all of N1, significant digits are truncated.
Note: Since the output from this function is not printable, you should generally include it
only in conjunction with creating a file. A view will not show the data as you expect.
Examples
PACKED(75,3)= 00075C (hex)
PACKED(7.5,3)= 00075C (hex)
PACKED(-12.456,6)= 00000012456D (hex)
PACKED(-12.456,2)= 456D (hex)
To create an 8-byte field containing each employee’s salary as a PACKED number for
uploading to a mainframe, specify:
PACKED(SALARY,8)
PMT( )
PMT( ) calculates the periodic payment required to repay a debt.
Use PMT( ) to determine the payment required to repay an investment or loan,
assuming constant payments and a constant interest rate. For example, if you borrow
money you would use this function to determine the amount of your payments. For
66 ACL for Windows 7 Reference Manual
PROPER( )
more information, see “Financial Functions” on page 258 of the ACL for Windows User
Guide.
Function Format
PMT(rate,periods,amount)
rate is the interest rate per period.
The payment returned by PMT( ) includes principal and interest only, and assumes the
payments are made at the end of each period.
The result is returned to two decimal places.
If you enter an obviously invalid parameter such as a negative interest rate, ACL returns
an error.
Example
If you want to determine the monthly payments required to repay a $10,000 loan over 24
months, at 8% compounded monthly, specify:
PMT(.08/12,24,10000) = 452.27
PROPER( )
PROPER( ) converts alphabetic characters in a string or field to mixed case, as appro-
priate for proper name representation.
PROPER( ) is useful for tasks such as producing confirmation letters.
Function Format
PROPER(C)
The PROPER( ) function takes a single character string (C) and converts it to uppercase
and lowercase in the appropriate manner for representing proper names. PROPER( )
uses the rule that the first alphabetic character is converted to uppercase and any
following alphabetic characters are converted to lowercase. See also “UPPER( )” on
page 83 and “LOWER( )” on page 56, which convert alphabetic characters to uppercase
and lowercase, respectively.
Chapter 2 Functions 67
PVANNUITY( )
Examples
PROPER("JOHN DOE")= "John Doe"
PROPER("john doe")= "John Doe"
PROPER("123 AnyWhere St.")= "123 Anywhere St."
PROPER("BILL O'HARA")= "Bill O'Hara"
PVANNUITY( )
PVANNUITY( ) calculates the present value of a series of payments.
Use PVANNUITY( ) when you want to determine what a series of future payments is
worth now. For example, when you borrow money, the loan amount is the present
value to the lender. For more information, see “Financial Functions” on page 258 of the
ACL for Windows User Guide.
Function Format
PVANNUITY(rate, periods,amount)
rate is the interest rate per period.
amount is the payment made at the end of each period and cannot change over the life
of the annuity.
The result is returned to two decimal places.
PVANNUITY( ) assumes a future value of zero and calculates the result based on
payments at the end of the period.
If you enter an obviously invalid parameter such as a negative interest rate, ACL returns
an error.
Example
At an interest rate of 8% per annum, to calculate the value of receiving $500 a month for
the next 20 years, specify:
PVA(0.08/12,12*20,500) = 59,777.15
68 ACL for Windows 7 Reference Manual
PVLUMPSUM( )
PVLUMPSUM( )
PVLUMPSUM( ) calculates the present value of a lump sum that is due in a number of
periods.
Use PVLUMPSUM( ) to determine the present value of an amount to be received or
paid in the future. The present value is the amount that a payment due in the future is
worth today, based on an assumed interest rate. For example, if you owe money at a
future date, the present value is the amount you need to put in the bank now, with
compound interest, to cover the debt when it is due. For more information, see
“Financial Functions” on page 258 of the ACL for Windows User Guide.
Function Format
PVLUMPSUM(rate,periods,amount)
rate is the interest rate per period.
Example
Assuming an interest rate of 11% per annum compounded monthly, the present value of
$10,000 due in three years is:
PVLUMPSUM(.11/12,3*12,10000) = 7,200.05
Chapter 2 Functions 69
RAND( ) or RND( )
RAND( ) or RND( )
RAND( ) or RND( ) returns a random number between zero and the value of a specified
numeric expression or field value.
Use RAND( ) when you need to generate a random number for use inside or outside of
ACL.
Function Format
RANDOM(N) or RND(N)
RAND( ) or RND( ) returns a random number greater than or equal to 0 and less than
the numeric expression or field value N. The random number generated has the same
number of decimals as N.
Note: If you use RAND( ) or RND( ) twice consecutively with the same value, it produces
different results. The sequence is not reseeded before ACL generates the second result. To
reseed the sequence, use the RANDOM command.
Examples
RAND(1000.00)= 278.61
RND(10000)= 3781
RATE( )
RATE( ) calculates the interest rate per period implied by an annuity.
Use RATE( ) to determine the rate of interest being paid on an annuity. For example, if
you have the option of leasing or buying, you can use this function to determine the
interest rate implied in the lease. For more information, see “Financial Functions” on
page 258 of the ACL for Windows User Guide.
Function Format
RATE(periods,payment,amount)
periods is the total number of periods.
RATE( ) assumes that payments are made at the end of the period.
The result is returned to eight decimal places, that is, 0.12345678 or 12.345678%.
70 ACL for Windows 7 Reference Manual
RECLEN( )
If you enter an obviously invalid parameter such as a negative interest rate, ACL returns
an error.
Example
To calculate the rate implied in a four-year, $8000 loan with monthly payments of $200,
specify:
RATE(48,200,8000) = .00770147
This is the monthly rate because the period is monthly. The annual rate is 0.0077*12,
which equals 9.24% compounded monthly, or an effective annual rate of 9.64% (using
the EFFECTIVE( ) function).
RECLEN( )
RECLEN( ) returns the length of the current record.
Use RECLEN( ) to test for short records, or for records of a particular length. It is
especially useful with CR/LF (report) files, because it provides an easy way to examine
the record lengths.
Function Format
RECLEN()
RECLEN( ) returns the length of the current record.
For more information on how to determine the current record, see “RECNO( )” on
page 71.
For fixed length records, the result is a constant (the record length). For variable length
records, the result changes for each record.
Example
RECLEN() = 110
To extract all records in which the length is exactly 110 (presuming that this is the record
type of interest to you), specify:
Chapter 2 Functions 71
RECNO( )
Extract records
Condition
RECNO( )
RECNO( ) returns the current logical record number, counting from 1.
Use RECNO( ) to output record numbers to a file, or when examining a file for the first
time to determine the relative location of a particular record within a file.
Function Format
RECNO()
RECNO( ) returns the current logical record number. If the file is not indexed,
RECNO( ) starts with a value of 1 and increases by one for each record in the file. The
logical and physical record numbers are identical.
If the file is indexed, RECNO( ) behaves similarly, but in a logical, not physical order. If
the SEEK or FIND commands are used, the record number is reset to 1 after you execute
these commands.
72 ACL for Windows 7 Reference Manual
REMOVE( )
Example
For record 99:
RECNO() = 99
REMOVE( )
REMOVE( ) takes out unwanted characters from a character string or field value.
Use REMOVE( ) for normalizing data fields that do not have a consistent format, such as
address fields. This function is also useful to remove punctuation or other invalid infor-
mation from fields which have been poorly edited or have had no input edits applied.
REMOVE( ) may be required before executing subsequent Sort or Join commands, or to
make the data more regular for formatting or duplicate matching.
Note: This function has been superseded by the functions INCLUDE( ) and EXCLUDE( ).
It is still available in the current version for backwards compatibility with earlier versions of
ACL for Windows.
Function Format
REMOVE(C1,C2)
The REMOVE( ) function removes unwanted characters from string C1, retaining only
the specified characters C2. This is similar in intent to CLEAN( ), but its operation is
very different. CLEAN( ) fills the remainder of a field with blanks, whereas REMOVE( )
moves any valid characters to the left side of the field, retaining their order and adding
blanks to the end result so the length is the same as C1.
Assume that you have an inventory transaction file, in which the product number,
Prodno, does not have clean field contents. You want to sort the file on similar product
numbers. The file may contain “AB/123Q”, “AB123 Q”, and “AB 123-Q”, all of which
refer to the same product, but sort very differently. The REMOVE( ) function allows the
field to be normalized so that the Sort command can operate correctly, converting each
of the above examples to “AB123Q.”
For more information on including and excluding characters in a string, see
“INCLUDE( )” on page 51 and “EXCLUDE( )” on page 44.
Examples
REMOVE("ABC 123 XX4", "ABC123") = "ABC123 "
REMOVE("zABC 123 XX4", "ABCX123") = "ABC123XX "
REMOVE("ABC 123 XX4", "1234567890") = "1234 "
Chapter 2 Functions 73
REPEAT( )
To create a field for sorting or matching that contains only the numbers from a product
number field, specify:
REMOVE(Prodno,"123456789")
REPEAT( )
REPEAT( ) returns a string that repeats a constant value a specified number of times.
Use REPEAT( ) to initialize a variable with constant values or blanks, or to set a default
value for a computed field. It is useful for advanced programming applications.
Function Format
REPEAT(C,#)
REPEAT( ) returns a string in which the string C is repeated the number of times
specified by #, where # is a fixed numeric constant. The maximum length of the
returned string is the length of the string C multiplied by #.
Examples
REPEAT("ABC",3) = "ABCABCABC"
REPEAT("0",9) = "000000000"
REPLACE( )
REPLACE( ) replaces all instances of a specified character string with a new character
string.
Use REPLACE( ) for normalizing data fields with inconsistent formats, such as address
fields, or for replacing invalid information in poorly edited fields. You can also use
REPLACE( ) for consistency in formatting, for duplicate matching, and for Join and
Relations commands, which require identical fields.
You can also use REPLACE( ) to remove a specified character string from a source
string, by replacing it with an empty character string (“” ).
Function Format
REPLACE(C1,C2,C3)
Where C1 is the source string, C2 is the string to be replaced, and C3 is the new string.
Character comparisons are case-sensitive.
REPLACE( ) returns a fixed-length string in which each occurrence of C2 in C1 is
replaced by C3. ACL automatically increases the field length to accommodate a single
74 ACL for Windows 7 Reference Manual
REPLACE( )
replacement. The maximum field length is the greater of the length of C1 or the length of
(C1 - C2 + C3). If the resulting string is shorter than the source string C1, blanks are
added to the end of the string to make up the difference.
However, with multiple replacements, the new contents of the data field could exceed
field length. When this happens, ACL truncates data at the end of the field. To avoid loss
of information, ensure that the field is long enough to accommodate the possible
increase in data length. Two methods for increasing field length are described in the
following section.
Examples
REPLACE ("abcdefg","bcd","12345") = "a12345efg"
REPLACE("Road","Road","Rd.") = "Rd. "
REPLACE("abc","b","") = "ac "
In the following example, the returned string is truncated because multiple replace-
ments make the returned string C3 longer than string C2:
REPLACE("abc/abc/abc","b","12") = "a12c/a12c/a1"
In this case, ACL increased the length of the field from 11 to 12 bytes to allow for one
replacement (11 - 1 + 2 = 12). Because there were three replacements, the returned
string is 2 bytes longer (11 - 1 + 2 - 1 + 2 - 1 + 2 = 14), and the last 2 bytes of the returned
string are truncated.
There are several ways you can increase the field length to accommodate the increased
length of the returned string. One way is to use the new BLANKS( ) function to add
blanks to the source string before you use REPLACE( ):
"abc/abc/abc"+BLANKS(2) = "abc/abc/abc "
Now
REPLACE("abc/abc/abc ","b","12") = "a12c/a12c/a12c"
Another way to increase the field length is to add spaces to the end of a field using the
expression:
<fields> + " "
Chapter 2 Functions 75
REVERSE( )
REVERSE( )
REVERSE( ) reverses the order of characters in a string.
Function Format
REVERSE(C)
REVERSE( ) returns a string in which the characters of the string C are reversed.
Example
REVERSE("ABCD E") = "E DCBA"
RJUSTIFY( )
RJUSTIFY( ) returns a right-justified string the same length as a specified string, with
any trailing blanks moved to the front of the string.
Use RJUSTIFY( ) to right-justify a field.
Function Format
RJUSTIFY(C)
Example
RJUSTIFY("ABC ") = " ABC"
ROOT( )
ROOT( ) returns the square root of a numeric expression or field value. You must
specify the number of decimal places in the result.
Function Format
ROOT(N,#)
Where # is a numeric constant representing decimal places that cannot change from
record to record.
ROOT( ) returns the square root of the numeric expression or field value N with #
decimal places. The result is rounded appropriately. This function returns zero for
negative values of N. For performing other root functions (such as cube root), see
“LOGARITHM( )” on page 55.
76 ACL for Windows 7 Reference Manual
ROUND( )
Examples
ROOT(100,2) = 10.00
ROOT(1000,4) = 31.6228
ROUND( )
ROUND( ) returns a rounded whole number from a numeric expression or field value.
Use ROUND( ) whenever you want to round an expression to the nearest whole
number.
Function Format
ROUND(N)
ROUND( ) returns a number equal to the numeric expression or field value N rounded
to the nearest integer. This function rounds 0.5 upwards (for example, away from zero).
This function is exactly the same as DECIMAL(N,0).
Examples
ROUND(7.2) = 7
ROUND(7.5) = 8
ROUND(-7.5) = -8
To create a field that is equal to the balance rounded to the nearest dollar value, specify:
ROUND(Balance)
SHIFT( )
SHIFT( ) moves bits in the first character of an expression or field value left or right by a
specified number of bits.
Use SHIFT( ) in conjunction with the BYTE( ), CHR( ) and MASK( ) functions to
isolate and move individual bits in a record.
Function Format
SHIFT(C,N)
The SHIFT( ) function takes the first character of C and shifts the bits left or right by N
bits. It returns a one-character long string. If C is longer than 1, the extra characters are
ignored. If N is positive, the character is shifted to the left; if negative, the character is
shifted to the right. All bits shifted in from either end are zeroes. If N is greater than 7 or
less than -7 the result is binary zero, CHR(0).
Chapter 2 Functions 77
SOUNDEX( )
Examples
SHIFT(CHR(22),2) = CHR(88)
00010110 becomes 01011000
SHIFT(CHR(16),-1) = CHR(8)
00010000 becomes 00001000
SHIFT(CHR(155),5) = CHR(96)
10011011 becomes 01100000
SOUNDEX( )
SOUNDEX( ) returns a four-character value for a specified string which you can
compare with the value of another string to see if both strings are phonetically similar.
This function is useful if you want to find items with duplicate entries or items where
spelling is inconsistent.
The first character in the value represents the first letter in the string. The next three
characters in the value represent phonetically similar consonant groups in the string.
SOUNDEX( ) ignores both capitalization and vowels in the string and only uses the first
three consonant groups in long arguments.
For an alternative method of phonetically comparing strings, see “SOUNDSLIKE( )” on
page 77.
Function Format
SOUNDEX(C)
Examples
SOUNDEX("Fairview Ind") = "F615"
SOUNDEX("Fairview Media") = "F615"
SOUNDEX("Fairviews Media") = "F612"
SOUNDSLIKE( )
SOUNDSLIKE( ) returns True or False to indicate whether two strings sound phoneti-
cally alike.
SOUNDSLIKE( ) first converts the strings to four-character codes as described in
SOUNDEX( ). It then compares each string’s SOUNDEX( ) code and returns True if the
codes are equal and False if they are not.
78 ACL for Windows 7 Reference Manual
SPLIT( )
Function Format
SOUNDSLIKE(C1,C2)
Examples
SOUNDSLIKE("Fairview Media", "fairview ind") = T
SOUNDSLIKE("Fairviews Media", "fairview ind") = F
To create a filter that identifies all names that sound like “Smith”, specify:
SOUNDSLIKE(NAME,"Smith")
SPLIT( )
SPLIT( ) breaks a character string into segments separated by characters such as spaces
or commas, and returns a specified segment. Any character or string can be used as the
separator.
Function Format
SPLIT(C1,C2,N)
Where C1 is the source string, C2 is the character (or the character string) used as a
separator, and N is the segment to be returned. SPLIT( ) returns segment N. If N does not
exist, or is less than 1, SPLIT( ) returns an empty string.
The characters between, but not including, two separators make up a segment. When
the source string begins with a separator, the segment that follows is treated as segment
two. The comparison of the strings is case-sensitive.
Examples
SPLIT("abc,def,ghijkl",",",2) = "def"
SPLIT("abc,def,ghijkl",",",3) = "ghijkl"
SPLIT("abc/*def/*ghijkl","/*",3) = "ghijkl"
SPLIT("Jane Doe"," ",2) = "Doe"
SPLIT("/abc/efg/","/",2) = "abc"
SPLIT("abc,def,,ghi",",",3) = ""
Chapter 2 Functions 79
STRING( )
STRING( )
STRING( ) converts a numeric expression or field value into a string of characters.
Use STRING( ) to convert a numeric expression or field value to character format for
use as a key field in an ACL command, such as Summarize or Join.
Function Format
STRING(N,# <,C>)
STRING( ) converts the numeric expression or field value N into a string of length #. The
resulting string has a leading minus sign if N is negative and has the same number of
decimal places as N (unless otherwise specified by the optimal format C, as discussed
below).
You can specify an optional numeric format as a third parameter to format the
numerical result of the function. Ensure that this is a valid character expression.
For details on formatting, refer to “Numeric Fields” on page 139 of the ACL for Windows
User Guide.
If the resulting string is shorter than #, leading blanks are added. If the resulting string is
longer than #, leading characters are truncated without notification starting with the
minus sign, if any.
STRING( ) is the opposite of VALUE( ).
Examples
STRING(125.2,7) = " 125.2"
STRING(-125.2,4) = "25.2"
STRING(-125.2,7) = " -125.2"
These examples show the use of the optional numeric format parameter:
STRING(-125.2,10, "(9,999.99)") = " (125.20)"
STRING(-125.2,6, "(9,999.99)") = "25.20)"
To create a field that converts the PACKED field Cust to a string so that it can be used as
a key field, specify:
STRING(Cust,8)
SUBSTRING( )
SUBSTR( ) returns a substring of a character expression or field value.
Use SUBSTR( ) to isolate a portion of a character expression or field value.
80 ACL for Windows 7 Reference Manual
TEST( )
Function Format
SUBSTRING(C,N1,N2)
SUBSTR( ) returns a substring of the character expression or field value C. The result is
N2 characters long, starting at position N1 in C.
Examples
SUBSTR("ABCDEF",2,3)="BCD"
To extract the year out of a character field containing a date of the form
“MM/DD/YYYY”, specify:
SUBSTR(DATE,7,4)
TEST( )
TEST( ) returns True, if a specified text string starts at a specified byte location within a
record. Otherwise, TEST( ) returns False.
TEST( ) is automatically used when you create a filter in the Create a data filter window.
This is the most appropriate way to reference the TEST( ) function.
Function Format
TEST(N,C)
TEST( ) examines a record to see if a character string C starts at the specified position N.
If so, TEST( ) returns True. Otherwise, it returns False, even if C appears at another
position in the line.
Note: The parameters in TEST( ) are case-sensitive. Specifying “DEPT” does not find
“Dept.” If there is a chance the case may be mixed, first use the UPPER( ) function to
convert all characters to uppercase.
Examples
Given a record containing:
Dept Name: Marketing
....|....1....|....2...
TEST(5,'Dept') = T
TEST(6,'Dept') = F (Dept starts in position 5, not 6)
TEST(5,'DEPT') = F (the case is incorrect)
Chapter 2 Functions 81
TIME( )
TIME( )
TIME( ) returns the system clock time and date.
Use TIME( ) to determine the current time or the duration of specific tasks.
Function Format
TIME()
TIME( ) returns the time and date according to the system clock in the form
HH:MM:SS, as an eight-byte-long character string. Its value is unaffected by either field
or record contents.
Example
TIME() = "15:38:52"
Below is a more complex example. To determine the elapsed time for a command, you
can convert the result of this function to a number of seconds before the command
starts, repeat the process on completion, and subtract the two values, as follows:
These calculations take the separate portions of the time and calculate the number of
seconds since midnight, before and after the operations.
TRANSFORM( )
TRANSFORM( ) reverses the display order of bidirectional data in a character string or
field.
Use TRANSFORM( ) to make Hebrew characters display correctly.
82 ACL for Windows 7 Reference Manual
TRIM( )
Function Format
TRANSFORM(C)
TRANSFORM( ) identifies bidirectional data and displays it correctly in the view, from
right to left. All other characters display from left to right.
Example
TRANSFORM("ABC ZYX 123") = "ABC XYZ 123"
Where XYZ are the only Hebrew/bidirectional characters in the string.
TRIM( )
TRIM( ) returns a variable length string with any trailing blanks removed.
TRIM( ) is similar to the LTRIM( ) function, which removes leading blanks from a
string, and to ALLTRIM( ), which removes leading and trailing blanks.
Function Format
TRIM(C)
The string C is copied to the result and any trailing blanks are omitted. For more infor-
mation, see “Functions” on page 23.
Examples
TRIM(" AB C ") = " AB C"
TRIM("ABC") = "ABC"
TRIM(" A ") = " A"
Given the two fields First and Last, to create a Name field of the form “Last, First”,
specify:
TRIM(Last) + ',' + TRIM(First)
UNSIGNED( )
UNSIGNED( ) converts a number to an unsigned data type of a specified length.
Use UNSIGNED( ) to create numeric data in unsigned format. This may be required
when creating data to be read by external applications. For information on the unsigned
field type see “Unsigned” on page 21.
See “PACKED( )” on page 65. For an alternative method of converting numeric data.
Chapter 2 Functions 83
UPPER( )
Function Format
UNSIGNED(N1,#)
UNSIGNED( ) converts N1 to UNSIGNED data of the byte length specified by #.
If the length is too short to store the entire number, significant digits are truncated. If N1
is negative, the minus sign is deleted. For example:
UNS(-12.456,6) = 000000012456 (hex)
Note: Since the output from this function is not printable, you should generally include it
only in conjunction with creating a file. A view will not show the data as you expect.
Examples
UNS(75,3) = 000075 (hex)
UNS(-75,3) = 000075 (hex)
UNS(7.5,3) = 000075 (hex)
UNS(12456,2) = 2456 (hex)
UPPER( )
UPPER( ) converts all alphabetic characters of an expression or field value to uppercase.
Use UPPER( ) when you search for data in mixed or unknown case.
Function Format
UPPER(C)
The UPPER( ) function converts all alphabetic characters in C to uppercase. All
non-alphabetic characters are left unchanged.
See also“PROPER( )” on page 66, which converts alphabetic characters to uppercase
and lowercase; and “LOWER( )” on page 56, which converts alphabetic characters to
lowercase.
Examples
UPPER("ABC") = "ABC"
UPPER("abc 123 DEF") = "ABC 123 DEF"
UPPER("AbCd 12") = "ABCD 12"
84 ACL for Windows 7 Reference Manual
VALUE( )
If capitalization is a concern, you can identify all customers named “Smith” by speci-
fying:
UPPER(NAME) = "SMITH"
VALUE( )
VALUE( ) converts a character expression or field into a numeric equivalent.
Use VALUE( ) if you need to convert a character expression or field value to a numeric
value for use in ACL commands.
VALUE( ) returns the numeric equivalent of a character expression or field value with a
specified number of decimal places. If the decimal adjustment results in a loss of
decimals, the result is rounded.
VALUE( ) accepts numbers in any format. You can use any numeric formatting accepted
by the print field type such as punctuation, leading or trailing signs, and parentheses as
input.
If a string such as “123” contains no decimals, ACL treats the number as an integer. For
example, in converting ("123", 2) when you specify two decimal places, ACL interprets
“123” as 123.00 not 1.23.
Compare VALUE( ) to STRING( ).
Function Format
VALUE(C,#)
Where # is a numeric constant that cannot change from record to record.
Examples
VALUE("123.4-",3) = -123.400
VALUE("$123,456",2) = 123456.00
VALUE("77.45CR",2) = -77.45
VALUE(" (123,456.78)",0) = -123457
VERIFY( )
VERIFY( ) determines whether a field contains valid data and, if so, returns True.
Because the Verify command and the Verify Data preference option do not allow very
precise control, you can use the VERIFY( ) function to detect errors in individual fields
and proceed in a situation-specific manner. For more information, see “Verify” on
Chapter 2 Functions 85
ZONED( )
page 350 of this manual and “Verify Data” on page 294 of the ACL for Windows User
Guide.
Function Format
VERIFY(F)
The VERIFY( ) function returns True or False depending on whether the field contains
valid data. Because computed fields and expressions always contain valid data,
VERIFY( ) always returns True for computed fields and expressions.
Example
To create a filter identifying invalid data in the Prodno field (which you could then use to
extract the bad records), specify:
VERIFY(Prodno) = F
ZONED( )
ZONED( ) converts a numeric expression or field value to ASCII ZONED data format.
Use ZONED( ) to export data to other applications, such as working paper programs,
that require zoned data files as input.
You can also use ZONED( ) to convert a positive numeric value to a character value
containing leading zeros. This is useful for normalizing data in fields to be used as key
fields. For example, if one file contains invoice numbers in the form 100 in a numeric
field, and another file contains invoice numbers in the form 00100 in a character field,
you can use ZONED( ) to convert the numeric value 100 to the character value 00100.
This allows you to compare like invoice numbers.
Function Format
ZONED(N,#)
N specifies the numeric expression or field value.
This data format does not include an explicit decimal point. Leading zeros are added
when field length is greater than the number of digits in the numeric field. If the amount
is negative, the rightmost character is displayed as a “}” for zero or as a letter between “J”
and “R” for the digits one to nine.
86 ACL for Windows 7 Reference Manual
ZSTAT( )
Example
ZONED(-6448.95,11) = "0000064489N"
Note: If number contains more digits than length, ACL truncates the leading zeros
because the length of the input (number) exceeds the length of the output (length). For
example:
ZSTAT( )
ZSTAT( ) calculates the standard Z-statistic for use in many problem-solving tasks,
including digital analysis. It returns an answer to three decimal places.
Use ZSTAT( ) to evaluate the likely frequency of occurrence of a given result in a
specified period or category. The larger the resulting Z-statistic, the more unlikely the
occurrence. For example, a Z-statistic of 1.96 has a significance of 0.05, representing the
likelihood of a one time in 20 occurrence, whereas a Z-statistic of 2.57 has a significance
of 0.01, representing the likelihood of a one time in 100 occurrence. For information on
the Z-statistic, consult a statistics textbook.
You can specify the parameters for ZSTAT( ) as either numbers or proportions:
When you specify both parameters as numbers, the function computes the
Z-statistic using floating-point arithmetic.
When you specify both parameters as proportions, the function computes the
Z-statistic using fixed-point arithmetic, and you need to use a decimal multiplier
to control rounding.
v2 represents the expected count, such as a leading digit or a leading digit combination.
v3 represents the total number of items being tested and must be a positive whole
number greater than 0.
and August were slightly low, at 193 and 197. The total claims for the year were 2,450. To
test whether these high and low results were significant, use the Z-statistic.
High results. The actual number of claims for April to June is 660. The expected
number of claims for this period is 25 percent of the 2,450 annual claims, or 612.5. The
Z-statistic for these counts is:
ZSTAT(660,612.5,2450) = 2.193
A Z-statistic of 1.96 has a significance of 0.05, and 2.57 has a significance of 0.01. Thus,
the probability that the higher rates of claims are due to chance is between 1:20 and
1:100.
Low results. The actual number of claims for July and August is 390. The expected
number of claims for this period is one sixth of the 2,450 annual claims, or 408.33. The
Z-statistic for these proportions is:
ZSTAT(390,408.33,2450) = 0.967
This is not a very significant result. Z-statistics of 1.000 and less are very common and
can typically be ignored.
Decimal Multiplier
ACL typically evaluates expressions using fixed point arithmetic and rounds the result.
When using an expression within an expression for v1 and v2, you must specify the level
of precision you want in the result by using a decimal multiplier. ACL has a precision of
8 digits, therefore a multiplier of 1.00000000 will return the greatest precision attainable.
For more information, see “Fixed Point Arithmetic” on page 292 in the ACL for
Windows User Guide.
and August were slightly low, at 193 and 197. The total claims for the year were 2,450. To
test whether these high and low results were significant, use the Z-statistic.
High results. The actual number of claims for April to June is represented by the
proportion 660/2450. The expected number of claims for this period should be 25
percent of the 2,450 annual claims. The Z-statistic for these proportions is:
ZSTAT((1.00000000*660/2450),0.25,2450) = 2.193
A Z-statistic of 1.96 has a significance of 0.05, and 2.57 has a significance of 0.01. Thus,
the probability that the higher rates of claims are due to chance is between 1:20 and
1:100.
Low results. The actual number of claims for July and August is 390. The expected
number of claims for this period should be one sixth, or 16.6667 percent of the 2,450
annual claims. The Z-statistic for these proportions is:
ZSTAT((1.00000000*390/2450),0.16667,2450) = 0.967
This is not a very significant result. Z-statistics of 1.000 and less are very common and
can typically be ignored.
Chapter 3 C OMMON C OMMAND P ARAMETERS
All
%
All is used to specify the extent to which a command is executed either on fields or on
records.
&
TOTAL ALL
Note: Make sure the structure of the two files is identical before using this option. ACL
appends output to an existing file regardless of its structure.
89
90 ACL for Windows 7 Reference Manual
%
As
&
EXTRACT RECORD TO XTRACT.TXT APPEND
As
As is a field modifier that is used to specify a replacement name for an existing field or ad
hoc expression.
If As is used in a command that creates another file, the name specified in the As clause
becomes the field name in the new input file definition. Because the name is a character
string, any character expression is valid, provided it adheres to ACL’s field naming
conventions.
Ascending
Ascending is a field modifier that specifies the default sort order for key fields, including
%
computed fields and ad hoc expressions. Ascending can be used only in the Duplicates,
Gaps, Index, Sequence, and Sort commands.
&
SORT ON Loc ProdCls QtyOH TO "File2"
Break
Break specifies break fields in a command and causes report data to break each time the
value of the specified field changes. Subtotals are generated for each value in the break
field. Break can also be used with an expression consisting of a concatenation of more
than one field.
Break fields must be character fields. To use Break with a numeric field, convert it to a
character field using the STRING( ) function. Break can be used only with the following
commands: Age, Classify, Histogram, and Stratify.
Note: For meaningful results, your file should already be sorted or indexed on the specified
Break field.
For information on using break columns in views and reports, see “Modifying
Columns” on page 181 and “Specifying Break Columns” on page 182 of the ACL for
Windows User Guide. For information about inserting a page break in a report after the
totals for the specified Break field, see “Page” on page 105.
&
See “Key” on page 100.
Descending
Descending is a field modifier that specifies the sort order for key fields, including
computed fields and ad hoc expressions. Descending can be used only in the Gaps,
Duplicates, Index, Sequence, and Sort commands.
% The default sort order is ascending. For more information, see “Ascending” on page 91.
&
SORT ON Loc ProdCls QtyOH D TO "File2"
End of File
End of File causes the complete command to be executed one more time after the end of
%
the file has been reached. End of File is usually used in batches when processing a file
using the Group command.
File
%
File specifies that output from a command is to be saved in a separate file. For more
information, see “To” on page 109.
&
STATISTICS ON CstDte QtyOH SalePr TO "Stattest.TXT" NUMBER 5
File Type
File Type specifies the output format of a file. Depending on the command, the output
format can be text (.txt) or an ACL data file (.fil).
First
First is a scope parameter that causes a command to be executed on a consecutive
number of records, starting with record 1. Processing terminates after the specified
number of records has been reached. First is not dependent on current record position.
After execution of a command containing a First parameter, the record position is set at
the record immediately following the number of records specified in the command. If
the end of the file was reached during execution, the record position will be reset to
record 1.
First can also be used in conjunction with If or While. After execution of a command in
which both First and While are specified, the record position is determined by the While
parameter.
Chapter 3 Common Command Parameters 97
%
Footer
&
regardless of the position at the start of the command.
Footer
%
Footer inserts text at the bottom of each page of a report. This overrides any value set by
a footer variable.
&
FOOTER "***END DATA***"
Graph
Graph specifies that output from a command is to be displayed in a graph. Graph can be
used only with the following commands: Age, Benford, Classify, Histogram, and
Stratify.
%
For more information, see “Graph Output” on page 235 of the ACL for Windows User
Guide.
&
INTERVALS 10 TO GRAPH
Header
%
Header inserts text at the top of each page of a report. This overrides any value set by a
header variable.
&
FOOTER "***END DATA***"
If
If is a scope parameter that causes a command to be executed on records that satisfy a
specified test. If filters out all records that fail the test. If is not dependent on current
record position.
After execution of a command containing an If clause, the record position is set at the
record immediately following the number of records specified in the command. If the
end of the file was reached during execution, the record position will be reset to record 1.
If can also be used in conjunction with While, Next, or First. After execution of a
command in which both If and While are specified, the record position is determined by
the While parameter.
%
Note: When a global filter has been applied, the [If] condition is applied in addition to, not
instead of, the filter.
&
COUNT IF QtyOH < 50
Key
Key specifies break fields in a command and causes report data to break each time the
value of the specified field changes. Subtotals are generated for each value in the break
field. Key can also be used with an expression consisting of more than one field.
Key fields must be character fields. To use Break with a numeric field, convert it to a
character field using the STRING( ) function.
Chapter 3 Common Command Parameters 101
Local
Key can be used only with the following commands: Age, Classify, Histogram, and
Stratify.
%
Note: For meaningful results, your file should already be sorted or indexed on the specified
Break field.
Local
This parameter applies only to files processed using the ACL Client/Server System.
Local specifies that an output file is to be written to the client or local drive. When Local
%
is checked, commands write output to the location of the current project file unless a
path is provided.
Name
Name is used to specify the name of the output file created by a command.
&
See “To” on page 109.
Next
Next is a scope parameter that causes a command to be executed on a number of
records, starting at the current record. Processing terminates after the specified number
of records has been reached. Next is dependent on current record position.
After execution of a command containing a Next parameter, the record position is set at
the record immediately following the number of records specified in the command. If
the end of the file was reached during execution, the record position will be reset to
record 1.
Note: Because Next causes an early termination of processing, it cannot be used within a
group, although it can be used in the outermost Group command of a set of nested groups.
Next can also be used in conjunction with If or While. The Next clause is applied first,
independently of the If test. If both While and Next are specified in the same command,
the record position is determined by the first of the two clauses to terminate processing.
Chapter 3 Common Command Parameters 103
%
Nodups
&
positioned at 12 after the command has been executed.
Nodups
Nodups is a field modifier that causes repeated values in a field to be displayed as blanks
in a report.
Nozeros
Nozeros is a field modifier that causes zero values in a field to be displayed as blanks in a
report.
Open
Open is a scope parameter that is used to open a file that has been created by a
command. If an input file is already open, ACL closes the file before executing the
command. The newly created file is used as the input file. This parameter is valid only
when the command creates an output file.
Page
Page is a field modifier that inserts a page break after the totals for the specified key field.
Picture
Picture is a field modifier that specifies how to format a date field or numeric field.
%
Picture can be used in command mode only. For a dialog box equivalent, see “Numeric
Fields” on page 139 and “Date Fields” on page 140of the ACL for Windows User Guide.
&
INTERVALS 10 TO PRINT
Record
Record refers to a record as a unit, without reference to the fields within the record.
Record specifies that the entire record (whether the entire record is defined or not) is to
%
be placed in the output file rather than selected fields only. This means that the output
file contains an exact copy of the input record, including any computed field definitions.
&
EXTRACT RECORD IF UnCst > 0 TO "EXTR_1"
Screen
%
Screen specifies that output from a command is to be displayed in the command log for
on-screen review.
&
INTERVALS 10 TO SCREEN
Suppress
Suppress excludes amounts falling outside of a specified range from the output.
For example, the Stratify command requires that users specify output ranges. By default,
the command analyzes two additional ranges: the range of values below the minimum
specified, and the range of values above the maximum specified. Suppress overrides this
behavior.
Suppress can also be used as a field modifier to suppress totaling of specific numeric
fields, typically in report output. For more information, see “Numeric Fields” on
page 139 of the ACL for Windows User Guide.
108 ACL for Windows 7 Reference Manual
%
Suppress
To
To is used to specify the output format of a command. Depending on the command,
output can be:
Displayed on the screen
Printed
Displayed in a graph
Saved in a file
%
For more information, see “Graph” on page 98, “Print” on page 106, and “Screen” on
page 107.
&
INTERVALS 10 TO "Rept1.TXT"
&
See “Open” on page 104.
While
While is a scope parameter that causes a command to be executed while a condition is
true. While causes command processing to terminate as soon as the specified test
evaluates as false, or the end of the file is reached.
While is dependent on current record position. To begin processing, the current record
must evaluate as true. While is typically used with blocks of items in which the condition
evaluates as true.
If the end of the file was reached during execution, the record position will be reset to
record 1.
While can also be used in conjunction with If, Next, or First.
Chapter 3 Common Command Parameters 111
Width
After execution of a command containing While and If or First, the record position is
determined by the While parameter.
After execution of a command in which both While and Next are specified, the record
position is determined by the first of the two clauses to terminate processing.
%
Note: Because While can cause an early termination of processing, it cannot be specified
inside a group, although it can be used in the outermost Group command itself.
&
set at the first record that failed the test.
Width
Width is a field modifier that specifies the display width of a specified field or expression
in a report. The default display width is the field’s defined length. Using the Width
parameter will override this default.
Width can be used in command mode only.
For more information, see “Changing Column Width” on page 182 of the ACL for
Windows User Guide
112 ACL for Windows 7 Reference Manual
%
Width
Accept
The Accept command allows you to create interactive batches that pause to display a
dialog box prompting a user for information.
This command can be issued only in command mode. It cannot be used within a Group
command. It is good practice to place all Accept commands at the beginning of a batch.
Use Accept to create batches that prompt the user to provide information, such as
sampling intervals, file names, department numbers, or report headers and footers.
ACL stores the user input in a character variable. When the user input is a numeric value
needed for a subsequent ACL command, the command interprets the user input as a
character value. You may need to convert the character data in the variable to numeric or
date format before you can use it in other operations.
To use the literal content of a variable in a subsequent command or operation, you can
refer to the variable by name. To have ACL interpret the content of a variable as a field
name or a file name, use the percent character (%) before and after the variable name.
This converts the variable name into a macro and tells ACL to treat the content of the
variable as a reference to a named field or file.
For more information, see “Variables” on page 311, “Interactive Batches” on page 309,
and “Macro Substitution” on page 316 of the ACL for Windows User Guide.
To create more complex dialog boxes, use the Dialog command. For more information,
see “Dialog” on page 153.
113
114 ACL for Windows 7 Reference Manual
Accept
If an IFD is open when an Accept or Dialog command is issued, drop-down lists will
contain only specified items from the currently open IFD. If no IFD is open when the
command is issued, drop-down lists will be blank.
Parameters
Fields
Allows you to use drop-down lists instead of text boxes for user input. Drop-down lists
can contain one or more field types.
To
%
Assigns the user response to a named character variable.
Tip: Do not mix "xixrxbxfxw" items with "CcNnLlDd" items. You should not have Project
item types in the same list with field names or variable names. This may result in inappro-
priate user choices that cause processing errors.
Chapter 4 Commands 115
Accept
C character fields
c character variables
N numeric fields
n numeric variables
l logical variables
D date fields
d date variables
xb batches
xf input files
xi indexes
xw workspaces
When you run the batch, the first dialog box prompts you for the file name.
The second dialog box prompts you for the name of the field to be sampled. The syntax
for this prompt, shown in the third command line above, uses the keyword
FIELDS 'N'. As a result, this dialog box contains a drop-down list of available numeric
fields.
The third dialog box prompts you for the interval value.
And the fourth prompts you for the random start value.
Chapter 4 Commands 117
Accept
ACL displays the result of the batch in the command log. Notice that ACL evaluates the
macro %FILENAME% in line two of the batch, and opens the file Inventory.
The command log shows that the records were extracted to a file called
Inventory_sample. To view the sampled records, select Inventory_sample from the
Select Input File dialog box.
Activate
Activate is used only on Workspaces. Use Activate when you have a set of fields stored in
a workspace that are used with a variety of input files.
This command can be issued only in command mode. For more information, see
“Issuing Commands” on page 238 of the ACL for Windows User Guide.
For example, Activate allows you to use computed fields while using a dBASE file. Also,
when working with multiple record-type files, you can store the definition for each
record type in a separate workspace. If you plan to deal with only a few types at a time,
you can activate the appropriate workspaces.
Activate brings all fields in the specified workspace into the present environment only
for the current session. To make the activated definitions a permanent part of the input
file definition, you must use the Save command before a new file is opened, or before the
session is terminated.
The Activate command temporarily adds a set of field definitions, contained in a
workspace, to the existing set of fields for the current input file. For more information,
see “Activating Workspaces” on page 324 of the ACL for Windows User Guide.
Note: Making changes to workspace fields while a workspace is activated causes the fields
to be automatically saved with the input file.
To use the Activate command, it is important that you understand how workspaces
operate. For more information, see “Workspaces” on page 322 of the ACL for Windows
User Guide and “Save” on page 296 in this manual.
Parameters
OK
Indicates that a field in the input file with an identical name to one in the activated
workspace is to be overwritten without confirmation. A field can not be replaced if it is
referenced by a computed field.
Default: Confirmation before replacing field.
Workspace
Indicates that a workspace is to be activated.
Chapter 4 Commands 119
%
Activate
Example
This example uses Activate to activate a workspace, Inventory_margin, containing
computed fields that calculate the unit margins and unit percent margins for items in an
inventory file.
To display the contents of the file before activating the workspace, enter the following
into the command log text box:
To activate the workspace, using the Activate command, enter the following in the
command log text box:
120 ACL for Windows 7 Reference Manual
Activate
Reissue the Display command to reveal the file contents after activating
Inventory_margin, and scroll down to the bottom of the window. The two fields
activated, Loc05 and City, appear as the last two fields in the display.
Chapter 4 Commands 121
Age
Age
Use the Age command to produce aged summaries of data. Examples include evaluating
sales trends, looking at transaction volumes, and classifying invoices by the number of
days outstanding from a particular date.
Unless you specify a cutoff date, aging is based on the current system date.
You can specify starting points such as 0, 90, 120, and so on for each aging period, or you
can accept the default settings of 0, 30, 60, 90, 120, and 10,000 days.
The number of records in each period is displayed in the command log in an ACL
generated column entitled COUNT, seen in Step 5 on page 125. You can also accumulate
numeric field totals for each period.
Parameters
In addition to the parameters described below, the Age command has the following
parameters: All, Append, Break, File, File Type, First, Footer, Graph, Header, If, Local,
Name, Next, Print, Screen, Suppress, While. For a description of these parameters, see
Chapter 3: “Common Command Parameters”.
Accumulate Fields
Allows you to select the numeric fields to be totaled. Select fields from the Accumulate
Fields list view, or click [Accumulate Fields] to display the Selected Fields dialog box.
You can then select fields from the Available Fields list view.
Age On
Allows you to select the date field or expression to be aged. Select the field from the Age
On drop-down list, or click [Age On] to display the Selected Fields dialog box, in which
you can select a field from the Available Fields list view.
Aging Periods
Allows you to specify the beginning of each aging period. The last entry represents the
end of the final period. Enter the values one per line in the Aging Periods text box. Use
10,000 days to isolate items with invalid dates.
The default settings are 0, 30, 60, 90, 120, 10,000 days. These defaults are set in the Edit
ACL Preferences dialog box. For information on changing these defaults, see “Aging
Periods” on page 292 of the ACL for Windows User Guide.
122 ACL for Windows 7 Reference Manual
Age
Cutoff Date
Allows you to specify the date to which dates in the [Age On] field are compared. You
can use the built-in calendar in the Age dialog box to select a date.
In command mode, you must specify the cutoff date in YYMMDD or YYYYMMDD
character format, regardless of the format of the date field.
The default cutoff date is the current system date.
Chapter 4 Commands 123
Age
Command Output
The command log output for this command has columns for the aging intervals, the
number of records in each interval, and the percent of the total records that each interval
represents. If one or more fields were accumulated, additional columns are displayed:
another percent column, and the accumulated field totals for each interval.
Each percent column points to the column it represents. The right-hand percent column
points to the nearest accumulated field column, and shows the percent of the total value
that the value of this interval represents. Percentages are not provided for additional
accumulated field columns.
Dates prior to the cutoff data fall into one of the specified aging periods. ACL creates
another period, <0, for dates more recent than the cutoff date.
124 ACL for Windows 7 Reference Manual
Age
Example
Analyze the records in an accounts receivable file to determine the number and value of
records that are 30 to 59 days past due. Age the records on a due date field and
accumulate an amount owing field, using December 31, 1997, as the cutoff date. Use the
default setting for the aging periods.
1. With the Ar file open, click [Age] on the button bar, or select Analyze from the
menu bar and choose Age to display the Age dialog box.
2. Select the field named Due from the Age On drop-down list.
You can also click [Age On] to display the Selected Fields dialog box, which gives you
more information about the fields you are selecting.
or
Click to display
Expression Builder
Chapter 4 Commands 125
Age
There are three ways to select fields using the Selected Fields dialog box:
Click the name of the field to select it, then use the (arrow) to move
it between list boxes.
Double-click the name of the field to select it, and move it from the Available
Fields list view to the Selected Fields list box.
Click [Expr] to display the Expression Builder so you can build a date
expression.
Select the field named due from the list, and click [OK] to return to the Age dialog
box.
3. Specify the cutoff date. Click the arrow in the Cutoff Date drop-down list to display
the calendar from which you can select your cutoff date. Then, click the arrows, the
month, or the year to select another date.
4. Select the fields to be totaled. Select field names from the Accumulate Fields list box,
or click [Accumulate Fields] to display the Selected Fields dialog box.
After you select the fields, click [OK] to return to the Age dialog box.
5. Click [OK] again to close the dialog box, and execute the Age command. The results
appear in the command log.
126 ACL for Windows 7 Reference Manual
Age
%
Items aged over 10,000 days probably constitute invalid date fields.
Assign
You can use the Assign command to store a value as a variable. You can also attach a
condition to the Assign command.
Assign is typically used in a batch in which you want to change the value of a variable. If
Assign is issued without a condition, the assignment automatically takes place.
Assign can be used as a separate command or in a group. An Assign command in a
group performs the assignment each time the command is encountered, if the test
evaluates true for that record at least once per record.
If you assign a value to a variable name that already exists, and the variable is used within
a computed field or the assignment is made inside a group, then the value assigned is
adjusted to the specifications previously defined for that variable; the length is padded
or truncated and the decimals are adjusted if required.
If you assign a value to a variable name that already exists, and the variable is not used in
a computed field, or is assigned outside a group, then the previous value and its specifi-
cations are overwritten.
ACL recognizes several special variables such as HEADER and FOOTER. If character
values are assigned to either of these two variables, they are automatically used as page
headers or footers if a header or footer is not otherwise specified. This automatic page
formatting feature remains in effect until the variables are deleted or until the end of the
current session. Be aware of these variables when using the Assign command.
Note: You can also create new and edit existing variables using the Expression Builder.
For more information, see “User-Created Variables” on page 314 of the ACL for
Windows User Guide.
Parameters
The Assign command has the following parameter: If. For a description, see Chapter 3:
%
“Common Command Parameters”.
variable-name specifies the name of the variable to be created. All field naming
conventions apply. See “Functions” on page 257 of the ACL for Windows User Guide for
details.
expression specifies the value to be assigned to the variable. All ACL expression
conventions apply.
Example 1
Takes the value of the product class for the current record and assigns it to a variable
named MPRODCLS.
Enter the following into the command log text box:
Because MPRODCLS is a variable, its value will not change unless explicitly changed by
another Assign command.
Example 2
Use the following command in a batch, to assign a value of 1 to the variable
SAMPLE_QTY whenever MCOUNT is less than 10:
If MCOUNT is greater than or equal to 10, no action is taken by ACL. This means that
the value of SAMPLE_QTY remains unchanged. If the variable did not previously exist,
it will not be created.
Chapter 4 Commands 129
Benford
Benford
The Benford command allows you to generate digital analysis using the Benford
formula.
This command counts the number of times each leading digit or digit combination
occurs in a data set, and compares the actual count to the expected count. The expected
count is calculated using the Benford formula. The command output can be sent to a
graph.
To help you evaluate the significance of deviations between actual and expected counts,
the command output includes the Z-statistic for each count. You can also use the
Bounds option to help you identify digit frequencies that are significantly outside expec-
tations. When more than one count column falls outside the bounds, the data repre-
sented by these columns may be anomalous.
For more information about digital analysis, see “Digital Analysis Using Benford's Law:
Tests & Statistics for Auditors” by Mark J. Nigrini, Ph.D., published by Global Audit
Publications.
Note: Digital analysis tools like the Benford command enable auditors and other data
analysts to focus on possible anomalies in large data sets. They do not prove that error or
fraud exist, but identify items that deserve further study on statistical grounds. Digital
analysis complements existing analytical tools and techniques, and should not be used in
isolation from them.
Parameters
In addition to the parameters described below, the Benford command has the following
parameters: All, Append, Break, File, File Type, First, Footer, Graph, Header, If, Local,
Name, Next, Print, Screen, Use Output File, While. For a description of these param-
eters, see Chapter 3: “Common Command Parameters”.
Benford On
Allows you to select a numeric field from the Benford On drop-down list. Or, click
[Benford On] to display the Selected Fields dialog box. You can then select a field from
the Available Fields list box, or use an expression to create the values to be analyzed.
Input
This command analyzes numeric fields. You can specify up to six leading digits to be
analyzed. When there are more than three leading digits, Benford analysis must be sent
to a file. Analysis of five or more leading digits takes time, and ACL notifies you in the
command log that it is working. Use the ESC key to terminate the command at any time
before results appear in the command log.
Effective Benford analysis requires large sample sizes. ACL warns you when a sample
size may be too small for the specified number of digits.
Anomalous data stands out better when you analyze positive and negative values
separately. You can use a filter to separate the two before beginning your analysis. Digits
or digit combinations with zero values are automatically excluded.
The Benford command ignores records with values of zero, but reports the number of
zero value records bypassed. It also ignores leading zeros, numeric formatting such as
decimals and dollar signs, and other non-numeric digits. If the resulting number of
digits is less than specified, ACL adds zeros to the right of the result.
Output
The default output is an ACL data file in the form of a table. You can also send output to
a line graph or 2-D bar graph.
Table Output
The table contains four columns: Leading Digits, Actual Count, Expected Count, and
Z-Stat Ratio. If you select the bounds option, the table contains two additional columns,
Lower Bound and Upper Bound.
Chapter 4 Commands 131
Benford
No output is produced for records that fail to meet test criteria or for records that
contain only zeros.
The Leading Digits column shows the leading digits tested. For example, if you specify
one leading digit, Leading Digits displays the numbers 1 to 9. If you specify two leading
digits, Leading Digits displays the numbers 10 to 99.
The Actual Count column shows the count of each leading digit or leading digit combi-
nation found in the population.
The Expected Count column shows the count calculated according to the Benford
formula.
The Z-Stat Ratio column shows the Z-statistic for each digit combination. See the
ZSTAT( ) function below.
Graph Output
The graph shows actual count, expected Benford count, and the upper and lower
bounds if the Include Upper and Lower Bounds check box on the [Main] tab is selected.
Analysis of a single leading digit produces 9 data points on the x-axis, two leading digits
produces 90 points, three leading digits produces 900 points and so on.
You can also double-click <<<Graphable Data>>> in the command log to view the
&
graph.
%
Benford
Example
BENFORD ON Amount LEADING 2 BOUNDS TO SCREEN
Chapter 4 Commands 133
Calculate
Calculate
The Calculate command computes and displays the value of an expression.
This command can be issued only in command mode. For more information, see
“Using Commands” on page 232 of the ACL for Windows User Guide.
The result of Calculate may be a character, logical, numeric, or date value. By separating
the expressions to be evaluated with commas, several calculations can be performed
simultaneously.
Calculate provides the functionality of a calculator combined with access to ACL
functions, variables, and the data in the current record. In a numeric calculation, the
result has as many decimal places as does the expression component with the greatest
number of decimal places. For example, the result of 365.0000/12.0 has four decimal
places. See “Fixed Point Arithmetic” on page 255 of the ACL for Windows User Guide for
details.
Whenever you use Calculate without providing for the result by using the As modifier,
ACL names the result with the expression name. See “Field Modifiers” on page 233 of
the ACL for Windows User Guide for more information on the use of “AS”.
Prerequisites
If the expression contains an input file field value, the appropriate input file must first be
opened. Use the Find, Seek, or Locate commands to move to the record to be analyzed
by Calculate. For more information, see “Find” on page 198, “Seek” on page 303, and
“Search” on page 298.
Parameters
The Calculate command has the following parameter: As. For a description, see
%
Chapter 3: “Common Command Parameters”.
expression name allows you to specify a name for the result of the Calculate
command. The name must be surrounded by quotes or be a valid character expression.
Default: the expression string.
Example 1
To quickly calculate 4.7 multiplied by 18.5 using ACL, enter CALC 4.7*18.5 in the
command log text box:
Click (Accept Entry) or press ENTER to calculate the result. Choose Last Result from
the command log drop-down list to display the result:
See “Fixed Point Arithmetic” on page 255 of the ACL for Windows User Guide for more
details.
Example 2
Calculate the gross margin and gross margin percent for the current record. Using
previously defined fields for the sale price and unit cost, calculate the unit gross margin
and gross margin percent for the current record. Name the results appropriately, and
then enter the following into the command log text box:
CALCULATE SALEPR-UNCST AS 'MARGIN'
Choose Last Result from the command log drop-down list to display the result.
Chapter 4 Commands 135
Classify
Classify
Use the Classify command to count the number of records relating to each unique value
of a character field and to accumulate totals of specified numeric fields for each of these
unique values.
The number of records for each value is displayed in an ACL generated field, named
COUNT. The limit on the number of totals depends on the available RAM in your
computer, but is normally 50,000 or more. There are about 20,000 totals per megabyte as
set by the Max RAM preference.
Classify works on unsorted data and is particularly useful for quick data scanning and
summarizing. You can use Classify in a wide variety of circumstances. For example,
Classify can rapidly generate a trial balance from unsorted ledger transactions. Classify
can also replace the need to perform separate Sort and Summarize operations.
You can tell ACL to place the results of the Classify command in a new input file for
further analysis and reporting with ACL, or direct results to a printer or the screen.
This command can be Autoexecuted. For more information on the Autoexecute
Commands preference, see “Command Options” on page 288 of the ACL for Windows
User Guide.
Parameters
In addition to the parameters described below, the Classify command has the following
parameters: All, Append, Break, File, File Type, First, Footer, Graph, Header, If, Local,
Name, Next, Print, Screen, Use Output File, While. For a description of these param-
eters, see Chapter 3: “Common Command Parameters”.
Accumulate Fields
Specifies the numeric fields or expressions to be totalled by ACL for each class. Select the
fields from the list box, or click [Accumulate Fields] to display the Selected Fields dialog
box in which you can select fields and build expressions. For more information on the
Selected Fields dialog box, see “Selection/Edit Dialog Boxes” on page 37 of the ACL for
Windows User Guide.
Classify On
Specifies the input file character field or expression to be classified. Select the field from
the drop-down list, or click [Classify On] to display the selected fields dialog box in
which you can select fields and build expressions.
136 ACL for Windows 7 Reference Manual
Classify
Command Output
The command log output for this command has columns for the name of the classifi-
cation, the number of records in each classification, and the percent of the total records
that each classification represents. If one or more fields were accumulated, additional
columns are displayed: another percent column and the accumulated field totals for each
classification.
Each percent column points to the column it represents. The right-hand percent column
points to the nearest accumulated field column, and shows the percent of the total value
that the value of this classification interval represents. Percentages are not provided for
&
additional accumulated field columns.
Example
To classify a sales transaction file by product number, use the Classify command. You
may want to do this in order to determine which products are the top sellers and which
are potentially obsolete.
Accumulate fields for the quantity on hand and the transaction amount, and send the
output to a file named Prodsale.
Chapter 4 Commands 137
Classify
Note: The Classify command does not require the data to be sorted.
Close
The Close command closes an open input file, similar to clicking (Close) in the
Overview window, or clicking [None] in the Select Input file dialog box. See
“Selection/Edit Dialog Boxes” on page 37 of the ACL for Windows User Guide for details.
This command can be issued only in command mode. For more information, see
“Issuing Commands” on page 238 of the ACL for Windows User Guide.
You do not have to close an input file before opening another. ACL automatically closes
an open input file before opening a new one. The file to be closed may be described by
type (primary or secondary) or by name. If no parameter is specified, the primary file is
closed. If you are closing a primary or secondary input file, ACL removes all corre-
sponding field definitions from the current environment. Any changes to record defini-
tions are saved before closing. ACL automatically closes the input file before executing
the Open and Quit commands.
If you have defined relationships in your ACL Project, the Close command will close
both the primary and any secondary files, in addition to the related files.
If you are closing a Learn file, Close operates in the same manner as the setting Set Learn
Off. Set Learn On Off, and Open and Close Learn are equivalent to selecting the Tools
menu and setting the Batch Recorder On and Off.
Note: You cannot use the Close command to close an ACL Project.
For more information on using the Batch Recorder, see “Creating Batches” on page 302
%
of the ACL for Windows User Guide.
Example
To close an open accounts receivable primary file named Ar without opening a different
file, enter the following into the command log text box:
Comment
Use the Comment command to insert a remark or explanation into the ACL Log file
without affecting processing or execution. Comment allows you to document a session,
including such items as purposes, descriptions, and other required explanations. You
can use Comment in batches or groups to add comments to the log.
It is good practice to include adequate documentation to help future users determine
what has been done and the results.
When not in a batch or group, the comment lines are recorded in the log at the time you
enter them. In a batch or group, the comments are recorded as part of the batch file.
They are included in the log file at the time the batch is run and displayed at the appro-
&
priate point in the results.
When you include more than one comment-line, you must place a blank line after the
last comment-line to indicate that it is the last comment-line. If you do not leave a blank
line, ACL treats the following lines as comment-lines.
Example
At the appropriate point in a batch created to get a basic overview of inventory before an
inventory count, enter the following into the Comment text box:
ANY NEGATIVE VALUES FOR QUANTITY ON HAND SHOULD BE DISCUSSED
WITH THE CONTROLLER.
The comment appears in the batch as follows:
Subsequent users of the batch will be able to follow the instructions in the comment. You
can make comments as detailed as you like.
142 ACL for Windows 7 Reference Manual
Count
Count
Use the Count command to count the number of records in the current input file, or
only those that meet a specified test condition.
If no test is specified, the total number of records in the input file is displayed. If a global
filter has been applied to a view, Count produces the number of records remaining in the
file after the filtering condition has been applied.
The total number of records in the file or the number of records matching the current
global filter are displayed in the center of the status line.
The Count command automatically stores its result in a variable named COUNTn (for
example, COUNT1). When Count is issued as part of a group, the sequential command
number is used in the variable name n. For example, if Count is the sixth command in
the group, the resulting variable is named COUNT6.
Parameters
The Count command has the following parameters: All, First, If, Next, While. For a
description of these parameters, see Chapter 3: “Common Command Parameters”.
Example
To count the number of items having a recorded value greater than a stated value, say
$15,000, use the Count command. You can perform such a step to determine the
number of inventory items with a recorded cost exceeding a predetermined amount
Chapter 4 Commands 143
Count
such as materiality or monetary precision. You may want to physically verify the
existence of these items as part of your overall inventory control or verification proce-
dures.
If, to verify the accuracy of the accounting system, all inventory items costing more than
$15,000 are to be counted, then 10 tests should be performed.
Use Extract with the same condition to store these records in a separate file. For more
%
information, see “Extract” on page 189.
Define Field
Use the Define Field command to create a field in ACL.
This command can be issued only in command mode. For more information, see
“Issuing Commands” on page 238 of the ACL for Windows User Guide.
Define Field lets you add a field to your input file definition. You can only define
computed fields within a batch. Computed fields form part of the input file definition.
If a field with the same name already exists, ACL asks for confirmation before replacing
it. ACL does not let you redefine a field if it is referenced by a computed field or by the
current view.
Fields can contain overlapping data types. For example, you can define bytes 1 to 10 as a
numeric data type. You can then define the same or part of the same area, for example,
bytes 5 to 9, as an ASCII data type.
Note: For a more powerful and convenient way to define fields, use the Input File
Definition window as described in “Defining Physical Data Fields” on page 137 and
“Computed Fields” on page 142 in the ACL for Windows User Guide. Use these techniques
whenever possible.
Parameters
In addition to the parameter described below, the Define Field command has the
following parameters: As, If, Picture, Width. For a description of these parameters, see
Chapter 3: “Common Command Parameters”.
Computed
Identifies the field being defined as a computed field.
Chapter 4 Commands 145
%
Define Field
Computed Fields
You can define simple computed fields only within a batch. An example of a simple
computed field is:
DEFINE FIELD VALUE COMPUTED COST*QUANTITY
This defines a new field Value to be the product of the Cost field multiplied by the
Quantity field.
The syntax for computed fields requires parameters to be entered on multiple lines.
Because the command line does not support multiline commands, you must use this
command in batch mode to create computed fields.
In the examples below, the carriage return symbol (¿) marks the end of each line of
multiline text. Do not enter a carriage return except where indicated by the carriage
return symbol. If you enter a carriage return before the end of the line, the command
will not work.
For example, you can use the following conditional computed field syntax to replace
state abbreviations with state names:
DEFINE FIELD state-name COMPUTED ¿
¿
"Alaska" IF state = "AK"
"California" IF state = "CA"
"Arizona" IF state = "AZ"
"Not a valid State"
field-name can contain up to 31 uppercase and lowercase alphanumeric characters,
including the underscore character (_). To create a two-word name, fill the blank
between the words with the underscore or some other character. When naming fields
from a dialog box, ACL automatically inserts the underscore character between words.
field-type identifies the appropriate field type. See Chapter 1: “Field Types”.
start-position identifies the first byte position counting from 1 and going from left
to right of the field being defined.
field-length specifies the length in bytes of the field being defined.
decimals applies only to numeric field types. Identifies the number of decimal places
to the right of any decimal point.
expression can be any valid ACL expression. See “Examples of Expressions” on
page 253 of the ACL for Windows User Guide for details.
condition specifies the condition that must be met.
static allows you to treat the field as a static field. See “Conditional Computed Fields”
on page 145 of the ACL for Windows User Guide for details.
field-description specifies the value of the alternate column title.
Example
To define an ASCII field containing invoice numbers called Invnum with a start position
of byte 1 and a length of 6 bytes:
1. Enter this syntax into the command log text box:
DEFINE FIELD Invnum ASCII 1 6
2. Press ENTER.
Chapter 4 Commands 147
Define Field
3. You can verify that ACL defined the field by selecting Edit from the menu bar and
choosing Input File Definition to display the Input File Definition window. The
[Edit Fields/Expressions] tab lists the newly defined field.
4. Select the field, then double-click it to obtain further information about the new
field. The window changes to show the name, type, start position, and length of the
defined field. The bytes that the field occupies are also highlighted.
After you close the Input File Definition window, you can add the defined field to the
view by clicking (Add Columns) to display the Add Columns dialog box. For more
information on adding fields to the view, see “Adding a Column to a View” on page 179
of the ACL for Windows User Guide.
148 ACL for Windows 7 Reference Manual
Define Relations
Define Relations
See “Relations” on page 261.
Chapter 4 Commands 149
Define Report
Define Report
The quickest and easiest way to produce a new report and maintain an existing one is to
work directly from a view. The Define Report command is simply a different way of
accessing the view on which a report is based.
You can also use the Define Report command to:
Display a blank view to allow you to create a new report if view name used does
not exist in current IFD
Display a report view from the current IFD to allow you to modify an existing
report
Creating a report from a view and all report formatting options are described in
“Reports” on page 192 of the ACL for Windows User Guide.
This command can be issued only in command mode. For more information, see
%
“Issuing Commands” on page 238 of the ACL for Windows User Guide.
Delete
Use the Delete command to remove unwanted files, fields, or variables from the current
ACL environment. You can also use the Delete command to delete a data file. For
example, DELETE TEMP.FIL.
This command can be issued only in command mode. For more information, see
“Issuing Commands” on page 238 of the ACL for Windows User Guide.
The specified item is removed from wherever it is stored, for example, the ACL Project,
a local drive, or a network drive, and is no longer accessible. You cannot delete a field or
variable referenced by a computed field unless you delete the computed field first. Also,
you cannot delete any fields referenced by the current view.
Unless you specify OK on the command line, you are asked for confirmation before any
item is deleted. You are asked for confirmation even if the Warn Before Overwriting Files
option on the [Interface Options] tab of Preferences is not selected.
You can use Delete in a batch or from the command log with any of the keywords shown
below.
Parameters
All
Indicates that all variables in the current ACL environment are to be deleted. Fields are
not affected.
History
Deletes histories of the currently open file. To save the file histories of an existing input
file before deleting them, use the command DISPLAY HISTORY. You can then either
highlight the file histories and print them or copy and paste them into a text file. If you
delete the history of an input file, you cannot use its view to re-create the entire batch
with the Create Batch from File History option under Tools on the menu bar. However,
you can re-create that portion of the batch for which the history remains.
OK
Indicates that the command is to be executed without confirmation.
Chapter 4 Commands 151
%
Delete
Example 1
To delete an unwanted field (QtyOO) containing the quantity of inventory items on
order, enter the following into the command log text box:
ACL displays a dialog box asking you to confirm that you want to delete the field.
152 ACL for Windows 7 Reference Manual
Delete
Example 2
The following batch performs cyclical processing on an input file named Demo and
finally executes the Delete History command, retaining the last four histories created
(those created in the last cycle).
You can issue the Delete History command in a batch, or from the command log to
delete the file histories of the currently open input file.
Chapter 4 Commands 153
Dialog
Dialog
Use the Dialog command to create a custom dialog box for user input in a batch. Custom
dialog boxes control how a batch is run by prompting the user for input and selections.
Where possible, place dialog boxes at the beginning of a batch so that remaining batch
steps can proceed unattended.
Before you use the Dialog command or the Dialog Builder, you need to plan your batch
and have a firm understanding of your analysis and files. You may want to consider the
following questions before you start:
What do I want the batch to do?
Do I need custom dialog boxes for this batch?
Where and how can custom dialog boxes increase usability and functionality?
What information will the custom dialog boxes collect?
Where and how will the collected information be used?
What are the possible errors that the batch may encounter, and how will I handle
them?
Will I be the only one to run this batch, or will other people run it without my
assistance?
Take a few moments to think about your objectives and determine what you want the
dialog boxes within your batch to do. An excellent approach is to sketch out the flow of
the batch before you start to build it. This allows you to concentrate first on the function-
ality of the batch and then on the user interface.
For more information, see “Batches” on page 233 and “Interactive Batches” on page 309
&
of the ACL for Windows User Guide.
Dialog Builder
The Dialog Builder gives you access to all of the features of the Dialog command. Using
the Dialog Builder, you can design custom dialog boxes using the graphical interface.
The Dialog Builder offers you the flexibility and control to design sophisticated and
personalized dialog boxes to suit your needs. You can quickly obtain a wide range of
information using custom dialog boxes. To make full use of the Dialog Builder, you
should be familiar with the concepts in Chapter 8: “Automating ACL” in the ACL for
Windows User Guide.
154 ACL for Windows 7 Reference Manual
Dialog
2. In the batch window, click (Build New Dialog). ACL displays the Dialog Builder
with a default title of “User Dialog”.
The [OK] and [Cancel] buttons are placed in the upper right corner by default. You
can change the size and position of these buttons, but you cannot delete them. They
are integral to the dialog function.
Text
Edit box
Check box
Radio button
Drop-down list
Project item list
Delete
Snap to grid
3. Double-click in the blank definition area. ACL displays the dialog edit box.
4. Enter a new name for the dialog box in the Title text box.
5. Click [OK].
6. Add the controls. (See below for details.)
7. Close the Dialog Builder window. ACL asks “Save changes to dialog?”
8. Click [OK].
ACL displays the Dialog Builder command line in the batch window. You can see all of
the controls in the dialog box by scrolling to the right.
Dialog builder
command line
9. Close the batch window. ACL notifies you that the batch has changed. Do one of the
following:
Update the existing batch by leaving the highlighted name in the text box
unchanged
Create a new batch by entering a new name in the text box
10. Click [OK].
156 ACL for Windows 7 Reference Manual
Dialog
Controls
Using the Dialog Builder, you can build controls into your custom dialog boxes which
are used by the batch to interact with the user during processing. You can create the
following controls:
Text messages
Edit boxes
Check boxes
Radio buttons
Drop-down lists
Project item lists
Text message
Drop-down list
Grid marks
Project item list
Edit box
You can change the parameters or characteristics of each control through its dialog box.
Although the range of parameters varies for each type of control, all have Position and
Size parameters. These parameters let you specify the horizontal and vertical position of
the upper left corner of the control and the height and width of the control, in pixels.
Check the Auto check box to have ACL automatically resize the box when its contents
change. You can also change the Position and Size within the Dialog Builder itself. For
more information, see “Editing Controls” on page 163.
Note: For a more consistent look, keep the Auto check boxes checked and the Snap to Grid
option active. The grid marks in the definition area indicate the option is active.
Chapter 4 Commands 157
Dialog
Text Messages
A text message displays static text which prompts or informs the user.
To add a text message, do the following:
1. In the Dialog Builder, click (Text) and then click in the definition area where you
want to place the top left of the control. ACL displays the Text dialog box.
2. Enter the message you want to display in the Label text box. The maximum message
length is 250 characters including spaces.
3. Specify whether the message is aligned left, center, or right using the Alignment
option.
4. Click [OK].
158 ACL for Windows 7 Reference Manual
Dialog
Edit Boxes
Use an edit box in your batch for accepting user input. This control creates a character
variable.
To add an edit box, do the following:
1. In the Dialog Builder, click (Edit Box) and then click in the definition area where
you want to place the top left of the control. ACL displays the Edit Box dialog box.
2. Enter the name of the variable that will contain the value of this control in the
Variable text box.
3. Enter text in the Default Text box to determine the default value of the variable.
4. Click [OK].
Chapter 4 Commands 159
Dialog
Check Boxes
A check box presents True or False (On or Off) options to the user. Users can select more
than one option in a set. This control creates a logical variable that is True if the check
box is checked and False is the check box is unchecked.
To add a check box, follow these steps:
1. In the Dialog Builder, click (Check Box) and then click in the definition area
where you want to place the top left of the control. ACL displays the Checkbox dialog
box.
2. Enter the text to be displayed beside the check box in the Label text box.
3. Enter the name of the variable that will contain the value of this control in the
Variable text box.
4. Select Checked or Unchecked to determine the default value of the variable.
5. Click [OK].
160 ACL for Windows 7 Reference Manual
Dialog
Radio Buttons
A radio button set presents mutually exclusive options to the user. Only one option can
be selected in a radio button set. This control creates a numeric variable which contains
1 if the first radio button is selected, 2 if the second radio button is selected, and so on.
To add a radio button set, do the following:
1. In the Dialog Builder, click (Radio Button) and then click in the definition area
where you want to place the top left of the control. ACL displays the Radio Buttons
dialog box.
2. Enter text in the Label text box to create a radio button and the text to be displayed
beside it.
3. Click [Add] to add the item to the Label List.
4. Create at least one more radio button and add it to the Label List.
5. Enter the name of the variable which will contain the value of this control in the
Variable text box.
6. Highlight an item in the Label List box and click [Set Default] to determine the
default value of the variable.
7. Specify whether the radio buttons are positioned horizontally side-by-side or verti-
cally one on top of another using the Alignment option.
8. Click [OK].
Chapter 4 Commands 161
Dialog
Drop-Down Lists
A drop-down list presents a list of items to the user. Only one item can be selected. This
control creates a character variable which contains the text of the selected item.
To add a drop-down list, do the following:
1. In the Dialog Builder, click (Drop-down List) and then click in the definition
area where you want to place the top left of the control. ACL displays the Dropdown
List dialog box.
2. Enter text in the Label text box to create items and click [Add] to add them to the
Label List.
3. Enter the name of the variable which will contain the value of this control in the
Variable text box.
4. Highlight an item in the Label List box and click [Set Default] to determine the
default value of the variable.
5. Click [OK].
Views
Workspaces
Indexes
For example, you can create a Project item list to display all the input file definitions.
When the user selects an input file definition, the batch can use a macro command to
open that input file definition and analyze the data. For more information on using
macros, see “Macro Substitution” on page 316.
To add a Project item list, do the following:
1. In the Dialog Builder, click (Project Item List) and then click in the definition
area where you want to place the top left of the control. ACL displays the Project Item
List dialog box.
2. Select items from the Category drop-down list and add them to the Category List
by clicking [Add].
3. Enter the name of the variable which will contain the value of this control in the
Variable text box.
4. Enter an item from the Category List in the Default text box to determine the
default value of the variable.
5. Click [OK].
Chapter 4 Commands 163
Dialog
Editing Controls
To edit a control, follow these steps:
1. Double-click the control. ACL displays the control edit dialog box.
2. Edit the parameters for the control.
3. Click [OK].
You can change the position of a control in the Dialog Builder by clicking the control and
dragging it to a new position.
You can change the size of a control in the Dialog Builder by clicking the control and
dragging its resize handles.
Note: For a more consistent look, keep the Snap to Grid option active. The grid marks in
the definition area indicate the option is active.
Deleting Controls
To delete a control, do the following:
1. Click the control to select it.
2. Click (Delete).
You can also change the size of the dialog box by dragging the resize handle at the
bottom right corner of the definition area.
4. Click (Edit Command). ACL displays the Dialog Builder created by that
command.
5. Modify the dialog box as necessary. For more information, see “Editing Controls”
on page 163 and “Deleting Controls” on page 163.
6. Save your changes in the batch. For more information, see “Creating a Custom
Dialog Box” on page 154.
Chapter 4 Commands 165
%
Dialog
x_coord y_coord specifies the horizontal and vertical position of the upper left
corner of the control.
number corresponds to the order in which items are specified. In the above OK/Cancel
button set, [OK] is 1 and [Cancel] is 2.
variable specifies the name of the variable in which the user-determined value is
held.
item1;item2;... specifies the labels for the options within the control.
Batches b
Character Fields C
Character Variables c
Date Fields D
Date Variables d
Indexes i
Logical Fields L
Logical Variables l
Numeric Fields N
Numeric Variables n
Views r
Workspaces w
Chapter 4 Commands 167
Display
Display
Use the Display command to show information about the current ACL environment.
The information displayed depends on the keyword you specify.
This command can be issued only in Command mode. For more information, see
“Macro Substitution” on page 316 of the ACL for Windows User Guide.
Parameters
Date
Displays the current date and time as defined by your computer’s operating system.
Free
Displays the amount of memory (RAM) available for use. The amount displayed does
not include RAM reserved for variables.
History
Displays the file history, as described in “File History” on page 196.
Open
Displays all the opens files of your current ACL Project.
Primary, Secondary
Displays the fields in either the open primary or secondary file. For each field in the
input file definition, the following information is displayed: name, field type, start
position, length, decimal places, and field explanation. For computed fields, the name,
field type (COMPUTED), and the defining expression, including the default value, are
shown.
Relation
Displays the related files in your input file definition.
Space
Displays the amount of memory (RAM) available for use, and is a synonym for Free.
Time
Displays the current date and time as defined by your computer’s operating system, and
is a synonym for Date.
168 ACL for Windows 7 Reference Manual
Display
Variables
Displays the values of variables defined by the Assign command and those created
automatically by certain ACL commands. Also displays the amount of space remaining
for additional variables.
Note: The default amount of space for variables is 60K. However, ACL automatically
increases the amount of space available for storing variables when necessary.
Version
%
Displays the version of ACL that is currently running.
Example
To display the input file definition for the primary file, Inventory, enter the following
into the command log:
Do Batch
Use the Do Batch command to run an ACL batch.
You can also run a batch simply by double-clicking the name of a batch in the Overview
window and clicking [Run] in the dialog box. If you do run a batch from the Overview
window, you do not have the option of specifying an If test.
In command mode, you can specify If and While tests in a batch. However, you cannot
use both If and While in the same Do Batch command. The If test is evaluated just once
to determine if the batch should be executed and is not applied individually to each
record in the file. If the test evaluates as false for the current record, the batch is not
executed. Therefore, you cannot place a Do Batch command in a group. See the If and
While explanations below.
Note: If you discover that your batch file is not the way you want it, you can edit it.
Double-click the name in the Overview window and select [Edit].
When you are typing in a batch window, you can undo your last typing by pressing
CTRL-Z.
For more information, see “Batches” on page 233 of the ACL for Windows User Guide.
Parameters
The Do Batch command has the following common command parameters: If, While.
&
For a description, see Chapter 3: “Common Command Parameters”.
Example
To run a batch, Inventory_count_prep, that provides a basic overview of inventory
before attending an inventory count, use Do Batch.
Select Inventory_count_prep from the Do Batch dialog box.
%
Do Batch
Do Report
Similar to clicking [Output], then selecting Print from the Report dialog box, issuing the
Do Report command prints a report. The report is sent directly to the printer.
Note: All of ACL’s reporting features are accessible through dialog boxes.
For a more detailed discussion on ACL’s reporting features, see “Reports” on page 192 of
the ACL for Windows User Guide.
This command can be issued only in command mode. For more information, see
%
“Issuing Commands” on page 238 of the ACL for Windows User Guide.
Dump
Use the Dump command to display the contents of a specified file or the current record
in hexadecimal, ASCII, and EBCDIC format.
Dump is useful if you have a problem defining a format or encounter invalid data in the
file.
&
Note: You cannot issue Dump from a batch.
Parameters
ASCII
Displays data in ASCII format.
Columns
Changes the width of the display. See COLUMNS under Command Mode Syntax below.
To change display width, enter a number in the text box, or click the up-down controls
at the side of the Columns spin box to increase or decrease the number of bytes
displayed on each line.
EBCDIC
Displays data in EBCDIC format.
174 ACL for Windows 7 Reference Manual
Dump
File
Displays the contents of a file in one or more of hexadecimal, ASCII, and EBCDIC
formats. When you select File, ACL displays the Open dialog box, allowing you to
choose the file that you want.
Find
Locates a specified value in the data. For example, to find the value 39 in hexadecimal
format:
1. In the Dump dialog box, click [Find] to display the Dump Find dialog box.
2. Enter 39 in the Find text box, select the HEX option button, then click [Find].
The Dump dialog box shows hexadecimal value 39 selected.
HEX
Displays data in hexadecimal format.
Horizontal
Displays the data in horizontal format. See HORIZONTAL under Command Mode
Syntax below.
Position
Shows which byte is currently selected.
Chapter 4 Commands 175
Dump
Record
Displays the contents of a record in hexadecimal, ASCII, and EBCDIC formats. You can
select one or more of these format options.
Refresh
Takes you to the beginning of the Dump display if the beginning of the file is out of view.
Skip Bytes
Allows you to bypass a specified number of bytes before the dump begins. Enter the
%
number of bytes to skip in the Skip Bytes spin box.
file-name specifies the name of the file that you want to display.
SKIP n specifies how many bytes to bypass before the dump begins. The default is 0.
COLUMNS specifies the width of the output, in terms of the number of data bytes to be
displayed on each line. In the default mode of this command, the actual width of the
display is approximately four times as wide as Columns, since the data is displayed in
hex, ASCII, and EBCDIC. For horizontal dumps, the width is approximately 12
characters wider than the COLUMNS value. The default is 16 for vertical display and 64
for horizontal display.
HORIZONTAL displays the data in a horizontal “over and under” format rather than the
default vertical “side by side” format.
RECORD specifies that the contents of the current record be displayed.
176 ACL for Windows 7 Reference Manual
Duplicates
Duplicates
The Duplicates command is a variation of the Sequence command, and is used to detect
whether key fields in the current file contain duplicates in the sequence.
You can also check the Duplicates check box in the Sequence command dialog box.
However selecting Duplicates causes ACL to check the Duplicates check box by default.
For more information, see “Sequence” on page 304.
Parameters
The Duplicates command has the following common command parameters: All,
Append, File, File Type, First, Footer, Graph, Header, If, Local, Name, Next, Print,
Screen, While. For a description, see Chapter 3: “Common Command Parameters”.
&
For a description of other parameters, see “Parameters” on page 304.
Example
See “Example 1” on page 306.
Chapter 4 Commands 177
Else
Else
Use the Else command to provide an alternate set of commands when a Group If test
fails in a conditional group. Else may also have its own condition.
Else is used only in a group, never on its own. Since groups are only used in batches, this
command is only available when a batch window is open.
The Else command is only allowed if the associated Group command contains a test. In
this case, for each record in the file, the commands between Group and Else are
processed if the test succeeds, and the commands between Else and End are processed if
the test fails.
It is important to note that all the commands are executed, but depending on the value
of the test, only one of the sets of commands is executed for each record. For more infor-
mation, see “Groups” on page 308 of the ACL for Windows User Guide.
Parameters
The Else command has the following common command parameter: If. For a
&
description, see Chapter 3: “Common Command Parameters”.
Example
%
See “Group” on page 202.
& End
Click (End) in a batch window to insert the End command to close or finalize a
Group or Loop command.
End is used only in a group; never on its own. Since groups are only used in batches, this
command is available only when a batch window is open. For more information, see
%
“Groups” on page 308 of the ACL for Windows User Guide.
Example
See “Group” on page 202.
Chapter 4 Commands 179
Evaluate
Evaluate
The Evaluate command determines the impact of detected sampling errors on a
population for a specified confidence level and sets out a “worst case scenario”,
returning an upper error limit frequency for record sampling and an upper error limit
for monetary sampling.
Note: Before using Evaluate, you must have determined the sample size using ACL’s Size
command, and you must have drawn the sample using ACL’s Sample command.
Use Evaluate to determine the effect of errors detected in record or monetary sampling
results.
In record sampling, the upper error limit frequency is expressed as a rate of error
because results are based on the number, not the monetary value, of errors. For
this reason, the upper error limit frequency appears in the command log as a
percentage.
In monetary sampling, the upper error limit (UEL) is expressed as a monetary
amount. The most likely error provides the amount of error we expect in the
population. The upper error limit provides the “worst case” amount of error,
based on the required confidence.
Note: The theory behind statistical sampling is complex and is beyond the scope of this
manual. If you are not familiar with the critical judgements required to perform statistical
sampling, we recommend that you consult a statistics specialist before using the ACL
Sample, Size, and Evaluate commands.
Note: In monetary unit sampling, you can use Evaluate for the fixed interval sampling
method only. In record sampling, you can use it for any method.
total errors do not exceed. For example, you can estimate that the most likely errors are
50,000, but you can also be 95% confident that the total errors do not exceed 288,000.
The sample size is supplied and the UEL cumulative factor is determined from the
Poisson distribution based on the supplied number of errors and the confidence level.
number in the Poisson tables. This reordering of the errors matches the largest
errors with the largest adjustment factors, ensuring the most conservative (i.e.,
highest) estimate of the upper error limit.
For top stratum items, the precision adjustment factor is the amount of the error.
Since all top stratum items are selected, all items in this population (and
presumably all errors) are detected.
For understatement errors, the precision adjustment factor is zero. This means
that the estimate of the upper error limit is not reduced when understatements
are detected because this type of error is not directly tested for with a monetary
sample.
Note: Various sample evaluation methodologies use adjustment values for under-
statement factors ranging from zero (as in ACL) to the amount of the most likely error. If
you prefer to use a different assumption regarding the treatment of understatement errors,
you can easily adjust the detail supplied to reflect your reduction in the upper error limit.
This does not affect the estimate of the most likely error, which is the same regardless of your
assumptions about understatements.
Finally, the most likely errors are accumulated to produce the total most likely
errors for the sample errors noted. As well, the basic precision is summed,
together with all the precision adjustment factors for the errors noted, to produce
the upper error limit for the sample within the required confidence.
Parameters
In addition to the parameters described below, the Evaluate command has the following
parameters: File, File Type, Footer, Graph, Header, Local, Name, Print, Screen, To. For a
description of these parameters, see Chapter 3: “Common Command Parameters”.
Monetary
Specifies monetary sampling type.
Record
Specifies record sampling type.
Confidence
Specifies the confidence level, entered as a percentage.
Interval
Specifies the sampling interval used for the sample drawn. See “Fixed Interval
Sampling” on page 285.
182 ACL for Windows 7 Reference Manual
Evaluate
Errors
Specifies the recorded amount of the sample item and the amount of the error associated
with that item. For example, if the recorded amount is 700, but should have been 900, the
item amount is 700, and the error amount is 200. When entering, separate the two
amounts with a comma. For monetary unit sampling, enter positive amounts for
overstated errors and negative amounts for understated errors. For example:
If the sampled amount is 100, but investigation shows it should have been 75, the
item is overstated by 25. Enter 100,25 in the Errors text box.
If the sampled amount is 100, but should have been 125, this item is understated.
Enter 100, –25 in the Errors text box.
You record understatement as negative because it is the opposite of
overstatement.
Sample Size
Specifies the number of records that were tested.
Number of Errors
&
Specifies the number of errors encountered in the sample you are evaluating.
To display the options for record sampling, click the Record button.
Example 1
To evaluate the upper error limit for a record sample with 95% confidence given a
sample size of 120 and 3 errors found in the sample:
You can be 95% confident that the actual error rate in the population does not exceed
6.47%.
184 ACL for Windows 7 Reference Manual
Evaluate
Example 2
To evaluate the upper error limit for a monetary sample with 90% confidence, given a
sampling interval of 300,000 and the following three item amounts and errors:
The basic precision is 693,000. In your evaluation you specified a monetary interval of
300,000 and a confidence level of 90%. The basic precision lets you make the best
statement you can: that you are 90% confident that the total errors do not exceed
693,000 if no errors are reported in the sample.
Given that three errors were reported, the most likely estimate of the total errors in the
population is 131,742.86, and you can be 90% confident that the total errors do not
exceed 892,429.72.
In the results, the 12,000 error in the 500,000 item is carried over unchanged into the
Most Likely Error and Upper Error Limit columns because it is a top stratum item. A top
stratum item is an item whose amount is greater than the specified sampling interval.
Because all top stratum items are automatically selected, presumably all errors in such
items are also reported, and so there is no need for statistical projection.
Chapter 4 Commands 185
Evaluate
The 250 error in the 700 item results in the largest adjustment to the errors reported.
This is because the 250 error has the highest tainting (the error as a percentage of the
%
item) at 36%, and therefore results in the largest adjustment when statistically projected.
Export
Use the Export command to create files for use in:
Presentation graphics programs
Spreadsheet programs
Word processors
Databases
Export allows you to convert data from selected fields into these formats:
Windows clipboard for pasting into other Windows applications
dBASE III PLUS
Comma delimited text
Microsoft Excel
Lotus 1-2-3
Plain text
Microsoft Word merge files
WordPerfect 4.1 or WordPerfect 6.0 merge files
Export allows you to use ACL as a data conversion tool, taking data from one package
and producing an export file in a format readable by another package.
Export is commonly used as the last step in producing confirmation letters. For
example, you can use the Size command to determine your sampling interval, then use
Sample to draw an appropriate sample. Finally, you can use Export to convert the sample
results file to a Word .doc file that can be used in a Word merge operation.
Parameters
The Export command has the following parameters: All, Append, File, File Type, First,
If, Local, Next, To, While. For a description of these parameters, see Chapter 3:
“Common Command Parameters”.
Chapter 4 Commands 187
Export
Example
Use Export to produce confirmation letters.
You have information in a customer file that you need for address confirmations, but the
file is not formatted the way you would like.
188 ACL for Windows 7 Reference Manual
Export
To change the format, you can export the file to a secondary merge file for use in a word
processing program such as Microsoft Word. Export all fields except the credit limit
field, which is not needed to produce the confirmations.
The new Customer_master file is now ready to use in Microsoft Word merges without
%
extensive editing and formatting.
Extract
Use the Extract command to extract selected records or fields from the current file and
copy them to a different file.
There are various reasons to use Extract to create a subset of an original file. For
example, you can use Extract before sorting a file to reduce file size and processing time.
You can also use Extract with filters to isolate unusual items in a separate file for further
analysis.
You can extract entire records from the input file, including any data stored in undefined
gaps in the input file definition. The field definitions in the destination file are identical
to those of the source file, including any computed field definitions.
Note: Extracting records from a file that contains static and/or conditional static fields
may yield unpredictable results. Be sure to select only the fields you want.
You can also extract specified fields from a record. When you choose this option, ACL
automatically generates field definitions for the destination file. Computed fields
included in the field list are analyzed before extraction, so they form part of the input file
definition in the destination file. Their field type will be Logical, Date, ASCII, or ACL,
rather than Computed. This file will be of a fixed Record Length.
Note: If you select all the fields from the Extract list box, the result may not be identical to
extracting a record. Selecting fields this way ignores any undefined portions of the record.
When you extract an entire record, you extract even those portions that are undefined.
Note: When processing server files that contain related files, record output will be changed
to All fields output if you specify the local option or keyword.
Parameters
In addition to the parameter described below, the Extract command has the following
parameters: All, Append, End of File, Fields, First, If, Next, Record, While. For a
description of these parameters, see Chapter 3: “Common Command Parameters”.
Extract Fields
Allows you to select the fields or expressions to extract. Either highlight the fields in the
Extract Fields list box or click [Extract Fields] to display the Selected Fields dialog box.
See “Selection/Edit Dialog Boxes” on page 37 of the ACL for Windows User Guide.
Computed fields are converted to the appropriate field type in the created file: ACL,
ASCII, Date, or Logical.
190 ACL for Windows 7 Reference Manual
Extract
Example 1
If you discover that an inventory file has negative values for quantity on hand or
recorded value, you may want to extract these exceptional records to a new file,
Negative_value, for further investigation.
Chapter 4 Commands 191
Extract
The records meeting the negative value test appear in the new file.
Example 2
To create a file that contains only those fields that you find useful for your analyses, use
Extract. Remember to select the fields in the order you want them to appear in your view.
Extract the fields for product class, product description, product number, quantity on
hand, and recorded value to the file Inventory_extract. (Not all of the fields selected are
visible in the sample list box.)
192 ACL for Windows 7 Reference Manual
Extract
The extracted records appear in the Default View of the Inventory_extract file:
Fieldshift
The Fieldshift command allows you to shift the starting position of a data field. For
example, if data fields are added to or removed from a source file at any position before
the end, data in previously defined fields often moves out of alignment. You can use
Fieldshift to realign these data fields. By shifting a data field’s start position, you
automatically shift the start position of that data field along with all data fields to its
right.
Fieldshift only shifts physical data fields. Because computed fields are virtual fields that
make reference to other fields, they are not affected.
You can shift data fields using the Shift Fields button on the [Edit Fields/Expressions] tab
of the Input File Definition window or using command mode.
ACL does not allow you to shift data fields if doing so causes the shifted data fields to
extend beyond the current record length. As a result, you may need to increase the
record length on the [Input File Options] tab of the Input File Definition window before
shifting fields.
If a data field has been removed from the source file, delete the field from the input file
definition before shifting fields.
If a data field has been removed from the source file, decrease the record length on the
[Input File Options] tab after you shift the fields.
Parameters
Columns
Specifies the number of bytes to shift to the right (+) or left (-).
Start
Specifies the starting position of the first field you want to shift.
OK
Indicates that the command is to be executed without confirmation.
194 ACL for Windows 7 Reference Manual
Fieldshift
%
Fieldshift
data_filter_name specifies the name of the filter that identifies fields related to a
particular record type.
Example
FIELDSHIFT START 12 COLUMNS 4
This command shifts the field beginning at byte 12, and all subsequent fields, 4 bytes to
the right.
196 ACL for Windows 7 Reference Manual
File History
File History
Use File History to display:
The date, time, and how a file was created
The input file used
The commands used
Input and output record counts
Input and output control totals (if you have specified a control total field)
For a file to have a history, it must have been created by an ACL command.
To set the maximum number of history entries, use the Set History command. For more
&
information, see “Set History” on page 311.
Example 1
For example, if File A (the original input file) was sorted to File B, which in turn was
extracted to File C, which was summarized to File D, the File History of File D would
show:
Any notes relating to File A
File A as the source file, the date and time of the Sort to File B, the command
mode syntax associated with the Sort command, and input and output record
count and control totals
The date and time of the extraction to File C, File B as the source file, the
command mode syntax associated with the Extract command, and input and
output record count and control totals
The date and the time of the stratification to File D, File C as the source file, the
command mode syntax associated with the Stratify command, and input and
output record count and control totals
The history of the file appears in the command log. It is also recorded in the log file. If no
history appears in the command log, the file has no history.
Chapter 4 Commands 197
File History
Example 2
To display the file history for the file created in “Example 1” on page 190, use File
History.
%
quantity on hand.
Find
Use the Find command to move directly to the first record containing a specified
character search key in an indexed file.
Find allows you to locate a specific record. You can then display or perform calculations
on its contents, or compare the contents of one record to that of another.
If the search key value is found, ACL positions the file at that record. If it is not found,
ACL displays the message “No index matched key” and the file is positioned at the first
record with a search key value greater than the value you specified.
Note: The Find command is the Find Literal option of the Search command. To use the
Search command, select Analyze from the menu bar and choose Search. See “Search” on
page 298 for details.
This command can be issued in command mode only, although the Search option in the
Analyze menu also provides access to Find. For more information, see “Issuing
Commands” on page 238 of the ACL for Windows User Guide.
Prerequisites
The input file must be indexed on at least one character key field in ascending order. The
Find command does not operate on the portions of the index key fields which are
%
non-character or in descending order.
The character-search-key must match the case of the value to be found. It cannot
contain leading blanks, and cannot be surrounded by quotes. It can be shorter than the
index key, in which case Find only compares the index key value up to the length of the
search-key, and positions the file at the first matching or next greater record.
The operation of the search is not affected if the Exact Character Comparisons
preference is turned on.
Chapter 4 Commands 199
Find
Example
To move to the first record containing LATEX in an inventory file that has been indexed
by product description, use Find.
Enter the following into the command log text box:
ACL displays the first record in the file whose product description contains the search
key, LATEX:
Note: The Find command is case-sensitive. Typing FIND LATEX into the command log
text box will not find occurrences of Latex or latex.
200 ACL for Windows 7 Reference Manual
Gaps
Gaps
The Gaps command is a variation of the Sequence command, and is used to detect gaps
in the key numeric fields of the current file.
You can also check the Gaps check box in the Sequence command dialog box. However,
selecting Gaps causes ACL to check the Gaps check box by default.
If you run the Gaps command on a field that has characters mixed with numbers, for
example “A12345”, the characters are ignored and only the numbers are tested for gaps.
For example, if the field in the next record is “B12346”, then ACL would report no gaps
as the “A” and “B” in the fields are ignored.
For more information, see “Sequence” on page 304.
Parameters
The Gaps command has the following common command parameters: All, Append,
File, File Type, First, Footer, Graph, Header, If, Local, Name, Next, Print, Screen, While.
For a description, see Chapter 3: “Common Command Parameters”.
&
For a description of other parameters, see “Parameters” on page 304.
Example
See “Example 1” on page 306.
202 ACL for Windows 7 Reference Manual
Group
Group
Use the Group command in a batch to concurrently process a set of commands in one
pass of the input file. Because groups aggregate commands so that they are issued
concurrently against each record in the input file, you can significantly reduce
processing time.
Only record-based commands and certain batch operation commands are appropriate
for use within a group. These commands include: Age, Assign, Cancel, Classify,
Comment, Count, Duplicates, Else, End, Export, Extract, Gaps, Histogram, Join, List,
Loop, Merge, Profile, Report, Sequence, Statistics, Stratify, Summarize, Total, and
Verify.
Groups are used only within batches. Within a batch you can include one or more
simple, conditional or nested groups. Before you create a group, you should be familiar
with the concepts involved in creating batches. For more information, see “Batches” on
page 233 of the ACL for Windows User Guide.
Parameters
The Group command has the following parameters: All, First, If, Next, While. For a
&
description of these parameters, see Chapter 3: “Common Command Parameters”.
Example
To create a group, follow these steps:
1. Open a batch. ACL displays the batch window.
2. Click (Group). ACL displays the Group dialog box.
Chapter 4 Commands 203
Group
3. If necessary, enter an expression in the If text box or click [If] to create an expression
with the Expression Builder. For more information, see Chapter 6: “Building Expres-
sions”.
4. If necessary, click the [More] tab and modify the scope.
5. Click [OK] to exit the Group dialog box. ACL displays the batch window with the
Group command.
6. Enter commands and any conditions or nested groups. For more information, see
“Loop” on page 237 and “Batch Window” on page 302 of the ACL for Windows User
Guide.
7. Click (End).
%
8. Close the batch window and save your changes.
Note: It is considered good style to indent commands in a group. Although not required, it
helps to identify where a group starts and ends.
Simple Groups
Simple groups start with a Group command, are followed by a series of commands, and
terminate with an End command. For example:
GROUP
COUNT
HISTOGRAM ON QtyOH MINIMUM 0 MAXIMUM 100 INTERVALS 10
CLASSIFY ON Loc ACCUMULATE QtyOH
END
Conditional Groups
Conditional groups execute commands based on whether a condition is true or false.
For example, the following Group command is executed only on records with a
ProdCls field whose value is less than “05”:
GROUP IF ProdCls < "05"
COUNT
HISTOGRAM ON QtyOH MINIMUM 0 MAXIMUM 100 INTERVALS 10
CLASSIFY ON Loc ACCUMULATE QtyOH
END
Records that do not meet the test condition are ignored unless you include an Else
statement. Any number of commands can follow an Else statement. In the following
example, all records that do not meet the condition are processed by having their QtyOH
field totalled.
GROUP IF ProdCls < "05"
COUNT
HISTOGRAM ON QtyOH MINIMUM 0 MAXIMUM 100 INTERVALS 10
CLASSIFY ON Loc ACCUMULATE QtyOH
ELSE
TOTAL QtyOH
END
Chapter 4 Commands 205
Group
You can include multiple Else/If statements within a group, as long as each Else/If
statement contains a different test. In the following example, the Else/If statements
produce four totals:
GROUP IF ProdCls < "05"
COUNT
HISTOGRAM ON QtyOH MINIMUM 0 MAXIMUM 100 INTERVALS 10
CLASSIFY ON Loc ACCUMULATE QtyOH
ELSE IF ProdCls = "05"
TOTAL QtyOH
ELSE IF ProdCls = "06"
TOTAL QtyOH
ELSE IF ProdCls = "07"
TOTAL QtyOH
ELSE
TOTAL QtyOH
END
The following illustration shows how ACL processes the above Group command.
If yes, total the QtyOH field for all records in which ProdCls=05
If yes, total the QtyOH field for all records in which ProdCls=06
If yes, total the QtyOH field for all records in which ProdCls=07
Otherwise, total the QtyOH field for all records that did not meet any
of the above tests
Nested Groups
Nested groups refer to groups which are included within other groups. Nested groups
provide a powerful way for you to control which commands are executed for which
records. Most applications do not require such an advanced level of functionality, but it
is available, if necessary.
206 ACL for Windows 7 Reference Manual
Group
As with other groups, use the End command to terminate a nested group. ACL starts
processing the data only after all group commands have been terminated. For example:
GROUP IF ProdCls < "05"
COUNT
STRATIFY ON QtyOH ACCUMULATE QtyOH MIN 0 MAX 100 INT 10
GROUP IF QtyOH > 0
STATISTICS ON QtyOH
HISTOGRAM ON QtyOH IF ProdStat = "B"
END
ELSE
TOTAL QtyOH
END
In this example, all of the commands from Count up to and including the next Group are
executed only if ProdCls is less than 05.
The Statistics and Histogram commands are executed if QtyOH is greater than zero.
However, because the second Group command is nested, the Statistics and Histogram
commands are executed only for records that meet the conditions ProdCls < "05"
and QtyOH > 0.
Furthermore, because Histogram also has a test, it is executed only for records that meet
the conditions ProdCls < "05" and QtyOH > 0 and ProdStat = "B".
Variables in Groups
Using variables is an effective method of storing information from one record for use
with information in later related records. Variables also allow values to be accumulated
for a set of related records.
For example, assume you have an accounts receivable transaction file sorted on the
CustNo field from which you want to create a running total for each customer’s trans-
action Amount field and output all transactions with their running total for subsequent
analysis to a new file.
V_CUSTNO=CustNo
V_AMOUNT=0.00
GROUP IF V_CUSTNO=CustNo
V_AMOUNT=V_AMOUNT+Amount
EXTRACT V_CUSTNO Amount V_AMOUNT TO “TotalsCust.fil”
ELSE
V_AMOUNT=Amount
EXTRACT V_CUSTNO Amount V_AMOUNT TO “TotalsCust.fil”
V_CUSTNO=CustNo
END
For more information, see “Variables” on page 311 of the ACL for Windows User Guide.
Chapter 4 Commands 207
Help
Help
ACL online Help lets you browse for information about using ACL commands,
functions, features, and field types. For more information, see “Online Help” on page 52
of the ACL for Windows User Guide.
To display context-sensitive help, press F1 or click [Help] in any ACL dialog box. ACL
%
displays a Help window showing information about the area you are working in.
Histogram
Use the Histogram command to produce a 3-D vertical bar graph of the distribution of
records over the values of a field or expression. You can send the result to a file, the
screen, or a printer, or once the data is in the form a graph, you can specify other types
of graphs. Histogram is useful in providing an overview of a file’s contents. Histogram
works on unsorted data.
For details on output options, see “Graphs” on page 203, and “Graph Output” on
page 235 of the ACL for Windows User Guide.
A horizontal representation of the graph also appears in the command log. An occur-
rence of field or expression values within a given range is represented by an asterisk (*).
Each asterisk represents a single, partial, or multiple number of occurrences, as
required, to fit the Histogram into the designated number of columns. The command
log shows how many occurrences each asterisk represents.
If you close the graph, you can call it up again by double-clicking the output or the
<<<Graphable Data>>> statement in the command log.
Parameters
In addition to the parameters described below, the Histogram command has the
following parameters: All, Append, Break, File, File Type, First, Footer, Graph, Header,
If, Local, Name, Next, Print, Screen, Suppress, While. For a description of these param-
eters, see Chapter 3: “Common Command Parameters”.
Columns
Allows you to specify the number of columns that you want for the horizontal command
log representation of the histogram graph. Interval counts are scaled to the space
available. The default is 78.
Chapter 4 Commands 209
Histogram
Free
Specifies start and end points.
For numeric histograms only, it allows you to specify the starting point of each interval
and the ending point of the last range. Enter the starting point of each range in the Free
text box, one value per line. The last number entered is interpreted as the end of the final
range.
Histogram On
Allows you to specify the field or expression for which you want to develop a histogram.
You can use character or numeric field types. Select a field from the Histogram On
drop-down list, or click [Histogram On] to display the Selected Fields dialog box. For
more information, see “List Views” on page 40 of the ACL for Windows User Guide.
Intervals
Applies to numeric fields only. It allows you to specify the number of even intervals ACL
produces over the range of minimum to maximum.
The default is 10, but you can change this in the Edit ACL Preferences dialog box.
To change command option preferences, see “Command Options” on page 288 of the
ACL for Windows User Guide.
Maximum
Applies to numeric fields only, and allows you to specify the maximum value of the last
interval. If you issued a Profile or Statistics command, the default is the highest value in
the numeric field. Otherwise, no default exists.
Minimum
Applies to numeric fields only, and allows you to specify the minimum value of the first
interval. If you issued a Profile or Statistics command, the default is the lowest value in
the numeric field. Otherwise, no default exists.
210 ACL for Windows 7 Reference Manual
Histogram
Example 1
You can produce a histogram to show the distribution of customer credit, providing
information that can be used in the adjustment of credit policy.
To create a histogram of evenly-spaced intervals:
1. Select the field named Limit from the drop-down list or click [Histogram] to display
the Selected Fields dialog box to obtain more detailed information about the fields in
this file. After selecting a field, click [OK] to return to the Histogram dialog box.
Select field
Specify minimum
and maximum
2. Specify a minimum of 5000 and a maximum of 50,000, and accept the default of 10
intervals.
Chapter 4 Commands 211
Histogram
3. Click [OK] to execute the command and display the graph. The graph shows that the
greatest amount of credit falls within the 50,000 range.
Example 2
The histogram obtained in Example 1 shows that the majority of credit has been
extended in the 50,000 range. You can obtain a further breakdown of this distribution by
creating a histogram of free intervals.
To create a histogram of free intervals:
1. Select the field named Limit from the Histogram On drop-down list. Specify a
minimum of 50,000, a maximum of 300,000, and free intervals of 50,000, 75,000,
100,000, and 300,000.
2. Click [OK] to execute the command and view the graph. The graph shows that most
credit limits fall within the 50,000 to 75,000 range, and that no credit has been
extended beyond 100,000.
Chapter 4 Commands 213
Histogram
The command log shows 33 occurrences of credit in the 50,000 to 75,000 range.
If
The If command allows you to specify a condition that must be met in order for the
command following it to execute. The condition applies to the entire command and
must be met for the command to continue processing.
The If command evaluates the test when ACL first encounters the command. If the test
evaluates as true, the command following is processed. If the test returns false, ACL
ignores the rest of the command.
This differs from the If condition at the command level which tests each record of the file
and executes the command on the records that meet the test.
In a batch, you can enter a series of If command tests and run different commands based
on the result. The If command is most useful for testing a variable to determine if the file
will be processed.
Any valid ACL command may follow the test.
%
This command can be issued only in command mode and is useful only in batches.
Examples
To perform a sample, but only if the variable count1 is greater than ten:
IF Count1 > 10 SAMPLE Amount...
Assume you had a previous Dialog command, with a check box control that creates the
variable StatCheckBox (so the user can check to display statistics). You could use the
following command to produce the statistics, if requested:
IF StatCheckBox STATISTICS Al
Chapter 4 Commands 215
Import
Import
Use this command to import an ODBC database table. The Import command allows
you to import ODBC files in batches and then perform further analysis on the files, all
from within batches.
If an ODBC file requires a password, use the Password command to prompt the user for
the password so that the Import command can proceed. See “Password” on page 249 for
details.
The easiest way to create the Import command is to import an ODBC file in menu mode,
and then copy the Import command from the command log and paste it into your batch.
Note: You need to import an ODBC table only once. After that, you can use the Refresh
&
command to update the data in the ODBC table. See “Refresh” on page 259 for details.
%
Data” on page 125 of the ACL for Windows User Guide.
Index
Use Index as a prerequisite to accessing a file using Define Relation in command mode
or the Relations command from the menu bar. Also use the Index command to create an
index file that allows direct access to the records of an input file in a logical rather than
physical order.
You can have more than one index file relating to a particular input file. At any one time
only one index file can be active.
Before using index files, see “Overview Window” on page 27 and “Index” on page 97 of
the ACL for Windows User Guide.
Some commands, such as Define Relation and Relations, require that you index the
related files before defining relations. For more information, also see “Relations” on
page 261 and “Multiple File Operations” on page 100 of the ACL for Windows User
Guide.
Note: You do not need to use Index or Sort with Classify, Age, Histogram, and Stratify,
because these commands do not require a sorted file.
Sorting Indexing
Use the Index command as an alternative to the Sort command only when disk space is
very limited or you want to quickly find records with a specific key value.
Note: If you intend to access more than 10 percent of the records in the file, it is better to
sort the data in order to optimize processing speed.
The Index command creates an index file that contains pointers to the records in the
open input file. These pointers are arranged so that the input file can be accessed in a
logical order. For example, by turning on the Find Literal option in the Search
command, you can locate records with specific key values very quickly, usually in less
than one second.
Sort Order
The sort order of the index file can contain as many fields as you want up to a maximum
key length of 255, and each field may be in ascending or descending order, independent
of the others. The records are sorted based on the field values in the order in which the
fields are selected. The first field selected is the first sort key, and so on.
The Find Literal and Seek Expression options of the Search command only operate on
key index fields which are both character type and in ascending order. You can include
non-character or descending fields in an index file and still use the Find or Seek
commands. However Find and Seek will only operate correctly if the first key fields are
in ascending character order.
For more information on moving directly to specified records in a file, see “Search” on
page 298.
Activating Indexes
There are two ways to activate an index file. When you first create the index, make sure
Use Output File is checked in the Index dialog box. This activates the index when the
Index command is executed. If you want to activate an index that was previously created,
double-click the index in the Overview window. When the index is activated, the word
Indexed appears next to the record count in the status bar.
To check that an index is active, look at the middle of the status bar. The window will
indicate either “x Records Indexed” or “x Records Filtered Index”, depending on
whether or not the index was created using a filter.
218 ACL for Windows 7 Reference Manual
Index
Indexing Tips
Here are some tips for working with indexes:
Give the index file a name that references some of the important details about the
index such as the input data file for which it was created, the key fields, and so on.
When you click [Index] in the Select Input File Definition dialog box, ACL
displays all indexes that have been created for all input files. If you select an index
that is not appropriate for an input file, ACL identifies the input file for which the
index was created. The best way to select the correct index is to choose it directly
from the Overview window.
The quickest way to identify which index is currently in use is to look for a
colored icon under Indexes in the Overview window.
Parameters
In addition to the parameter described below, the Index command has the following
parameters: All, Ascending, Descending, File, First, If, Local, Next, To, While. For a
description of these parameters, see Chapter 3: “Common Command Parameters”.
Index On
Specifies the input file key fields or expressions to index. Select the fields from the list
box, or click [Index On] to display the Selected Fields dialog box. For more information,
see “Selection/Edit Dialog Boxes” on page 37 of the ACL for Windows User Guide.
Chapter 4 Commands 219
Index
Creating an Index
To create a new index:
1. Click [Index] on the button bar or Select Data from the menu bar and choose Index
to display the Index dialog box.
2. From the Index dialog box, select a field from the Index On list box.
220 ACL for Windows 7 Reference Manual
Index
You can also click [Index On]to display the Selected Fields list box, which gives you
more information about the fields you are selecting.
There are three ways to select fields using the Selected Fields dialog box:
Click the name of the field to select it, then click (arrow) to move it
between list boxes.
Double-click the name of the field to select it and move it from the Available
Fields list box to the Selected Fields list box.
Click [Expr] to display the Expression Builder. The Expression Builder lets you
apply a condition or filter to the data in the selected field.
Select the field you want from the Available Fields list box, then click [OK] to return
to the Index dialog box.
Chapter 4 Commands 221
Index
Example
To alphabetize a customer file for easy reference, use Index.
Index on the customer name field to the index file, Customer_name.
You can now use options within the Search command to access individual records
quickly. Use the scroll bar to view the entire file. Notice that the first record in the
indexed file is “1st Technology Group.” In an indexed file, numbers are listed before
%
alphabetic characters.
Join
Use the Join command to combine fields from two input files into a third file.
Join is typically used to match records in a transaction file with those in a master file. You
can, for example, match invoice data in an accounts receivable file to data in a master
customer file, or you can compare the contents of two files.
When you join a transaction file and a master file, the transaction file is usually the
primary file, and the master file is the secondary file. Carefully identify your primary
and secondary files because results differ if you reverse the files.
Matched Records Y Y
Unmatched Records Y
Matched Records
Creates an output file of selected fields from the primary and secondary files for primary
file records with key field matches in the secondary file.
If there is more than one key field match in the secondary file, ACL uses the first
matched record it finds. If no matching record is found, no output record is produced.
Unmatched Records
Creates an output file of all records from the primary file that had no matches in the
secondary file. The output file includes primary fields only because there is no
secondary information if records have no match.
Other Options
To identify transactions for which no master file records exist, specify the transaction
file as the primary file. And, to identify master records with no matching transactions,
specify the master file as the primary file.
Note: ACL supplies an error message to the command log if the IMS secondary file is not
HDAM.
Parameters
In addition to the parameters described below, the Join command has the following
parameters: All, Append, First, If, Local, Next, To, Use Output File, While. For a
description of these parameters, see Chapter 3: “Common Command Parameters”.
Matched Records
Includes matched records from the primary file and matched records from the
secondary file in the output file. This is the default option.
Presort
Sorts the primary file on the primary keys before joining the files. Presort cannot be
used in a group.
Primary Fields
Specifies which primary file fields or expressions to include in the output file. Select the
fields from the list view or click [Primary Fields] to display the Selected Fields dialog
box.
Key fields are not automatically included in the output so you must select them if you
need them.
Primary Keys
Specifies which key fields or expressions from the primary file to include. Select the key
fields from the list view, or click [Primary Keys] to display the Selected Fields dialog box.
Secondary Fields
Specifies which secondary fields to include in the output file. Select the fields from the
list view, or click [Secondary Fields] to display the Selected Fields dialog box.
Key fields are not automatically included in the output so you must select them if you
need them. For more information, see “Selection/Edit Dialog Boxes” on page 37 of the
ACL for Windows User Guide.
Secondary File
Allows you to choose the secondary file that you want to join to the primary file. Select
the file from the drop-down list.
Secondary Keys
Allows you to select key fields or expressions from the secondary file. Select the key
fields from the list view, or click [Secondary Keys] to display the Selected Fields dialog
box.
Unmatched Records
Includes only unmatched records from the primary file in the output file.
228 ACL for Windows 7 Reference Manual
Join
Example 1
This example shows how to join the matched records of an accounts receivable file and a
customer master file, using the All Primary option. Combining information from both
files provides a better basis for transaction analysis and the preparation of confirmation
letters.
The primary file is the accounts receivable file. The secondary file is the customer master
file. The joined output file is named Join_ar_customer. Before joining the files, sort
both on customer number, naming them Ar_sort and Customer_sort respec-
tively.
To join Ar_sort and Customer_sort:
1. First display the Join dialog box. To do this, open the primary file, Ar_sort, then
select Data from the menu bar and choose Join.
2. Then select the secondary file, Customer_sort, from the Secondary File drop-down
list.
Chapter 4 Commands 229
Join
3. Select the primary key field, No, by clicking it in the [Primary Keys] view list.
4. Select the primary file fields to include in the output file. Click [Primary Fields] to
display the Selected Fields dialog box. Then select these fields in this order:
customer number, invoice date, due date, reference number, transaction type,
and transaction amount.
The order in which you select fields is the order in which they appear in the joined
file’s view. Click [OK] to return to the Join dialog box.
5. Select the secondary key field, No, by clicking it in the [Secondary Keys] view list.
6. Select the secondary file fields to include in the output file. Click [Secondary Fields]
to display the Selected Fields dialog box. Then select the Name and State fields. Click
[OK] to return to the Join dialog box.
7. Name the file by typing Join_ar_customer in the To text box.
8. To include all records from the primary file regardless of whether they have matches
in the secondary file, click the [More] tab and select All Primary.
9. Click [OK] to execute the command and view the output file Join_ar_customer. The
secondary file fields, Name and State, are located on the right of the view. The joined
file has the same number of records as the primary file because you selected All
Primary.
230 ACL for Windows 7 Reference Manual
Join
Example 2
This example shows how to check for unmatched records using the same primary and
secondary files, key fields, and primary and secondary fields as in Example 1.
Unmatched records signify potential errors in the files.
Follow Example 1, but this time, name the file Join_ar_customer_no_matches, and on
the [More] tab, select Unmatched Record.
Click [OK] to execute the command and view the output file. Because there is no match
in the customer file for the customer number 535189, the customer name and state of
residency fields do not appear in the joined file. The lack of a match for this record
number may warrant further investigation.
Chapter 4 Commands 231
%
Join
List
Use the List command to display selected output data in a columnar list format. For
example, you can use List to review the detailed contents of an input file.
This command can be issued only in command mode. For more information, see
“Groups” on page 308 of the ACL for Windows User Guide.
This command allows you to select information from the input file and print it to the
screen, send it directly to a printer, or save it to a text file. Unless otherwise specified,
output is sent only to the screen.
You can include the optional Line parameter to create multiline listings.
Page numbers, date, time, user identification, and column headings are provided
automatically. Numeric columns are also automatically totalled. You can specify
multiline, as well as centered headers and footers using the Header and Footer param-
eters.
Because column headings are determined by the first line of fields, make sure you
specify appropriate headings on the first line. Use the appropriate WIDTH modifier to
control horizontal positioning on each line and ensure fields are aligned vertically the
way you want them.
Note: Arranging a View is a more powerful way of listing and reviewing input file data.
See “Displaying a View” on page 174 of the ACL for Windows User Guide for details.
Parameters
In addition to the parameters described below, the List command has the following
parameters: All, End of File, Footer, Header, To. For a description of these parameters,
see Chapter 3: “Common Command Parameters”.
Fields
Indicates that the fields following this keyword are to be included in the list on line one.
Line
Specifies additional output lines.
For multi-line reports, column headings are determined by line 1. Headings for other
lines will not be output. If necessary, adjust the headings on line 1 to reflect the infor-
mation on the other lines.
Chapter 4 Commands 233
List
Skip
Causes ACL to insert the specified number of blank lines between each record in the list.
For example, LIST ALL SKIP 1 produces a double spaced list (one blank line
between each record).
Note: When creating a multiline report, you may find using field modifiers such as Width
and As, useful for aligning columns or adjusting headings.
See “Field Modifiers” on page 233 of the ACL for Windows User Guide for details.
Unformatted
Suppresses the special list pagination features and the space between fields (undelimited
SDF format). It creates output identical to that created by the Export ASCII command.
Use it with the TO file-name option to produce output that can be further processed by
%
other software programs.
Example
This example lists selected fields for records meeting a specified condition.
You can use List in an inventory file to list the fields for product number, product
description, quantity on hand, unit cost and recorded value for records with a negative
unit cost or quantity on hand. You can also add a descriptive header to the list.
234 ACL for Windows 7 Reference Manual
List
ACL informs you that only five records meet the test. These are unusual items and
warrant further investigation.
Chapter 4 Commands 235
Locate
Locate
Use the Locate command to move to a specified record number or to the first record in
a file meeting a specified condition.
Note: Locate is the Locate Record and Locate If options of the Search command. To access
the Search command, select Analyze from the menu bar and choose Search. For more infor-
mation, see “Search” on page 298.
Locate is usually much slower in finding a specific record than the Find Literal option of
the Search command because Locate reads the file sequentially. However, unlike the
Find Literal option, Locate does not require the file to be indexed first. The search always
starts at the first record (unless you specify the While or Next parameters in the
command) and does not rely on any predefined key fields. The processing speed is
proportional to the size of the file and the location of the record in it.
Locate Record is often used as a fast way of moving to a specific record number in a fixed
record length file. You can also include the Next and While parameters in a Locate
command.
Parameters
The List command has the following parameters: If, First, Next, Record, While. For a
%
description of these parameters, see Chapter 3: “Common Command Parameters”.
Example
In this example, you locate the first record meeting a specified condition in a sorted file.
To locate the first inventory item beginning with the word PLYWOOD in a file sorted by
product description, use Locate. Because the file is sorted on the description, all such
items are grouped together, facilitating a quick analysis of plywood products.
Enter the following into the command log text box:
LOCATE IF PRODDESC = 'PLYWOOD'
236 ACL for Windows 7 Reference Manual
Locate
The command log indicates the first record number that meets the condition:
Record 75 appears first in your view. The next three records also describe plywood
products:
Chapter 4 Commands 237
Loop
Loop
Use the Loop command within a Group command to process a record more than once.
Loops are frequently used when a record contains repeated information, sometimes
called buckets or segments, that you want to process. Commands between Loop and
End are executed repeatedly on the current record until the result of the test is false.
Loops can be used only within groups. Before you create a loop, you should be familiar
with the concepts involved in creating groups. For more information, see “Group” on
page 202.
Parameters
The Loop command has the following parameter: While. For a description, see
&
Chapter 3: “Common Command Parameters”.
Example
To create a loop, follow these steps:
1. Open a batch. ACL displays the batch window.
2. Position the cursor within a Group.
3. Click (Loop). ACL displays the Loop dialog box.
4. Do one of the following:
Enter an expression in the While text box.
Build an expression by clicking [While] and using the Expression Builder.
238 ACL for Windows 7 Reference Manual
Loop
%
7. Enter an End command to close the loop.
Note: To avoid creating an infinite loop, make sure that the test you specify eventually
returns false. You can also use the Loop option of the Set command to prevent infinite
looping. See “Set Loop” on page 312 for details.
Example
The following Loop command totals 100 bucketed fields in a record, assuming each
bucket is five bytes long:
GROUP
COUNT=0
TOTAL=0
LOOP WHILE COUNT<100
TOTAL=TOTAL+OFFSET(AMOUNT,COUNT*5)
COUNT=COUNT+1
END
END
Chapter 4 Commands 239
Merge
Merge
Use the Merge command to combine two sorted files with identical record structures
into a third file. For example, you can use Merge to combine two files with identical
record structures from different time periods, different company branches, and so on.
To combine fields from a Master and Transaction file that have different structures, see
“Join” on page 223.
Note: Merging records from files that contain static and/or conditional static fields may
yield unpredictable results. Be sure to select only the fields you want.
Merge places the merged output records from both the primary and secondary files into
a third output file. All aspects of the records remain unaltered and the sort sequences are
maintained. For each key field value, the records of the primary input file are placed
before those of the second.
The primary and secondary input files must have identical structures, although the fields
for the two files do not have to be named identically.
The Merge command produces an input file along with a file definition. This new file
can be used for further analysis and reporting with ACL.
Note: The If, While, First, and Next parameters that limit records selected for output only
apply to the primary input file.
Note: When processing server files that contain related files, record output will be changed
to All fields output if you specify the local option or keyword.
Prerequisites
For command line use, you must open the secondary file, as well as the primary file,
before issuing a command.
The primary and secondary files must have identical record structures. If this is not the
case, the results are unpredictable.
Both the primary and secondary files must be sorted in ascending sequence on the
character key fields. You can check the Presort check box in the Merge dialog box to sort
the primary file. The primary file can be indexed instead of sorted, if desired. The key
fields must be character fields. If they are not, use the STRING( ) function to convert the
key fields to character fields, or the DATE( ) function to convert a date. The total length
of the character fields must be the same in both input files.
240 ACL for Windows 7 Reference Manual
Merge
Parameters
In addition to the parameters described below, the Merge command has the following
parameters: All, Append, First, If, Local, Next, To, Use Output File, While. For a
description of these parameters, see Chapter 3: “Common Command Parameters”.
Presort
Check the Presort check box to sort the primary file on the primary keys before merging
the files.
Primary Keys
Specifies the primary input file character keys to be merged. Select the key fields from
the list view, or click [Primary Keys] to display the Selected Fields dialog box.
Secondary File
Allows you to select the secondary file to be merged with the primary file. Select the file
from the drop-down list.
Secondary Keys
Specifies the secondary input file character keys to be merged. Select the key fields from
the list view, or click [Secondary Keys] to display the Selected Fields dialog box.
See “STRING( )” on page 79 and “DATE( )” on page 39 for details on converting
numeric fields to character fields.
For more information on the Selected Fields dialog box, see “Dialog Boxes” on page 32
of the ACL for Windows User Guide.
Chapter 4 Commands 241
Merge
Example
It is convenient to have a year-to-date general ledger for the analysis of account transac-
tions. Use the first quarter’s G/L as the primary file and the second quarter’s G/L as the
secondary file.
Ensure that your primary file is GLQTR1, and that GLQTR1 and GLQTR2 are sorted on
the G/L account number field. In the Merge dialog box, select GLQTR2 as your
secondary file and identify the account number field as the key field for both files.
242 ACL for Windows 7 Reference Manual
Merge
The new file, Gl_jan_to-jun, lists (by account number) all of the first quarter’s records
prior to those of the second quarter. All aspects of the records remain unaltered, and the
%
sort sequences are maintained.
Note: You cannot use the presort keyword in a command group running in batch mode.
Use the first variation of the command syntax when the key field names in the two files
are identical and are fields, not expressions. Otherwise, use the second variation.
Chapter 4 Commands 243
Notify
Notify
Use Notify to send file or batch information in the form of a message or an attachment
to local or remote e-mail addresses. You can send the message to more than one person
provided your e-mail system supports multiple recipients.
Notify works with a variety of e-mail protocols, including VIM for ccMail, MAPI for
Microsoft e-mail applications, and SMTP for external servers.
Notify is a send-only utility not intended for use as a full-scale mail system.
Parameters
Address
Specifies the names of recipients for local e-mails and the e-mail addresses of recipients
for remote e-mails. Separate the names and addresses of multiple recipients with a
comma.
Mailbox
Specifies a path to a local mailbox or an SMTP server name.
Message
Specifies the text of the message.
Note: If you are using a Microsoft e-mail application, ensure that your e-mail application
is running before you start the batch. Otherwise, a Windows message appears, prompting
you to choose an e-mail profile. This prompt can cause the batch to hang.
Password
Specifies your password for local e-mails.
User
Specifies your user name for a local system, or your e-mail address for an SMTP server.
244 ACL for Windows 7 Reference Manual
Notify
Local E-mail
The following example illustrates the information you would enter for a local e-mail
message.
Separate multiple recipients with a comma.
Click [Browse] to select a file or batch to add to the message.
Remote E-mail
The following example illustrates the information you would enter for a remote e-mail
message. When sending a remote e-mail message, specify the SMTP server address in
the Mailbox Path text box.
Separate multiple recipients with a comma.
Click [Browse] to select a file or batch to add to the message.
Chapter 4 Commands 245
Notify
Open
Use the Open command to open a new input file. ACL assumes a file extension of .fil, if
no other extension is specified.
Note: The Overview window is the best way to open a data file. You can also select Data
from the menu bar and choose Select. Opening a data file using either of these methods is
more convenient than issuing the Open command.
If the file has a .dbf extension, or you specify the dBASE option in the command syntax,
ACL assumes the file to be a dBASE input file and reads the input file definition directly
from the file. ACL automatically detects and adjusts for the differences between the
many versions of dBASE.
If an input file is already open, ACL automatically closes the file before executing this
command.
Parameters
Bufferlength
Specifies the length (in bytes) of the input buffer area to be allocated to the file. Larger
buffer areas may improve processing speed at the expense of RAM available for storing
ACL commands.
If any IBM variable length blocks are read which exceed the buffer length, ACL displays
an error message and stops processing.
Bufferlength is controlled by the Buffer Size preference. To increase or decrease the
buffer length, select Edit from the menu bar and choose Preferences. Click the [Input
File Options] tab and enter the buffer length in the Buffer Size text box.
You must specify a buffer length when opening a tape. If you omit this parameter, ACL
prompts you for the information. The buffer length must be as large as the tape block
size, in bytes. If any tape blocks exceed the buffer length, ACL displays an error message
and stops processing.
You will seldom need to change this parameter, because the default is sufficient to handle
almost all situations. Default: 15,000 bytes.
CRLF
Indicates that a variable length ASCII file is to be read. ACL automatically adjusts for the
varying record lengths. Default: Fixed-length file.
Chapter 4 Commands 247
Open
dBASE
Indicates that the data input is a dBASE file. ACL recognizes the type of dBASE file
(dBASE II, III, III+, IV, and so on) and automatically creates an input file definition
from the file description.
You can extend the dBASE field definitions with ACL computed fields.
This parameter is assumed for files with a .dbf extension. Default: Not a dBASE file.
Format
Specifies the input file definition (as displayed in the Overview window) to be associated
with the data file you specify.
Index
The Index option indicates that an index file is to be opened to access the file in logical
rather than physical order. The file extension for the index file name is assumed to be
.inx when none is specified. You cannot specify Index with secondary files. Default: No
Index file.
Relation
Indicates that the file is to be opened as an ad hoc related file. ACL does not retain the
relationship to ad hoc related files. You must specify Index with related files.
Secondary
Indicates that a secondary file, rather than the primary file is to be opened. You cannot
specify Secondary in conjunction with Index or Tape.
Default: Primary.
Skip
Indicates that a number of bytes are to be bypassed at the physical start of the file. SKIP
can be used to ignore file header records or leading portions of the file which do not
follow the layout of the remainder of the file.
Default: 0.
Tape
Indicates that an attached tape or cartridge drive is to be read. You cannot issue Open
Tape as a secondary file. See Appendix B: “Working With Tape” for details on opening a
file stored on a magnetic tape reel or cartridge.
248 ACL for Windows 7 Reference Manual
%
Open
Example 1
To open an accounts receivable input file, Ar, use Open. Enter the following into the
command log text box:
Example 2
To open the Ar input file definition, but associate it with a new data file named Cutoff.fil
enter the following in the command log text box:
OPEN CUTOFF.FIL FORMAT AR
Example 3
To open a dBASE file named Test.dbf that you have not previously accessed, enter the
following into the command log text box:
OPEN TEST.DBF
Chapter 4 Commands 249
Password
Password
Many ODBC files are protected by passwords. Use the Password command to prompt
the user for the password so that you can import, or refresh, data files that require
passwords.
This command can be issued only in command mode. It is the preferred method for
requesting user passwords in batches.
When the user enters the password, the password is displayed as asterisks (*) in the
dialog box. The actual password is never displayed, not recorded in the command log,
and is accessible only by the Import and Refresh Commands.
The Password command is most useful in batches so that you can obtain the necessary
passwords to import or refresh ODBC database tables before analyzing them. You can
store up to five passwords in a batch file. For more information, see “Set Echo” on
%
page 310.
Example
Use the Password command followed by the Import command to import a password
protected data file:
PASSWORD 1 “Enter Payroll Password:”
IMPORT PAYROLL.FIL PASSWORD 1
250 ACL for Windows 7 Reference Manual
Pause
Pause
Use the Pause command to create a custom message such as an error message or input
explanation. The message appears in a dialog box.
Note: Pause is useful for displaying a message or prompt while running a batch. The Pause
command is not intended for application on a record-by-record basis, so cannot be included
in a group.
This command can be issued only in command mode. For more information, see
“Using Commands” on page 232 of the ACL for Windows User Guide.
Parameters
The Pause command has the following parameter: If. For a description, see Chapter 3:
%
“Common Command Parameters”.
Example
To display a message to the user in a batch, enter the following command in the
command log text box:
PAUSE 'The product class must be a 2-digit value.'
ACL displays the prompt at the appropriate point when the batch is run:
Chapter 4 Commands 251
Profile
Profile
Use the Profile command to provide summary statistics on one or more numeric fields
in an input file.
Profile provides the following information for numeric fields:
Total value
Absolute value
Minimum value
Maximum value
Profile is used primarily to determine minimum, maximum, absolute, and total field
values (as appropriate) before issuing the Stratify, Histogram, or Sample commands.
Note: If you want an overview of a file before detailed processing, the Statistics command
provides more complete information.
After a field has been profiled, ACL knows its minimum and maximum values. These
values are then used as defaults for the Minimum and Maximum parameters in the
Stratify and Histogram commands. Similarly, ACL knows the absolute value of the field
and uses this value as the default for the Population parameter in the Sample command.
If the Automatic Profile interface option is turned on, ACL automatically produces a
profile of all the numeric fields in a file each time a new input file is opened. The profiles
can be viewed in the command log. To turn this option on, select Edit from the menu bar
and choose Preferences. Click the [Input File Options] tab and select Automatically
Profile on Open.
Parameters
In addition to the parameter described below, the Profile command has the following
parameters: All, First, If, Next, While. For a description of these parameters, see
Chapter 3: “Common Command Parameters”.
Profile Fields
Specifies the input file numeric fields to be profiled. Select the fields from the list box, or
click [Profile Fields] to display the Selected Fields dialog box. For more information, see
“Dialog Boxes” on page 32 of the ACL for Windows User Guide.
252 ACL for Windows 7 Reference Manual
Profile
Example
Use Profile to obtain the absolute value of an inventory value field. You can then use this
value as the default population size for a random monetary unit sample (MUS) on the
field.
The total is $680,479.94, the absolute value is $708,243.94, the minimum value is
-$10,167.60 and the maximum is $100,800.00.
ACL automatically supplies $708,243.94 as the default value for the Population
parameter in any subsequent random MUS samples generated for the Value field until
the file is closed.
As well, ACL automatically supplies the minimum and maximum values for any
%
Histogram and Stratify commands you perform on the Value field.
Quit
Use the Quit command to end an ACL session.
This command can be issued only in command mode. For more information, see
“Using Commands” on page 232 of the ACL for Windows User Guide.
All open files are saved and closed before quitting. If you changed the current view or an
open batch and did not save the changes, ACL displays a message asking if you want to
save the changes before quitting.
This command is particularly useful when you want to have a batch that exits ACL when
it is finished.
Note: You can quit an ACL session by selecting File from the menu bar and choosing Exit,
which is more convenient than issuing the Quit command.
%
See “Exiting ACL” on page 55 of the ACL for Windows User Guide for details.
Random
Use the Random command to generate random numbers for use in programs other than
ACL.
Random generates the specified number of random integers from a specified value
range and displays them in columns. You can have ACL select unique values only (that
is, no duplicates) and display the random numbers in ascending sort order.
Each random number generated is greater than or equal to the minimum value and less
than the maximum value you specify. No random number is equal to the maximum
value. For example, if you specify a minimum number of 0 and a maximum of 100, ACL
will generate random numbers ranging from 0 to 99.
Parameters
In addition to the parameters described below, the Random command has the following
parameters: As, File, File Type, Footer, Header, Local, Name, Screen, To. For a
description of these parameters, see Chapter 3: “Common Command Parameters”.
Columns
Specifies the number of columns to be used to display the numbers. Enter a number or
use the arrows to increase or decrease the number. Default: 6.
Maximum
Specifies the upper bound of the range over which the random numbers are generated.
Any valid numeric value or expression is allowed. Maximum and Minimum must be
specified together.
Minimum
Specifies the lower bound of the range over which the random numbers are generated.
Any valid numeric value or expression is allowed. Minimum and Maximum must be
specified together.
Number
Specifies the number of random numbers to be generated. Enter a number.
Seed
Specifies the starting point for the random number generator. If a Random command is
duplicated with the same seed value, the random number sequence is reproduced
exactly. ACL replaces a zero seed value with a random number. Default: Internally
generated.
256 ACL for Windows 7 Reference Manual
Random
Sorted
Causes the output list of numbers to be displayed in ascending sort order. Default: Not
sorted.
Unique
Causes only unique numbers to be included in the output. When you select Unique,
each random number generated is compared to the entire list of previous numbers for
this command. When duplication exists, the number is discarded without replacement.
You should not select Unique when the number of random numbers to be generated
exceeds 75 percent of the range, because this can result in an inordinate number of
&
random numbers being discarded. Default: Duplicates allowed.
Example
To generate 10 unique random numbers between 1 and 1000 sorted in ascending order,
in 2 columns, use Random.
The random numbers generated are listed in sorted order from left to right reading from
top to bottom. No number is repeated. If a duplication had occurred in this example, it
would have been discarded and another number chosen.
258 ACL for Windows 7 Reference Manual
%
Random
Refresh
Use this command to refresh data imported through ODBC. Refresh updates the flat file
created from the database so that you are working with current data.
In a batch, you can refresh, then analyze the file just like any other data file. See “Import”
on page 215 for details. The Refresh command replaces only the associated data file and
does not automatically update field definitions. Consequently, you may need to define
or redefine the refreshed data.
For more information, see “Importing ODBC Data” on page 125 of the ACL for
Windows User Guide.
Parameters
Password
If you need a password to refresh data from an ODBC source, use the Password
&
command. See “Password” on page 249 for details.
%
from its source. Click [Yes].
Example 1
REFRESH RECEIVABLES
Example 2
Use the Password command followed by the Refresh command to import a password
protected data file:
PASSWORD 1 “Enter Payroll Password:”
REFRESH PAYROLL PASSWORD 1
Chapter 4 Commands 261
Relations
Relations
The Relations command allows you to simultaneously access and analyze data from two
or more files, two files at a time. You can analyze the combined data as though it existed
in a single file, and add fields from related files to a view.
Because you are working with data from different files, you can use Relations to examine
expected relationships, and to discover unexpected relationships. You can also create a
new file containing the related data fields using the Extract command. Relations
produces results similar to the Join command with the All Primary option selected.
Any two files to be related must each have one key field in common. The key field must
be a character field that contains the same type of data. All the files to be related must be
defined within the same ACL Project.
When there are duplicate records in the key field of the child file, ACL matches to the
first occurrence of the key. Remaining duplicate keys are ignored. When there is no
matching key in the related file, ACL displays a blank for character and date fields, zero
for numeric fields, and “F” for logical fields.
into one, shorten fields, or modify their structures in a variety of ways to make them
suitable for use as key fields.
For example, in one file the customer number field may be numeric. You could create a
new computed field to be the key field, and use the STRING( ) function to convert the
numeric data to character data. In a similar way you can use other ACL options and
functions to ensure that both fields are the same length, both aligned left or right, to
substitute complete spellings for abbreviations, to convert characters to uppercase or
lowercase, to insert or delete characters or blanks, and so on.
Note: You do not have to index or sort the related field in the parent file; however, you must
index the child file on the common related field.
Before you create a new index, check for an existing one. For information on displaying
indexes, see “Overview Window” on page 27 of the ACL for Windows User Guide. You
264 ACL for Windows 7 Reference Manual
Relations
can also print a list of indexes. For more information, see“Printing Documentation” on
page 228 of the ACL for Windows User Guide.
Note: If an index file becomes outdated, ACL automatically recreates the index file using
the same index file name.
Do not use filters when creating this index. If you need to apply conditions to the data,
apply them to the parent file and to its related fields after you have established the
relationship.
Save the index with a meaningful file name, because you will need to refer to it when you
define data relations.
Fields to be compared
The Ar file and the Customer file, for example, both contain a Customer Number field
that can be used as a key field in forming a relationship between these two files. Such a
relationship provides access to all fields in the Ar file as well as to relevant fields in the
Customer file: Name and Credit Limit.
Chapter 4 Commands 265
Relations
Once you have established a relationship between the two files, you can access the
Customer Name and Credit Limit fields in commands that you issue from the parent Ar
file. If you want, you can also add these fields to the view of the Ar file.
You can add fields from the Customer file to the view of the Ar file.
The Ar file also contains a Contract Number field, which it holds in common with the
Contract file, so a relationship can be established between these two files as well. Once
the relationship is established, the Sales Rep Number field can be accessed from the Ar
file. If you want, you can add this field to the view of the Ar file.
You can now use the Sales Rep Number field as a key field to relate the Ar file to the Sales
Rep file, and add the Sales Rep Name field to the Ar file’s view. Now all the fields of
266 ACL for Windows 7 Reference Manual
Relations
interest are in the Ar parent file’s view, and can be analyzed as though they existed within
the Ar data file.
Note: You can work with fields from related files whether or not you have added them to
the parent file’s view. Once you have established the relationships, all the related fields are
available for analysis from the parent file, and appear in field selection lists in commands
and in the Expression Builder.
Parameters
In addition to the parameters listed below, the Relations command has the following
parameter: As. For a description, see Chapter 3: “Common Command Parameters”.
Delete Relationship
Allows you to delete any relationship provided it has no dependent relations and no
related fields referenced in either the current view or in an active computed field.
Click this button to remove the selected relationship. ACL asks if you are sure you want
to delete this relation. Click [Yes] or [No].
OK
ACL carries out the command without a prompt. Otherwise, ACL prompts you to
accept or cancel deletion of the specified relation.
Parent File
The currently open file. ACL displays the name of the parent file. To choose a different
parent file, close the Relations dialog box, open the new file, select Data from the menu
bar, and choose Relations.
Relate On
Allows you to select the key field or expression from the parent file to relate on. You can
select only one field for each relationship.
Select a field from the Relate On list box or click [Relate On] to display the Selected
Fields dialog box. From here, you can choose a field from the Available Fields list box, or
access the Expression Builder to select a field and apply conditions to it.
Related File
Allows you to select the child file. This drop-down list displays all the available files in
your ACL Project except the parent file and files already related.
Select the related (child) file from the drop-down list.
Chapter 4 Commands 267
Relations
Relation Name
Allows you to build more than one relationship to the same file when you specify a new
name in the Relation Name text box. By default, the Relation Name text box displays the
name of the related input file definition. But you can enter a different, unique name and
then create a second relationship between the same files using a different key field.
For example, you related a file name Ar on a customer number key field. ACL displays
the name of the related file, in this case, Customer, in the Relation Name text box.
Because the existing relation to Customer already uses the name of the related input file
definition, you must provide a new, unique name. Index the Customer file on a new key
field. Then, to create a new relationship from Ar to Customer, enter a name such as
Customer_2 in the Relation Name text box, select the index from the Using Index
drop-down list, and click [Relate].
Relationships
Shows details of relations for the open file. For example, the Relationships list box above
shows that no relations exist. Details of relations for the open file are arranged to show
“related file name” related on “field name” using index “index file name.” These details
indicate the source of all fields.
Using Index
Allows you to select an index for the key field of the child file. Select an index from the
list box.
268 ACL for Windows 7 Reference Manual
Relations
Relating Files
To relate the two files:
1. Open Ar by double-clicking its file name in the Overview window or by dragging it
from the Overview window to the application workspace.
Double-click or
click and drag
2. Click [Relations] on the button bar or select Data from the menu bar and choose
Relations to display the Relations dialog box.
Chapter 4 Commands 269
Relations
3. Select the field named No as the key field from the Relate On list box. Or, you can
click [Relate On] to display the Selected Fields list box, which gives you more infor-
mation about the fields you are selecting.
There are three ways to select fields using the Selected Fields dialog box:
Click the name of the field to select it, then use the (arrow) to move
it between list boxes.
Double-click the name of the field to select it and move it from the Available
Fields list box to the Selected Fields list box.
Click [Expr] to display the Expression Builder. The Expression Builder lets you
apply a condition or filter to the data in the selected field.
Select the field you want from the Available Fields list box, then click [OK] to return
to the Relations dialog box.
4. Click the Related File drop-down list and select the file named Customer. Once you
select the Customer file, the Using Index list box displays index names for that file.
5. From the Using Index list box, select Customer_index.
270 ACL for Windows 7 Reference Manual
Relations
6. Click [Relate] to view details of the relationship in the Relationships list box. The
dialog box remains open until you click [Done], allowing you to establish multiple
relations.
4. In the Available Fields list box, double-click the field you want to sort on, or select
the field, then click the right arrow to move the field to the Selected Fields list box.
5. Click [OK] to return to the Sort dialog box, in which you can execute the command
in the normal manner. For more information, see “Sort” on page 323.
2. Select a child file from the From Input File drop-down list to display all of the fields
from the child file in the Available Fields list box. Fields are displayed in the
filename.fieldname format again, the same as when you access them through a
272 ACL for Windows 7 Reference Manual
Relations
command dialog box. You can now build expressions in the usual way, using fields
from the child file.
3. Move the fields that you want to add to the view from the Available Fields list box to
the Selected Fields list box by double-clicking on a field, or by selecting a field and
clicking the arrow key.
4. In the Available Fields list box, double-click the field you want to sort on, or select
the field, then click the right arrow to move the field to the Selected Fields list box.
5. Click [OK] to return to the view. ACL adds the selected fields to the view of the Ar
file. You can now simultaneously analyze data from both files.
Fields from primary file Fields from related file
Chapter 4 Commands 273
Relations
Deleting Relationships
You can delete any relationship that has no dependent relations and no related fields
referenced in either the current view or in an active computed field.
Example
1. Open the default view of the file from which you want to delete the relationship.
Select Data from the menu bar and choose Relations to display the Relations dialog
box.
2. From the Relationships list box, select the relationship you want to delete.
3. Click [Delete Relationship].
4. ACL asks if you are sure you want to delete this relation. Click [Yes] to confirm the
deletion. The Relationships text box confirms the deletion.
274 ACL for Windows 7 Reference Manual
%
Relations
Define
This is the command mode version of the Relations command on the menu bar. It allows
you to create a relationship between a parent and a child file on a common key field,
using a specified index for the child file.
DEFINE RELATION key-field-name WITH related-file-name INDEX
index-name AS <relation-name>
<relation-name> allows you to specify a new relation name so you can build a
another relationship to the same file.
Delete
This command allows you to delete any relationship that has no dependent relations and
no related fields referenced in either the current view or in an active computed field.
DELETE RELATION
You can add these options to the syntax format:
<related ifd/relation name>
<OK>
<related ifd/relation name> specifies which relations to delete. If you do not
add this qualifier, ACL deletes the last relationship defined.
See “Delete” on page 150 for details.
Display
This command allows you to view details of the relationships for the current file, the
same as you would see in the Relationships list box of the Relations dialog box. ACL uses
the format related-file-name related on key-field-name using the index called
index-name.
DISPLAY RELATION
For example:
'Customer' related by 'No' using index 'Customer_index'
Chapter 4 Commands 275
Relations
Rename
Use the Rename command to change the name of a field, file, or object in the ACL
Project.
This command can be issued only in command mode. For more information, see
“Using Commands” on page 232 of the ACL for Windows User Guide.
You can quickly rename any of the items that make up an ACL Project (for example, an
input file or a batch) by selecting the name of the item in the Overview window and
clicking (Rename).
To use the Rename command to rename any of the items that make up an ACL Project,
you must specify the appropriate parameter (for example, BATCH) in the command.
See the second variation of the Rename command syntax below.
You cannot rename a field that is either included in the current view or is included in the
definition of a computed field. You also cannot rename an input file that is currently in
use.
You can also rename fields using the Input File Definition window as described in
“Maintaining Input File Definitions” on page 164 of the ACL for Windows User Guide.
You can rename input files through the Select Input File dialog box, as described in
“Selection/Edit Dialog Boxes” on page 37 of the ACL for Windows User Guide.
Renaming through the Select Input File dialog box renames the input file definition, but
not the data file to which it is linked.
Prerequisites
Fields to be renamed cannot be included in the current view or referenced by a
computed field definition.
Files to be renamed cannot be open and the new name can not be the same as the
existing file name.
Files to be renamed cannot be open.
Parameters
In addition to the parameters described below, the Rename command has the following
parameters: As, File, To. For a description, see Chapter 3: “Common Command Param-
eters”.
Field
Allows you to rename a field.
OK
%
Indicates that the renaming process can proceed without confirmation.
Example 1
Whenever possible, a field’s name should describe its contents. If a field is not named
appropriately, you may want to use Rename to change the name.
In a sales transaction file, to rename an invoice number field ProdNo to Product, use
Rename. Enter the following into the command log text box:
You are asked if you are sure that you want to rename the field.
The Input File Definition window now shows the field as renamed. The new name
Product appears in place of the ProdNo field.
Example 2
To rename a June Ar batch without prompting.
Chapter 4 Commands 279
Report
Report
Use Report to print a report and to specify printing options. You can also specify an
HTML (HyperText Markup Language) file as the output for your report. All Web
browsers can read files in HTML format. This allows you to prepare your ACL reports to
be distributed or published via the World Wide Web. ACL generates HTML files in
HTML 3.0 format.
Note: Since most ACL report output is in table format, a Web browser that support tables
is required to view the output, such as Netscape 3 or higher, Internet Explorer 3 or higher,
and so on.
A report is based on a view. Alternatively, you can use the command line version to
format a report. The command line does not have access to some advanced features,
such as fonts.
There are three basic steps to create a formatted report:
1. Display a view and specify the field formatting you want for the report.
2. Display the Report dialog box and specify the overall page and report layout.
3. Print the report.
You use the options available in the Report dialog box for the second and third steps in
creating a report. You can specify a header and footer, sort your report on previously
selected key fields, produce a summarized report, ignoring details, and specify line
spacing and font size. You can also access the standard Windows Print Setup dialog box,
choose to send your report to the screen, to a file, preview the report, or send it directly
to a printer.
Customizing Reports
Creating a report is covered in detail in “Reports” on page 46 of the ACL for Windows
User Guide. We recommend that you read the contents of this section before you use the
Report command.
Prerequisites
You must display a view before selecting Data from the menu bar and choosing Report.
The view is used to format the fields and determine the report’s layout and content.
Parameters
In addition to the parameters described below, the Report command has the following
parameters: Append, End of File, File, File Type, Footer, Graph, Header, If, Local, Name,
280 ACL for Windows 7 Reference Manual
Report
Nodups, Nozeros, Print, Screen, Suppress, While. For a description of these parameters,
see Chapter 3: “Common Command Parameters”.
Presort
Causes ACL to index on the selected key fields before creating the report. To select this
option, you must first select the key fields in the view by using the sort key field marker.
You must also specify the sort order for each key field.
See “Reports” on page 46 of the ACL for Windows User Guide for details.
Preview
Allows you to preview the format of your report with the orientation and page size you
specified in the Page Setup dialog box.
To view the next or previous page, click [Next] or [Previous], respectively.
To magnify an area of your report, position your cursor over the area of the page you
want to magnify and click. Click the page to zoom out to full page view again.
To jump to the last page of your report, click [Last Page].
Setup
Displays the Page Setup dialog box if you have selected your printer as your output. You
can select a printer, select paper size and orientation, and specify various other options
affecting how your report prints.
Summarize
Produces a report with subtotals and totals only, and no detail lines. The subtotals are
generated based on the key break fields selected in the view.
If this option is not selected, ACL produces a report that includes detail lines, as well as
subtotals for each of the specified key break fields.
Default: Include detail lines.
Chapter 4 Commands 281
Report
&
on page 197 of the ACL for Windows User Guide for details.
Example 1
In this example, you prepare a report.
After you have formatted the contents of your report in the view, you use the Report
dialog box to specify a header and footer, line spacing, and all printer setup features.
Select a header and footer that adequately describes the content and creator of the
report. To produce a double spaced detailed report, select Double Spaced from the
drop-down list.
282 ACL for Windows 7 Reference Manual
Report
When you are satisfied with all print options and report specifications, click [OK] to
display the Print dialog box in which you can choose the pages to print, recheck your
print options, and click [Print] to print the report.
Example 2
In this example, you create a multiline report. Because a report is based on a view, you
can use ACL’s multiline capability to rearrange your current view to approximate the
format of your final report. See “Constructing Multiline Views” on page 186 of the ACL
for Windows User Guide for details.
Chapter 4 Commands 283
%
Report
Note: To use <NODUPS>, <ON> must also be included as shown. <NODUPS> will be
ineffective if <ON> is not specified.
LINE n specifies additional output lines. n can be a value between 2 and 60. The fields
to appear on Linen should follow n.
The column headings on the report are determined solely by the fields on the first line.
other-fields specifies appropriate fields or expressions for the report.
284 ACL for Windows 7 Reference Manual
Sample
Sample
Use the Sample command to create a record or monetary unit sample (MUS) from a
population within an input file.
The Sample command supports a wide range of sampling activities. You can create
record and monetary unit samples in combination with a number of sampling param-
eters and options to suit your needs.
Note: Creating record output from a file that contains static and/or conditional static fields
may yield unpredictable results. Be sure to select only the fields you want.
Note: When processing server files that contain related files, record output will be changed
to All fields output if you specify the local option or keyword.
Sampling Bias
Sampling bias is the chance of selection attributed to each item in the population. The
bias varies with the sampling method you choose.
Record Sampling
A record sample is unbiased. Each record in the file has an equal chance of being
selected. A hundred dollar item has the same chance of selection as a million dollar item.
So, there is a significant probability that very large transactions will be overlooked.
Record sampling is most useful for compliance or understatement testing.
In compliance testing, you are more concerned with the rate of errors in the total
population. Large transactions may be subjected to extra controls not present for small
Chapter 4 Commands 285
Sample
amounts. If you choose a sampling method that biases large amounts, you may miss a
potential problem relating to small transactions.
In understatement tests, you are more concerned with items that are missing or recorded
at too small a value. It may be that the larger amounts are least likely to be understated.
Cutoff
You can also bias sampling by including or excluding entire classes of transactions or
records. You can use the Cutoff option to include all transactions over a certain dollar
amount. Or you can specify a condition for a wide range of tests such as excluding items
in Product Class 05 or including only amounts over $10,000 for the month of April.
Sample Type
When you select a sample type, you are determining the specific method to be used to
draw the sample. The Sample command supports the following three basic methods:
Fixed interval sampling
Cell sampling
Random sampling
You can use any number of other methods via programmed logic in a command group.
For more information, see “In Batches and Groups” on page 233 of the ACL for Windows
User Guide.
When you apply the fixed interval method to an MUS, you are selecting individual
dollars from the population. Therefore, a thousand dollar item contains 1,000 individual
dollars and a million dollar item contains 1,000,000 individual dollars, any of which
might be selected. Once an individual dollar is selected, the record containing this dollar
is drawn.
Note: You must choose fixed interval sampling if you intend to use the Evaluate command
to evaluate errors. The sample sizes determined by the Size command are also designed for
use with fixed interval sampling.
Cell Sampling
In a cell sample, the population is broken into groups the size of the interval. One
random item is chosen from each group. ACL automatically generates the required
random numbers based on the random seed you specify.
When you apply cell sampling to an MUS, it is possible for the same record to be selected
twice. This can happen if a record straddles the limit between two intervals. The random
number generated for the first interval is high and the random number generated for the
second interval is low. Depending on the nature of the transactions, selecting the same
item twice may result in undersampling.
Random Sampling
In random sampling, you must specify a random seed value, the size of the population
and the number of selections you require. ACL generates the required number of
random numbers between one and the population specified based on the random seed,
then makes selections using the random numbers.
A random sample may undersample certain segments of the population. Unless you
take specific steps, individual, material transactions may be completely skipped.
If you check the No Repeats check box to limit successive draws, a random sample may
produce fewer selections than you asked for. In a random MUS, if two of the random
numbers generated are close, they may actually be part of the same record. If this occurs,
ACL does not select another item. For more information, see “Sampling With and
Without Replacement” on page 355 of the ACL for Windows User Guide.
When performing a random sample, you can request the selection order of the items
drawn. This is useful when you oversample. You can request the selection order only
when you do random sampling and select output of fields, not the entire record.
In the Sample Type area of the Sample dialog box, select Record. In the Sample Param-
eters area, select Random and enter the (oversample) Size, Seed, and Population
amounts. In the To text box, enter the output file name. Click [More].
Chapter 4 Commands 287
Sample
In the Output area of the [More] tab, select Fields, then select the fields you want in your
output file. The Report Selection Order check box is only available if your output choice
is Fields. To get the selection order number of the sampled items, check the Report
Selection Order check box. Click [OK].
The view of your output file contains a field titled ORDER, the last column on the right.
This column shows the order of the selected records. You can then select the first x
number of items and, if necessary, go back and select the next x number of items. For
ease of use, you can sort the output file by the ORDER column to see the selection order.
288 ACL for Windows 7 Reference Manual
Sample
In the example above, record 4 is the first item selected, record 1 is the second item
selected, and so on.
Note: It is important that you be able to replicate samples already produced, if required.
For example, if fourteen items from 750,000 were selected, you need to be able to select the
same fourteen items. For this reason, both cell and random sampling produce the same
results given the same file and random seed. If you set the seed to 0, ACL will ignore the 0
and use a random number. Using a random seed (seed = 0) does not produce the same
results, but since ACL reports the number it generates in response to a zero, even these
samples can be reproduced by supplying a seed equal to the number ACL generated.
Parameters
In addition to the parameters described below, the Sample command has the following
parameters: All, Append, First, Footer, Header, If, Next, Record, To, While. For a
description of these parameters, see Chapter 3: “Common Command Parameters”.
Cell
Selects Cell as the sampling method.
Cutoff
Specifies an amount for Fixed Interval and Cell sampling above which an item is
considered “top stratum.” Top stratum items are automatically displayed and included
in the sample.
The default cutoff is the Interval size.
Chapter 4 Commands 289
Sample
Extract Fields
Allows you to select the fields or expressions to be included with the sampled output
record. Any field or expression may be used. To access this option, select the Fields
option button, then select the fields from the list box or click [Extract Fields] to display
the Selected Fields dialog box.
For information on the Selected Fields dialog box, see “Selection/Edit Dialog Boxes” on
page 37 of the ACL for Windows User Guide. See also “Expression Builder” on page 247
of the ACL for Windows User Guide.
Fields
Allows you to select specific fields to be included in the output file by activating the
Extract Fields list box.
Fixed Interval
Selects Fixed Interval as the sampling method.
Interval
Specifies the interval value for Fixed Interval and Cell sampling.
MUS
Selects monetary unit sampling as the sample type.
No Repeats
Instructs ACL not to select the same record or MUS value more than once. Because ACL
does not replace any selections omitted, fewer records or values may be displayed than
expected.
The defaults is repeats.
Population
Allows you to specify the total number of units in the population, either in terms of
records or the absolute value of the field being sampled on. A population value is only
available for Random sampling.
To ensure that all records or field values in the sampling population have an equal
opportunity of selection, use the total number of records in the file, or the absolute value
of the sampled field, as appropriate, as the population size.
If you choose some other population size, ACL informs you in the command log that the
supplied population total differs from the actual total.
290 ACL for Windows 7 Reference Manual
Sample
The default for MUS sampling is the absolute value of the field if the Profile or Statistics
command has been previously issued. Otherwise, there is no default.
The default for Record sampling is the record count for the file.
Random
Selects Random as the sampling method. ACL offers different sampling parameters
depending on whether you choose Fixed Interval, Cell, or Random option buttons.
Record
In the [Main] tab. Selects Record sampling as the sample type.
Sample On
Specifies the field or expression for monetary unit sampling (MUS). Select the field from
the drop-down list, or click [Sample On] to display the Selected Fields dialog box.
For information on the Selected Fields dialog box, see “Selection/Edit Dialog Boxes” on
page 37 of the ACL for Windows User Guide. See also “Expression Builder” on page 247
of the ACL for Windows User Guide.
Seed
Specifies the seed value for the random number generator for Cell and Random samples.
Size
Displays the Size dialog box which you can use to determine appropriate sample sizes for
use with record and MUS. Enter the appropriate parameter values and click [Calculate]
to display the results. Click [OK] to return to the Sample dialog box. All parameters you
assigned in the Size dialog box are carried over.
See “Size” on page 314 for information on using the Size command.
Start
Specifies the first record or monetary unit chosen in a Fixed Interval sample.
Chapter 4 Commands 291
Sample
Subsample
Generates an extra field in the output file which contains a random number between
zero and the field value of the selected item. This is useful when subsampling is required,
for example, when a selected sample item is actually made up of a number of “smaller”
items. Top stratum items have a Subsample amount of zero, facilitating alternative
analyses on this population.
This is only available if you choose to output fields.
The default is no subsample.
Example 1
In this example, you create a fixed interval Monetary Unit Sample (MUS).
Much of an analyst’s work is performed on samples from a larger population. Use the
Sample command to derive an MUS sample from an inventory value field in which:
An item is randomly chosen from every $30,000 dollar interval, and
Every item greater than $25,000 is selected, and
The entire record is included in the file named Inventory_mus
From the Sample On drop-down list, select Value.
Select the Fixed Interval option button
In the Interval text box, enter 30000.
In the Start text box, enter 234.
In the Cutoff text box, enter 25000.
In the To text box, enter INVMUS.
You can test the sampled records for inventory obsolescence, cost to market value
comparisons, accuracy of extensions, or any other test relevant to an inventory account.
Chapter 4 Commands 293
Sample
The sample size is 24, with 0 top stratum items. Also displayed are the total of the
population from which the sample was drawn, including a breakdown of that value
between top stratum and other amounts, and the initial selection point for the fixed
interval sample.
Example 2
Use Sample to create a random record sample to determine compliance with a set of
sales transaction approval procedures. In compliance testing, the dollar value of the
items tested is not always relevant, so monetary unit sampling is not used.
Select Record as the Sample Type and Random as the Sample Parameter. To generate 26
distinct items for testing, specify a sample size of 26.
Specify a seed value of 234. ACL automatically lists the population size, in this case 152.
Specify that the entire record is to be copied to the sample file, Ar_sample.
294 ACL for Windows 7 Reference Manual
Sample
The sample size is 26, with zero top stratum items. Also displayed is the total of the
population from which the sample was drawn, including the start value for the random
record sample.
ACL displays the sample size with the number of top stratum items as well as the total of
the population from which the sample was drawn, including the start value for the
random record sample.
Once you have verified your sample you can use the Evaluate command to evaluate the
%
data. For more information see “Evaluate” on page 179.
Save
Use the Save command to store field definitions from the current input file in a
workspace file.
This command is used only on workspaces and only in command mode. For more
information, see “Issuing Commands” on page 238 of the ACL for Windows User Guide.
Much like an input file definition, a workspace is a file that stores field definitions.
However, a workspace is not associated with a specific input file. Workspaces are most
frequently used to store computed fields for use with more than one input file. For
example, you may want to apply a set of computed fields to an analysis of accounts
receivable files for different time periods or locations.
If the workspace you specify already exists in your current Project, ACL asks you if you
want to replace it.
It is important to understand how workspaces operate if you want to use the Save
command. For more information on workspaces and creating them from the Overview
window, see “Workspaces” on page 322 of the ACL for Windows User Guide.
Parameters
Workspace
%
Indicates that you want to save a workspace file.
Example
To save computed fields GRMargin and PercMarg in a workspace named
Inventory_margin that calculates the unit margin and percent unit margin for inventory
items, use Save as described below.
You can then apply these computed fields inventory files from different time periods or
divisions. Any field referenced by the computed fields in the workspace must be identi-
cally named in all files to which the workspace is applied.
Enter the following into the command log text box:
Chapter 4 Commands 297
Save
The workspace is now ready to be activated by issuing the Activate command. See
“Activate” on page 118 for details.
298 ACL for Windows 7 Reference Manual
Search
Search
Use the Search command to locate:
A specified record number
The first record in a file meeting a specified condition
The first record in an indexed file that either meets or exceeds a specified key
value, in which that value is a character string or character-type expression
which may include references to fields or variables
The first record in an indexed file that either meets or exceeds a specified key
value in which that value is a character-type expression which may include refer-
ences to fields or variables
Once the record is found, you can choose to perform calculations on it or compare its
contents to that of another record.
Note: If you are using an indexed file with Search, you should know whether or not the
index is conditional. A conditional index excludes certain records from the resulting view
and the commands issued when it is in effect.
Parameters
Expr
Allows you to enter a record number or expression. To enter an expression, either enter
it directly into the text box, or select [Expr] to display the Expression Builder to help you
build an expression. See “Expression Builder” on page 247 of the ACL for Windows User
Guide for details.
Find Literal
Allows you to locate the first record in the indexed input file that has an index key value
equal to or greater than the specified value. If the specified key value is found, the view
is positioned at that record. Otherwise, the message “No Index Matched Key” is
displayed, and the file is positioned at the first record with a key value greater than the
specified value.
To specify a character string to be found, enter the string in the text box. The character
string cannot contain leading blanks and must not be surrounded by quotes. It can be
Chapter 4 Commands 299
Search
shorter than the index key, in which case Search only compares the index key value up to
the length of the specified value and positions you at the first matching record.
Prerequisite: The input file must be indexed on at least one character key field in
ascending order. Other key fields can be non-character or in descending order, but are
excluded from the search. For example, if the indexed key fields are ProdCls (character
field) ascending, Loc (character field) ascending, and QtyOH (numeric field)
descending, you can only search based on ProdCls and Loc, although any listings of the
file are also sorted in descending quantity order.
Locate If
Allows you to find the first record in the input file that meets specified conditions. This
option processes the file sequentially, until the first record meeting the condition is
found or the end of the file is reached.
The search is sequential starting at the first record and does not rely on any predefined
key fields. The processing speed is proportional to the size of the file and the location of
the record in it.
To specify a condition, either enter it directly into the text box, or click [Expr] to display
the Expression Builder to help you build an expression.
See “Expression Builder” on page 247 of the ACL for Windows User Guide for details.
Locate Record
Allows you to find a specific record number in the file. If you select this option, enter the
record number in the text box.
Seek Expression
This option operates the same as the Find Literal option, except ACL assumes that the
specified value to be found is a character-type expression, rather than a literal character
string.
For example, assume you want to find the first record that has a key value equal to the
contents of variable X (which has a surname retained from earlier processing, such as
SMITH). Simply enter the letter X into the text box and the file will be positioned at the
first record with a key value of SMITH or the next greatest value, as appropriate.
If you want to find a simple character string, put quotes around the string. Leading
blanks may be entered after the opening quotation mark.
Prerequisite: See the Find Literal prerequisite above.
300 ACL for Windows 7 Reference Manual
Search
Example 1
To find record number 478 in an accounts receivable file use Search with the Locate
Record option.
The command log indicates that record 478 has been located, and the file is positioned
at that record in your view. You can now perform further analysis or computations on
the record.
Chapter 4 Commands 301
Search
Example 2
To scan a customer master file for a record in which the customer’s name is Syscom Gas,
use the Search command’s Locate If option. When more than one occurrence of Syscom
Gas is in the file, ACL positions the file at the first occurrence.
The command log indicates that the condition has been met by record 47, and ACL
positions the file at that record in the view.
302 ACL for Windows 7 Reference Manual
Search
Example 3
To view a list of customers based in New York (abbreviated NY) use the Search
command’s Find Literal option. Ensure that the file is indexed on the field representing
the place of residency.
For companies doing business in several states, provinces, or countries that have distinct
laws and regulations (for example, sales taxes), it is useful to access a list of customers
grouped by place of residence.
ACL positions the file at the first record for which it finds a match to the literal string NY.
Because the file is indexed, all customers residing in NY are listed consecutively.
%
Select Locate If in the Search dialog box, and enter STATE=‘NY’ in the text box.
Seek
Use the Seek command to move directly to the first record in an indexed file containing
a specified character search key.
This command can be issued only in command mode. For more information, see
“Issuing Commands” on page 238 of the ACL for Windows User Guide.
Seek allows you to locate the first record in the indexed input file that has an index key
value equal to or greater than the value of a specified character expression. If the
specified key value is found, the view is positioned at that record. Otherwise, the
message “No Index Matched Key” is displayed, and the file is positioned at the first
record with a key value greater than the specified value.
After the record is found, you may want to display or perform calculations on its
contents. Alternatively, you may want to compare the contents of one record with that of
another or of a variable.
A character-type expression may include references to fields or variables or can be a
literal string. To use Seek to find a character string, the string must be surrounded by
quotes.
When looking for values that contain leading blanks, you must use the Seek command
or the Seek Expression option of the Search command. You can also use the Next and
While parameters with Seek.
Note: The functionality of the Seek command is identical to the Seek Expression option of
the Search command. Search is accessible through a dialog box and as a result is more
convenient to use. Use Search instead of Seek whenever possible. For more information, see
“Search” on page 298.
Prerequisites
%
The input file must be indexed on a character field in ascending order.
Sequence
Use the Sequence command to determine if key fields in the current file are in sequential
order, or to detect and report gaps, duplicates or missing numbers in the sequence.
You can access Duplicates and Gaps as separate commands in the Analyze menu or you
can check the check boxes in the Sequence, Gaps, or Duplicates dialog boxes.
Sequence is often used to look for duplicate or missing document numbers, such as
invoice or check numbers. Sequence is also frequently used to determine if a file is sorted
properly.
Sequence always checks the designated key fields to determine if they are in sequential
order and reports on the results. You can specify whether to test the sequence for
ascending or descending order. Sequence errors are only reported up to a specified error
limit.
Gaps testing and duplicates testing are included in Sequence because for these tests to be
accurately performed the data must be properly sorted. To do this you can either check
the Presort check box or use the Sort or Index command. The Sequence command
always tests for data sorting errors.
Note: Separate commands exist for Gaps and Duplicates, but they are synonyms for
Sequence and their command syntax is similar. The PRESORT keyword is available for
Gaps and Duplicates but not for Sequence.
Parameters
In addition to the parameters described below, the Sequence command has the
following parameters: All, Append, Ascending, Break, Descending, File, File Type, First,
Footer, Graph, Header, If, Local, Name, Next, Print, Screen, Suppress, While. For a
description of these parameters, see Chapter 3: “Common Command Parameters”.
Duplicates
Indicates that you want to test for duplicates (or triplicates, and so on) in the key field
records. Also see “Duplicates” on page 176.
Chapter 4 Commands 305
Sequence
Error Limit
Specifies the maximum number of data sequence errors to report. If Sequence is issued
in a Group, ACL completes the command execution to avoid interfering with the
processing of the Group, but no further data sequence errors are reported. The Error
Limit does not affect the reporting of Gaps or Duplicates.
Default: 10. The default may be changed through a Command Options preference
setting. See “Command Options” on page 288 of the ACL for Windows User Guide for
details.
Gaps
Indicates that you want to test for gaps in the key field sequence. Gaps will not work if
more than one key field has been specified. Also see “Gaps” on page 200.
List Fields
Allows you to specify a list of fields or expressions you want to include in the output for
a Duplicates test. Select the fields from the list view, or click [List Fields] to display the
Selected Fields dialog box.
The fields are reported in columnar format with duplicate items displayed in grouped
rows. A blank line separates each set of duplicates. The duplicated key field values are
reported in the first column, followed by the specified fields.
This option is only available in Duplicates tests if Gaps is not selected.
For more information, see “Selection/Edit Dialog Boxes” on page 37 of the ACL for
Windows User Guide. For more information on building expressions, see “Expression
Builder” on page 247 of the ACL for Windows User Guide.
Sequence On
Specifies the input file fields or expressions you want to check for proper sequential
order, duplicates, or gaps. Select the fields from the list box, or click [Sequence On] to
&
display the Selected Fields dialog box.
Example 1
To check for duplicates, gaps, and sequence errors in an invoice number field in a sales
transaction file, use Sequence. An invoice number recorded twice or omitted entirely
could indicate problems in the controls of an accounting system. Poor controls can
result in lost revenue.
Select the invoice number field from the [Sequence On] list box, then select Duplicates,
Gaps, and List Gap Ranges.
Chapter 4 Commands 307
Sequence
ACL displays the result in the command log. The end of the command results appear as
follows. There are no data sequence errors indicating that the sales file is properly sorted
on the invoice number. The total number of gaps or duplicates is 34.
Example 2
The same example is performed using the List Missing Items option, and an Items Limit
of 6.
308 ACL for Windows 7 Reference Manual
Sequence
ACL displays the result in the command log. The end of the command results appear as
follows. Notice that a range, instead of a detailed list, is provided for the missing items
from 12878 to 12888. A range is provided because the number of missing items exceeds
the specified maximum missing items.
Notice also that the first example reported 34 errors while the second reported 35. The
reason for this is that both invoices 13030 and 13031 are missing. This counted as one
range in the first example, but two items in the second. See “Duplicates” on page 176
and “Gaps” on page 200 for further examples.
Note: You cannot use the presort keyword in a command group running in batch mode.
Chapter 4 Commands 309
Set
Set
Use the Set command to change user preferences in ACL. Set allows you to customize
the ACL environment to suit your needs.
Some preferences have equivalents in the ACL graphical user interface. These prefer-
ences can be set either through the Edit ACL Preferences dialog box or in command
mode.
Some preferences have no equivalents in the ACL graphical user interface. These prefer-
&
ences can be set in command mode only.
Preference Equivalents
You can access the following Set command options using the Edit ACL Preferences
dialog box. The table below lists the command mode Set option with its equivalent
preference. These preferences are described in “ACL Preferences” on page 279 of the
ACL for Windows User Guide.
%
SET WIDTH <TO> n Numeric Options tab
No Preference Equivalents
The following Set command options have no equivalents in the Edit ACL Preferences
dialog box, and can be set in command mode only. These options are usually used in
batches.
Set Echo
Sets logging of commands and results to the command log on or off. This can be used to
hide passwords or to eliminate unnecessary command detail in the command log. The
Password command is the preferred method for hiding passwords. Default: On.
Note: Set Echo is not a substitute for proper data security measures.
When you use the Set Echo None command, all output to the command log is not
logged. This includes interactive commands that you perform in ACL as well as all the
batches you run.
This can be useful when you run a long test or repeat a command such as the Do and Do
While commands. You may not want to record everything from tests and commands
that generate a lot of results in the command log.
The Set Echo command itself is recorded in the command log to indicate that some
output following this command is not logged.
Note: Turning off command logging means that some or all of your commands and results
will not appear in the command log. These commands and results will not be available for
future review. Therefore remember to turn command logging back on. The best way is to
enter both Set Echo None and Set Echo On at the same time. Then insert the commands
you do not want logged between these two lines.
Chapter 4 Commands 311
Set
Example
To turn off command logging while you repeat a series of commands 100 times:
COUNTER = 0
SET ECHO NONE
DO REPEAT_BATCH WHILE COUNTER < 100
SET ECHO ON
Set Filter
Limits the records to be examined in a file. This eliminates the need to include an If test
on each subsequent command.
All commands after a Set Filter apply only to the filtered records until you turn the filter
off or issue another Set Filter or an Open command.
Example
SET FILTER Amount > 1000
TOTAL Amount
STATISTICS Amount
COUNT IF Dept = “13”
is equivalent to:
TOTAL Amount IF Amount > 1000
STATISTICS Amount IF Amount > 1000
COUNT IF Amount>1000 and Dept=“13”
Counts for records meeting the filter, and any command If tests are reported separately.
In the Count example above, the result could be:
90 of 500 matched the filter: Amount > 1000
4 of 90 met the test: Dept = “13”
Set History
Sets the maximum number of File History entries for a file. This is useful if you want to
keep more or fewer File History entries than the default. See “File History” on page 196
for details. The default is 20.
312 ACL for Windows 7 Reference Manual
Set
Set Index
Opens an index file for the current input file.
Note: A faster way of opening an index file is to use the Overview as described in
“Overview Window” on page 27 of the ACL for Windows User Guide.
Example
To open the index TEST:
SET INDEX TO TEST
Set Learn
Opens a batch file. All subsequent entries (commands and so on) are recorded in the
batch until Set Learn is turned Off.
Set Learn operates the same as selecting the Tools menu and choosing Set Batch
Recorder On. See “Creating a Batch” on page 73 of the ACL for Windows User Guide for
details. Default: Off.
Example
To turn on the batch recorder and save the commands in file Ar_test:
SET LEARN TO AR_TEST
Set Loop
When you use the Loop command there is a chance that you can accidently get into an
infinite loop. Set Loop prevents this by stopping processing after a specified number of
commands has executed for any single record. Setting the maximum to zero turns off
loop testing. The range is 0-32767. Default: 10,000.
Example
To abort processing if more than 20 commands are executed for any record:
SET LOOP TO 20
Set Log
Changes the log file of your ACL Project to another log file. The default log has the same
name as your Project name with a .log extension. You can specify a different log file and
Chapter 4 Commands 313
Set
ACL will log all activities in the new log file. ACL inserts a line in the log file to record the
fact that you are switching to an alternate log file.
This is useful when you run a batch or commands that generate a lot of output to the
command log. You can switch to another log file to store the log during the batch and
then switch back to your original log file.
Example 1
To switch to using Newlog.log as the command log file:
SET LOG TO NEWLOG
Example 2
To switch back to using the original command log file:
SET LOG OFF
Set Password
Sets the password to access files that are protected by passwords.
Note: Before using this command, see “Password” on page 249 for the preferred method of
using passwords in batches. You should ensure that there are other security measures to
protect your passwords.
To prevent the password from being written to the command log, you should put this
command between the Set Echo None and Set Echo On commands.
The password is still written in the batch file itself
Example
To set password 1 to “secret”:
SET PASSWORD 1 TO "secret"
314 ACL for Windows 7 Reference Manual
Size
Size
Use Size to determine the appropriate sample sizes for record and monetary unit
samples (MUS).
Note: The theory behind statistical sampling is complex and its explanation is beyond the
scope of this manual. If you are not familiar with the critical judgements required when
performing statistical sampling, we recommend that you consult a statistics specialist
before using the Size, Sample, and Evaluate commands.
Size reports:
The required sample size
The interval based on the supplied population size (if an interval sample is used)
The maximum amount of error expected in the sample
The maximum tolerable errors for record samples: as long as the actual number is
less than or equal to the value of the sample, the results are valid.
The maximum tolerable tainting for MUS: because dollar amounts may be only
partially in error, the amount of error for a particular item is referred to as the error
tainting. For example, a $100 item that is totally in error has a 100% tainting,
whereas a $100 item that actually should have a value of $93 has a 7% tainting. The
maximum tolerable tainting is the sum of all the individual error taintings. As long as
this sum is less than the reported value of the sample size, the results are valid.
The Size command automatically creates SAMPSIZE and SAMPINT variables that
contain the reported sample size and interval, respectively. Use these variables to create
batches that automatically supply parameters to a subsequent Sample command.
When errors and taintings are found, use the Evaluate command to determine their
effect.
Sample Sizes
The Size command generates attribute sample sizes. It is not intended to generate sample
size for variable sampling or estimation sampling.
The Size command produces statistically valid attribute sample sizes for most analyses,
unless:
You are sampling very small populations.
Your organization has in-house sampling experts. They will be able to define
sample sizes precisely tailored to your needs.
Your organization has mandated the use of another sampling tool or method-
ology.
Chapter 4 Commands 315
Size
ACL generates sample sizes using the Poisson distribution, rather than the binomial
distribution. The advantage of the Poisson distribution is that it:
Does not require you to know the population size before you generate a sample
size.
Simplifies the calculations required to produce sample sizes and to evaluate
sample errors detected.
The Poisson distribution is widely used for calculating sample sizes. It is easier to work
with than the binomial distribution, and Poisson distribution tables are readily available
when you need to check the calculations.
For record samples the Poisson distribution generates the same sample size, regardless
of the size of the population. For typical population sizes of a thousand or more records,
the two distributions generate nearly identical sample sizes. For populations of under a
thousand records, sample sizes determined with the Poisson ratio tend to be slightly
larger and therefore more conservative than sizes determined with the binomial distri-
bution. This is because the binomial distribution adjusts the sample size downward for
small populations but the Poisson distribution does not. With very small populations,
the fixed sample size generated by the Poisson distribution can actually exceed the
population size.
When using Size for record sampling of small populations, recognize that the sample
size may be larger than you need. This does not present an obstacle to analysis since it is
common practice to manually over-test small populations.
To obtain record sample sizes that do not differ significantly from those obtained using
the binomial distribution, do not use the Size command when the sample size generated
is greater than ten percent of the population.
Parameters
In addition to the parameters described below, the Size command has the following
parameters: File, File Type, Footer, Header, Local, Name, Screen. For a description of
these parameters, see Chapter 3: “Common Command Parameters”.
Materiality
Specify the amount of money considered significant. This is the maximum amount of
error you are willing to accept in the population without detection.
Monetary
Indicates that a monetary unit sample (MUS) is to be taken. The likelihood that an item
is selected is proportional to its size.
Use fixed interval sampling if you intend to use the Evaluate command later to evaluate
any errors.
Population
Specify the absolute value of the field being sampled.
Population
Specify the record count.
Record
Indicates that the sample is an unbiased record sample. The likelihood that an item is
selected is unrelated to its size. Each record has an equal chance of selection.
Example 1
To determine the sample size required to have 95% confidence that the total errors in a
population of 40,000 do not exceed 5% (2,000 errors), assuming that there are no errors
in the population:
You need to draw a sample of 60 items. Because the number of tolerable errors is zero, if
any errors are encountered, your hypothesis is not supported with 95% confidence. If
you choose to draw the above sample using an interval selection method, an interval of
666.66 is appropriate.
Example 2
To determine the sample size required to have 95% confidence that the total errors in a
population of 40,000 do not exceed 5% (2,000 errors), assuming that there are 2% errors
in the population (800 errors):
320 ACL for Windows 7 Reference Manual
Size
You need to draw a sample of 184 items. Because there are four tolerable errors, as long
as there are four or fewer errors in the sample, your hypothesis is supported with a 95%
confidence. If you choose to draw the above sample using an interval selection method,
an interval of 217.39 is appropriate.
Note: The sample size in this example is significantly larger than the size in Example 1.
This allows for errors you would expect to detect.
Example 3
To determine the sample size required to have 90% confidence that the total errors in a
population of $60 million do not exceed $1 million, assuming that there are no errors in
the population:
You need to draw a sample of 138 items. Because there are no expected errors, if any
errors are encountered, your hypothesis is not supported with 90% confidence. If you
choose to draw the above sample using an interval selection method, an interval of
$432,900.43 is appropriate.
Chapter 4 Commands 321
Size
Example 4
To determine the sample size required to have 90% confidence that the total errors in a
population of $60 million do not exceed $1 million, assuming that there are $50,000
errors in the population:
You need to draw a sample of 150 items. Because there are $50,000 in expected errors,
some amount of error in the resulting sample can be tolerated. As long as the total
taintings do not exceed 12.54%, your hypothesis is supported with 90% confidence. If
you choose to draw this sample using an interval selection method, an interval of
$398,701.29 is appropriate.
The following possible taintings and their evaluation are related to Example 4:
A $950 item recorded as a $1,000 item implies 5% tainting (50/1,000), and is
therefore acceptable.
Given the above error and another in which a $15,000 item was recorded as
$14,000 (6.66% tainting; 1,000/15,000), the results are still acceptable because
the total taintings are only 11.66%.
Given the above two errors and another in which a $100 item was recorded as $98
(2% tainting), the sample may be insufficient to prove your hypothesis because
the total tainting is 13.66% (greater than 12.54%). Use the Evaluate command to
confirm the effect of the errors.
Given a single error in the population in which a $100 item was recorded at $80
(20% tainting), the sample is probably insufficient to prove your hypothesis.
322 ACL for Windows 7 Reference Manual
Size
Because the error was found in one item, you can assume with certainty that the
sample is insufficient.
Note: Whenever there are errors in your sample, you can use the Evaluate command to
determine the impact of the errors on your results. You can also use Evaluate to determine
%
if a given monetary sample is appropriate.
Sort
Use the Sort command to sort the current input file in ascending or descending order
based on specified key fields. Sort creates a new file that has been physically reorganized.
Sort works on both fixed-length and variable-length data files.
Sorting Indexing
To use the Data Relations command, and the Find Literal and Seek Expression options
of the Search command, you must use a file that has been indexed rather than sorted.
The Sort command sorts the input file in ascending order according to the key fields you
specify, unless you specify descending order. The ascending and descending sort order
specifications are specific only to a particular field and can be mixed in one Sort
command (for example, account number ascending, transaction amount descending).
If you choose to sort on more than one key field, you must select the key fields in the
order in which you want the sorting to occur (for example, enter the primary key field
first, the secondary key field second, and so on). The Sort command sorts on any
number of key fields as long as the combined length of the fields being sorted does not
exceed 255 characters.
Any type of field, including computed fields and ad hoc expressions, can be used for
sorting, and the various field types may be freely intermixed. Logical fields are sorted on
324 ACL for Windows 7 Reference Manual
Sort
false before true, and numeric fields or expressions in sequence from the most negative
through to the most positive field value.
Note: Sorting files that contain static and/or conditional static fields may yield unpre-
dictable results.
Note: When processing server files that contain related files, record output will be changed
to All fields output if you specify the local option or keyword.
Including the optional If, While, First, and Next parameters causes a subset of the
current input file to be sorted into the output file.
Sorted records of the same key value retain the same relative position in the output file.
For example, in an ascending sort, the records of ABC company maintain their original
order relative to each other, but are moved as a group above the records of BCD
company.
Note: If you are connected to an OS/390 server, ACL sends the error message “Check %s
for System Sort messages” to the command log when a system sort on the server is unsuc-
cessful. It is important to relay the contents of this message to your technical support staff. If
they are unable to resolve the problem, contact ACL Technical Support. See “Help” on
page 207.
Parameters
In addition to the parameters described below, the Sort command has the following
parameters: All, Append, Ascending, Descending, First, If, Local, Next, To, Use Output
File, While. For a description of these parameters, see Chapter 3: “Common Command
Parameters”.
Sort On
Specifies which input file key fields or expressions to use for sorting. Select the fields
from the list view, or click [Sort On] to display the Selected Fields dialog box, in which
Chapter 4 Commands 325
Sort
you can choose to sort in ascending or descending order. For more information, see
“Selection/Edit Dialog Boxes” on page 37 of the ACL for Windows User Guide.
Example
In this example, you sort an inventory file on a key field. The unsorted inventory file
looks like this:
326 ACL for Windows 7 Reference Manual
Sort
3. Enter Sort_product_class in the To text box, then click [OK] to execute the
command and view the results. The view shows the product class field sorted in
ascending order.
Chapter 4 Commands 327
%
Sort
Statistics
Use the Statistics command to calculate descriptive statistics on numeric fields in the
current input file.
Statistics is frequently used to get an overview of an input file before detailed processing.
It can quickly highlight abnormalities in the input file, which can then establish a
direction for your subsequent approach or analysis.
Statistics provides the following information for numeric fields:
Record counts, field totals, and average field values for positive field values
(debits), nil field values, negative field values (credits), all records in the file
Absolute value
Range (the difference between the minimum and maximum values)
Standard deviation of the fields
Highest field values
Lowest field values
As well as displaying the statistical information above, ACL stores a number of values in
special variables. See “Command-Created Variables” on page 312 of the ACL for
Windows User Guide for details.
This command can be Autoexecuted. For more information, on the Autoexecute
Commands preference, see “Command Options” on page 288 of the ACL for Windows
User Guide.
Parameters
In addition to the parameters described below, the Statistics command has the following
parameters: All, File, File Type, First, Footer, Graph, Header, If, Local, Name, Next,
Print, Screen, While. For a description of these parameters, see Chapter 3: “Common
Command Parameters”.
# of High/Low
Specifies the number of high and low values to retain during processing. Default: 5.
Std. Deviation
Turn this option on to calculate the standard deviation of the fields specified, in addition
to the other statistics.
Chapter 4 Commands 329
Statistics
Statistics On
Specifies the numeric fields or expressions for which statistics will be provided. Select
the fields from the list box, or click [Statistics On] to display the Selected Fields dialog
box. For more information, see “Selection/Edit Dialog Boxes” on page 37 of the ACL for
&
Windows User Guide.
Example
The object is to obtain statistics on multiple fields with a specified condition and display
the variables created.
To get a statistical overview of inventory at Location 3, one of a company’s several
inventory locations, use Statistics. Data analysts might want statistics on the quantity on
hand, recorded value, and market value before attending a physical count at the
location. Management may want to search for unusual items, such as negative quantities
on hand, that may indicate a system control problem.
Select the quantity on hand, recorded value, and market value fields from the list box.
Specify in the [If] text box that you want statistics for Location 3 only.
330 ACL for Windows 7 Reference Manual
Statistics
You would want to investigate the negative total in QTYOH (quantity on hand) as it
might indicate a system problem. The highest five items constitute a significant
proportion of the total value, and should therefore be verified at a physical count. Also,
market value in total exceeds recorded cost.
The variables created by the Statistics command are often used to control the execution
of batches.
You can display the variables automatically created by this command through the Edit
Variables dialog box. To do this, choose Edit from the menu bar and select Variables.
You can also use the Display command in command mode to display the variables
created by this command. To do this, enter the following into the command log text box:
DISPLAY VARIABLES
ACL displays the result in the command log.
For details, see “Variables” on page 311 of the ACL for Windows User Guide.
332 ACL for Windows 7 Reference Manual
%
Statistics
Stratify
Use the Stratify command to count the number of records falling into specified intervals
(strata) of numeric field or expression values, as well as to accumulate one or more fields
for each stratum. The record count for each stratum is listed in a COUNT column in the
command log.
Stratify works on unsorted files and is particularly useful for quick scanning and
summarizing. Stratify allows you to count the number of records that fall into a specified
number of even intervals, providing totals by stratum for selected numeric fields. Alter-
natively you can specify the start points for the intervals, using the Free option to create
custom intervals of any size.
This command can be autoexecuted. For more information see “Autoexecute
Commands” on page 288 of the ACL for Windows User Guide.
Parameters
In addition to the parameters described below, the Stratify command has the following
parameters: All, Append, Break, File, File Type, First, Footer, Graph, Header, If, Local,
Name, Next, Print, Screen, Suppress, Use Output File, While. For a description of these
parameters, see Chapter 3: “Common Command Parameters”.
Accumulate Fields
Specifies the numeric fields or expressions for which ACL supplies totals by stratum.
Select fields from the list box or click [Accumulate Fields] to display the Selected Fields
dialog box.
For more information on the Selected Fields dialog box, see “List Views” on page 40 of
the ACL for Windows User Guide.
Free
Allows you to specify the start point of each interval and the end point of the last
interval. Enter these values in the Free text box, one per line.
Intervals
Specifies the number of even intervals ACL produces over the range Minimum to
Maximum. The default is 10, but you can change it in the Edit ACL Preferences dialog
box. See “Intervals” on page 289 of the ACL for Windows User Guide.
334 ACL for Windows 7 Reference Manual
Stratify
Maximum
Specifies the maximum value of the last stratification interval. If you previously issued a
Profile or Statistics command, the highest value in the field appears by default. If you
specified free intervals, the highest value specified appears by default.
Minimum
Specifies the minimum value of the first stratification interval. If you previously issued a
Profile or Statistics command, the lowest value in the stratified field appears by default.
Stratify On
Specifies the numeric field or expression to be stratified. Select the field from the
&
drop-down list or click [Stratify On] to display the Selected Fields dialog box.
Example 1
In this example, you produce even interval stratifications.
A stratified analysis of an accounts receivable file shows whether the file contains a few
large or several smaller value items. This information can help management to develop
appropriate collection procedures.
Chapter 4 Commands 335
Stratify
Before using Stratify on this kind of file, it is useful to use two other ACL commands
first:
1. Summarize. An accounts receivable file contains numerous individual transactions,
but you want account balances. You can obtain customer account balances using the
Summarize command. Summarize the file on the customer number field and
accumulate the transaction amount field. Use the Presort option with the
Summarize command.
2. Statistics or Profile. Use either command to analyze the transaction amount field to
automatically give ACL the minimum and maximum values encountered in the
amount field. This information is needed by the Stratify command.
3. Now stratify the file of balances by transaction amount and accumulate the trans-
action amount field. Accept the defaults for the minimum and maximum range
values, assuming you previously issued a Profile or Statistics command. Accept 10 as
the number of intervals.
ACL displays the result in the command log. Although 46.89% of customers owe less
than 983.10 each, this stratum accounts for 42.90% of the total balance of accounts
receivable.
336 ACL for Windows 7 Reference Manual
Stratify
Example 2
In this example, you produce free interval stratifications.
Free interval stratification allows you to obtain a further breakdown of the stratum from
Example 1 containing 46.89% of customers.
Select [Free] then specify 0, 100, 250, 500, 750 as your interval start points, and 1000 as
the end point.
Chapter 4 Commands 337
Stratify
Command Output
The command log output has columns for the strata intervals, the number of records in
each interval, and the percent of the total records that each interval represents. If one or
more fields were accumulated, additional columns are displayed: another percent
column and the accumulated field totals for each interval.
Each percent column points to the column it represents. The right-hand percent column
points to the nearest accumulated field column, and shows the percent of the total value
that the value of this interval represents. Percentages are not provided for additional
accumulated field columns.
You can send the command output to a graph. Click the [Output] tab and select the
Graph option in the dialog box, or double-click the command’s output or the
<<<Graphable Data>>> statement in the command log. For more information, see
“Graph Output” on page 235 of the ACL for Windows User Guide.
You can also write the command output to a file. Click the [Output] tab and select the
File option, then select the file type from the drop-down list.
338 ACL for Windows 7 Reference Manual
%
Stratify
Summarize
Use the Summarize command to generate a record count and numeric field value totals
for each distinct value of key character fields in a sorted file.
Summarize allows you to accumulate totals of numeric fields for each distinct value of
the key character fields. The number of records belonging to each distinct value is
displayed in an ACL generated field named COUNT. The number of distinct character
field values that can be summarized is almost limitless.
Because it can report on a limitless number of unique key character field values,
Summarize is most effective for large input files. Summarize requires a sorted file on the
key character fields, so you must either sort the file first or check the Presort check box.
For small or medium-sized unsorted files, Classify is an effective command for summa-
rizing data. For more information, see “Classify” on page 135.
Summarize lets you select “Other Fields...”, character or numeric fields to be included in
your output. The first “Other” field value encountered in the sorted input file belonging
to a given summarized group is output to the summarized file as the “Other” field value
for that group. You may want to include an “Other” field in the summarized file if that
field’s value is constant over the entire summarized group. For example, if you summa-
rized based on customer number (a character field), you may want to specify the
customer name as the “Other” field, because there is a one-to-one relationship between
customer number and customer name. You can create a new input file with Summarize
and use the file for further analysis and reporting with ACL.
Note: You can use Summarize to remove duplicate records from a file. To do this, specify
the character field on which to summarize, do not accumulate any fields, select Other Fields
and then select Add All, and send the output to a file. The output file will contain unique
records only.
Prerequisites
This command requires that all files be presorted on the key character fields in the
intended summarizing sequence. If not already sorted, you can either sort or index the
file or check the Presort check box.
Note: Ensure that the Presort check box is disabled when using an index file.
340 ACL for Windows 7 Reference Manual
Summarize
Parameters
In addition to the parameters described below, the Summarize command has the
following parameters: All, Append, File, File Type, First, Footer, Graph, Header, If,
Local, Name, Next, Print, Screen, Use Output File, While. For a description of these
parameters, see Chapter 3: “Common Command Parameters”.
Accumulate Fields
Specifies the numeric fields or expressions to be totalled by ACL for each distinct key
character field value. Select the fields from the list box or click [Accumulate Fields] to
display the Selected Fields dialog box.
Other Fields
Indicates the additional fields or expressions to be included in the summarized records.
The value output to the summarized file is selected from the first record belonging to
each summarized group encountered in the sorted input file. Select the fields from the
list box or click [Other Fields] to display the Selected Fields dialog box.
For more information on the Selected Fields dialog box, see “Selection/Edit Dialog
Boxes” on page 37 of the ACL for Windows User Guide.
Fields already selected from the Summarize On and Accumulate Fields list boxes need
not be selected here again.
Summarize On
Indicates the character fields or expressions to be summarized. Select the fields from the
list box or click [Summarize On] to display the Selected Fields dialog box.
Chapter 4 Commands 341
Summarize
Example
You summarize on two fields in this example. To summarize inventory by location, and
within each location by product class, use Summarize. Data Analysts might do this to
focus their testing procedures, and management in order to better manage stock.
In the [Summarize On] list box, select the location field first, then the product class field.
Accumulate quantity on hand, recorded value, and market value fields in the
[Accumulate Fields] list box. If your input file is not sorted, check the Presort check box.
Click the [Output] tab and send the output to a file named Summarize_sort_location.
%
Summarize
Note: You cannot use the presort keyword in a command group running in batch mode.
344 ACL for Windows 7 Reference Manual
Tape
Tape
Use the Tape command to skip to a particular file on a tape containing data from a
mainframe or minicomputer. You can also use the command to rewind a tape.
This command can be issued only in command mode.
Files on tape are organized consecutively, and each file is separated by an empty space
known as a file mark. Two consecutive file marks indicate the end of data on that tape.
When the tape is rewound, ACL automatically positions the drive to the first file on the
tape. But with the Tape command you can move forward to another file or you can move
backward to rewind the tape. The way you move to another file depends on whether
your tape is unlabeled or labeled.
You must calculate the number of file marks to skip. The formula that you use differs
according to whether your tape is unlabeled or labeled.
Unlabeled tape contains sequential blocks of data.
Labeled tape contains an extra block of data called a label before and after each data
block.
To move to a file other than the first one on an unlabeled or labeled tape:
Calculate the number of file marks that you want to skip.
Use the calculated amount in the Tape command.
Parameters
Skip
Specifies that the tape skips to a particular file or data block.
Chapter 4 Commands 345
%
Tape
TAPE SKIP 2
ACL skips two file marks, taking you to the third block of data.
Top
Use the Top command to move to the first record in the current input file.
This command can be issued only in command mode. For more information, see
“Issuing Commands” on page 238 of the ACL for Windows User Guide.
This command is useful after a Next or While scope parameter has positioned the file at
%
a different record, or after having located a specific record using the Search command.
Total
Use the Total command to total numeric fields or expressions in the current input file.
Total is typically used to prove the completeness and accuracy of the data and to produce
control totals.
Total finds the arithmetic sum of the fields or expressions specified. As well as displaying
the totals requested, this command saves the result in a special variable, TOTALn. n is
normally “1”, but adopts the sequential command number when Total is issued in a
group, for example, TOTAL17. See “Command-Created Variables” on page 312 of the
ACL for Windows User Guide for details.
This command can be autoexecuted. For more information on the Autoexecute
Commands preference, see “Command Options” on page 288 of the ACL for Windows
User Guide for details.
Parameters
In addition to the parameters described below, the Total command has the following
parameters: All, First, If, Next, While. For a description of these parameters, see
Chapter 3: “Common Command Parameters”.
Total Fields
Displays only the numeric fields or expressions defined in the input file. Select the fields
to be totalled from the list box or click [Total Fields] to display the Selected Fields dialog
box. For more information, see “Selection/Edit Dialog Boxes” on page 37 of the ACL for
&
Windows User Guide.
Example 1
This example totals a value field to determine the total inventory value for reconciliation
with accounting records. Select the recorded Value field from the Total Fields list box.
Example 2
This example totals records that meet a specified condition.
To total a market value field and an inventory value field for a given product class, use
Total. Often a class of products declines in market value due to economic or techno-
logical change. To ensure that the recorded value is always less than or equal to the
market value, you may want to compare these two totals for a product class.
Select the market value and inventory value fields from the list box. In the [If] text box,
enter an expression that limits your analysis to product class 8:
ACL displays the result in the command log. The market value (MKTVAL) is greater
than the inventory cost (VALUE), so there is no apparent overstatement of the cost of
class 8 inventory. To perform this same analysis on a more detailed level, you can alter
the If test as appropriate.
Verify
Use the Verify command to check for data validity errors in the current input file.
Verify is often one of the first commands used when dealing with a new input file. Verify
ensures that data in a file conforms to the input file definitions and reports on any errors
encountered.
The Verify command uses the input file definition description to check the specified
fields for data validity errors. All defined fields may be analyzed to ensure that the data
is consistent with the specified field type. For example, Verify checks that only character
data is in character fields and numeric data in numeric fields.
Character fields are checked for unprintable characters and numeric fields are checked
for improper numeric characters. For example, Verify checks for more than one
preceding ‘+’ or ‘-’ sign or more than one decimal point.
You can choose to have Verify stop execution whenever it encounters invalid data, or
continue processing and replace invalid data with blanks.
For more information, see “View Options” on page 286 of the ACL for Windows User
Guide.
You can also choose to have ACL verify all existing fields every time you use an input file
by turning on the Verify Data option. To turn this option on, select Edit from the menu
bar and choose Preferences. Click the [Numeric Options] tab and turn on Verify Data.
Turning this option on slightly slows down ACL as first verifies the data.
Note: To test for valid data in a computed field, use the VERIFY( ) function, then take
appropriate action.
Parameters
In addition to the parameters described below, the Verify command has the following
parameters: All, Append, File, File Type, First, Footer, Graph, Header, If, Local, Name,
Next, Print, Screen, While. For a description of these parameters, see Chapter 3:
“Common Command Parameters”.
Chapter 4 Commands 351
Verify
Error Limit
Specifies the number of errors allowed before the command is terminated.
Default: 10. To change the default setting, select Edit from the menu bar and choose
Preferences. Click the [Command Options] tab and increase or decrease the number in
the Error Limit text box.
Verify Fields
Specifies the input file fields or expressions to be verified. Select the fields from the list
box, or click [Verify Fields] to display the Selected Fields dialog box.
Although you can check for their validity, computed fields, along with ad hoc expres-
sions and binary fields, are by definition always valid.
For more information, see “Selection/Edit Dialog Boxes” on page 37 of the ACL for
&
Windows User Guide.
Example
This example verifies all fields in the file.
352 ACL for Windows 7 Reference Manual
Verify
To verify the validity of data in reference to the input file definition, use Verify. If you are
unsure about the integrity of the data, you should always run the Verify command before
detailed processing of any input file.
Select all of the fields in the list box and accept the default Error Limit of 10.
ACL displays the location of invalid data and, below, its hexadecimal representation.
You can use the Dump command to review the contents of each invalid record. See
“Dump” on page 173 for details.
Chapter 4 Commands 353
%
Verify
ACL for Windows lets you use ACL for OS/390 format files, batches, and reports.
However, you must first convert the files in one of two ways:
Use the ACL Conversion Utility to batch convert many files at once
Use the Import from ACL for OS/390 option in ACL for Windows to convert and
import only those ACL for OS/390 files you require
This chapter explains how to convert and use ACL for OS/390 files using the ACL
Conversion Utility.
355
356 ACL for Windows 7 Reference Manual
Converting from OS/390 to Windows
3. Locate the directory that contains the files you want to convert. Create the new
Project in the directory that contains the files you are converting.
4. In the File name text box, enter a name for the Project in which ACL will place the
converted files and click [Save].
ACL displays the Convert window and scans the directory for format, report, and
batch files.
When the scanning is complete, ACL displays the Convert dialog box with all items
preselected. To accept all items, click [OK].
If you want to select only some of the items displayed in the Convert dialog box, use
the Import from OS/390 button in the Overview window.
Reports to be converted to views
Format files to be
converted to input Batches to be
file definitions converted
Workspaces to
be converted
5. When the conversion is complete, review the information in the Conversion Status
window. Look for error and information messages, referring to the section
“Conversion Messages” below because some messages may require action.
Appendix A Using the ACL Utility 357
Converting from OS/390 to Windows
Conversion Messages
The Conversion Status window may display any of the following types of messages
during conversion:
Informational messages indicate the status and current operation of the utility.
Error messages indicate problems that the utility has found, but which are not
serious enough to prevent it from continuing.
Fatal error messages indicate that the conversion was prevented from continuing.
Although the utility saves the work done to that point, the work may not be
usable.
Informational Messages
Processing Batches
Indicates that the utility is currently processing all the batch files (*.bat) that it finds in
the selected directory.
Processing Formats
Indicates that the utility is processing format files (*.fmt). The utility links any files that
were used in batches. If a format was not used in a batch, the utility assumes a data file of
the same name, but with an FIL extension.
Report Format
Lists the report files and formats used.
Processing Workspaces
Indicates that the utility is processing workspace files (*.wsp).
358 ACL for Windows 7 Reference Manual
Converting from OS/390 to Windows
Error Messages
<filename> truncated to <n> characters
Indicates that while processing batch files, an OPEN command was found with a file
name that exceeded the maximum allowable length of eight characters.
To expand the list of batches, input file definitions, views, or workspaces in your Project,
click beside the appropriate icon.
To collapse the list, click . The currently open items are listed in bold text.
To open any of the views, input file definitions, workspaces, or indexes, you simply
double click its icon or name, or drag and drop it on the application workspace. Batches
can be run or edited in the same way.
Batches
Converted batch files appear in the Overview window’s list of batches.
Note: You should review and run batches before you use them for production. Converted
batches may not run in ACL for Windows for various reasons. Look for messages indicating
commands that are not supported.
360 ACL for Windows 7 Reference Manual
Using Converted OS/390 Files
For example, the Extract command no longer requires a condition. If you have a batch
that includes the Extract command, you may need to edit it before it will run.
Format Files
Converted format files become input file definitions and are stored as part of the Project.
ACL does not store data files as part of the Project. Rather, when you open an input file
definition, ACL automatically links you to the appropriate data file.
For more information on the relationship between data files and input file definitions,
see “ACL Project Files” on page 68 of the ACL for Windows User Guide and of the ACL for
Windows User Guide.
Most of your input file definitions are linked to the data file as part of the conversion and
importing process. Sometimes, however, ACL is unable to make the link. For example, a
format file not referred to in a batch and named differently than its data file will not be
linked. ACL prompts you to locate the data file the first time you select the input file for
use. From that time forward, the link is automatic.
Reports
Because reports are based on views, converted reports appear in the new Project as
views.
ACL displays all converted reports (views) in the Overview window under “Views.”
Reports that were referred to in a batch have the name of their corresponding input file
displayed in square brackets following the report name. All other converted reports have
the word “unknown” in the square brackets, because ACL cannot link them to a specific
data file.
1. To access those reports that have an unknown input file definition, either:
In the Overview window, double click the name of the input file definition to
which the report applies, or
Select Data from the menu bar and choose Select. ACL displays the Select Input
File Definition dialog box. Select the appropriate input file and click [OK].
2. Double click the name of the report you want to link.
ACL displays the report and automatically links it to the currently open input file
definition. The report appears in the Overview window located under its associated
input file.
Delete the old report with the “unknown” input file.
Appendix B W ORKING W ITH T APE
Magnetic tape is an important way to access and read data generated on a mainframe or
minicomputer.
You can use ACL to access and read data from tape reels or cartridges. It’s as easy as
reading data from a disk drive, although the tape drive hardware can be quite expensive,
depending on your needs.
All you need to work with tape is a tape drive that is compatible with your computer, a
device driver, a controller card, and a connecting cable that ACL supports. You do not
need separate downloading software or large amounts of disk space to store the data,
because the data remains on tape.
You can read data files stored on more than one tape reel or cartridge, or more than one
file of the same type stored on a single tape.
This section includes:
An overview of the components that make up a tape drive system
A description of the organization of data on tapes
Step-by-step instructions you can follow to read data from tape
Troubleshooting tips
Note: If you used ACL for OS/390 to access data on tape, you may already be familiar with
many of the operations described in this chapter.
361
362 ACL for Windows 7 Reference Manual
Acquiring a Tape Drive System
Tape Drive
ACL can read data directly from almost all tape formats, including:
1/2-inch 9-track tapes
IBM 3480 cartridges
8 mm tapes
4 mm DAT tapes
If you need to read data from 1/4-inch tapes, contact ACL Technical Support for assis-
tance.
Your tape drive must conform to SCSI, a parallel interface standard, pronounced
“scuzzy,” to be compatible with ACL.
The speed at which you can access data on tape depends on the speed of your tape drive.
Note: You can connect more than one tape drive to your computer. If you do, make sure
you only turn on the drive from which you want to read. When you connect and run
multiple tape drives, ACL only accesses the first designated drive on the SCSI chain.
Device Driver
The device driver acts as a translator between ACL and the controller card. The
controller card cannot understand ACL commands without the intervention of the
device driver.
For the 16-bit version of ACL, you require a DOS ASPI driver and for the 32-bit version,
you require a WINASPI driver.
Appendix B Working With Tape 363
Before You Begin
Controller Card
The controller card inside your computer acts as a liaison between the computer and the
tape drive. The card, in conjunction with the device driver, controls the flow of data
from the tape drive.
You can use any SCSI card that has ASPI compatible drivers.
Tape Utilities
Controller cards usually include utilities that help you perform standard tape functions,
such as:
positioning tape
transferring disk-based data to tape and tape-based data to disk
dumping tape to the screen or printer
If you do not have utility software, contact your hardware vendor for assistance.
Connecting Cable
The cable connects the tape drive to the computer. To use ACL with tape, you must use
a SCSI-compatible cable.
Unlabeled Tape
An unlabeled tape is organized into consecutive data files separated by file marks. The
dark rectangles shown below represent file marks.
To access a file other than the first one, specify the file number minus one because ACL
automatically positions the drive at the start of the first file.
Labeled Tape
A labeled tape contains an extra block of data called a “label” before and after each file.
The label provides information about the data file and how the file was recorded.
If you want to access a file other than the first one on a labeled tape, you can use the
formula 3(d-1)+1 to calculate the number of data blocks to skip, where n is the number
of the file you want to access. For example, if you want to access the fifth file on a labeled
tape, enter TAPE SKIP 13 in the command log.
Positioning Tape
Before you can access a file on tape, you must position the tape at the start of the file.
A rewound tape is already correctly positioned for reading the first file because ACL
automatically accesses the first file on unlabeled and labeled tapes.
Appendix B Working With Tape 365
How Data is Organized on Tape
If you want to access a file other than the first file on the tape, you must know whether
you are working with an unlabeled or labeled tape, and use the ACL tape command to
position the tape correctly:
1. Select Window from the menu bar and choose Open Command Log.
ACL displays the command log.
2. Issue the Tape command in one of the following ways:
To position an unlabeled tape, specify the number of files to skip to reach the file
you want to access.
ACL automatically positions the drive at the start of the first file on the tape.
Subtract this file number from the file number you want to access. For example,
if you want to access file five on an unlabeled tape, enter TAPE SKIP 4 in the
text box of the command log.
To position a labeled tape, specify the number of file marks to skip over in the file
you want to access using the formula 3(d-1)+1. See “Labeled Tape” on page 364.
Rewinding Tape
If you are not sure whether your tape is positioned at the beginning of the file you want
to access, specify a negative amount such as TAPE SKIP -10 in the text box of the
command log.
Specifying a large negative number, such as -10, causes ACL to rewind the tape
completely. The minus sign tells ACL to move the tape backward. If you are working
%
with a tape that contains a very large number of files, you may have to rewind more than
10 file marks.
%
Working with Tape Files
You must cancel the SET ACCELERATE command to return to the regular rewind
speed. To cancel SET ACCELERATE, enter:
SET ACCELERATE 100
Note: You cannot use (Link to New Data File) in the Overview window or the [Link
Data File] button in the Select Input File Definition dialog box because this option only
allows you to link to files on disk or on a server.
proceed to define the input file in the same way as you would for disk-based files. See
“Defining Data with the Wizard” on page 116 of the ACL for Windows User Guide.
Note: If you do not have a tape in the tape drive or if the tape is not connected properly to
your computer, ACL displays an error message reminding you to check both of these items.
Troubleshooting Tape
If you are having problems getting ACL to work with your tape drive, check the
following:
Is the ACL hardware key plugged into the parallel port of your computer?
Is your SCSI tape deck properly terminated?
Using SCSI, you can link together up to seven devices. If your tape drive is the last
device in the SCSI chain, it must be terminated using a SCSI terminator.
Have you checked for IRQ/DMA hardware conflicts?
Your computer has a limited number of IRQ and DMA channels for the
expansion cards, such as video cards, that you have installed in it. Check to make
sure that the SCSI card you installed is not conflicting with any of your other
expansion cards.
If you followed these troubleshooting procedures and are still having trouble reading
tape with ACL, contact ACL Technical Support.
Appendix C G LOSSARY
This section contains an alphabetical list of ACL terms and their meanings. More infor-
mation on each term, along with practical examples of its use in ACL, is included in the
appropriate sections of the User Guide.
ABSn Variable
A special ACL variable created automatically by specific ACL commands, such as the
Statistics command, that contains the absolute value of the field on which that command
was last issued.
ACL Project
A file that contains all ACL file definitions (views, reports, workspaces, and batches).
The file containing the data to be analyzed is not part of the Project, but is linked to the
Project by way of the input file definition.
The Project file name uses the extension.ACL. Temporary Projects use the
extension.ACL.
See also “Input File Definition” on page 375.
Ad Hoc Fields/Expressions
An unnamed field or expression used for temporary calculations and not saved as part
of an input file definition.
See also “Expression” on page 372.
Age
The number of days between two specified dates. You can calculate the age of a trans-
action by subtracting one date from another date.
Application Workspace
Where you do your work in ACL. The area where ACL windows and dialog boxes are
displayed.
Append
A process of adding the output records from a command file to the end of an existing
file. Append can be used to replace merge in many situations.
See also “Merging” on page 377.
369
370 ACL for Windows 7 Reference Manual
Argument
An expression or field value of any type, used in a test.
ASCII
An acronym for American Standard Code for Information Interchange. ASCII is the
most common character set used to facilitate data exchange and communication
between microcomputers.
See also “EBCDIC” on page 372.
AVERAGEn
A special ACL variable created automatically by specific ACL commands, such as the
STATISTICS command, that contains the average value of the field on which that
command was last issued.
Batch
A series of ACL commands named and stored in a Project. You can design a batch to
execute repeatedly and automatically, or to prompt the user for information.
Bucketed File
In ACL, a file whose records contain repeated blocks of similarly sized and structured
fields. Each block is called a “bucket”.
Buffer
Temporary storage space for data being transmitted from one computer component to
another. A buffer compensates for the differences in speed at which the components can
process data being routed to them.
Character
A letter, digit, or other symbol used to represent data. Character data is normally used to
represent text strings or date information.
Character String
A sequence of characters.
Command Log
An electronic log that records each command you issue and its results, from the time you
open an ACL Project until you close the Project. The information in the log is
cumulative. You can view, add comments to, print, or clear the log.
Appendix C Glossary 371
Computed Field
A named algebraic expression that uses calculation results or an ACL command to
create additional data.
A computed field exists only in the input file definition and is not actually a part of the
data file. It is a virtual field that lets you perform calculations based on information in
the data file without affecting or changing the original data. You can treat a computed
field like an actual physical field.
See also “Physical Field” on page 378.
Condition
A test that returns a true or false value.
Conditional Field
A field whose value depends on a condition.
See also “Conditional Computed Fields” on page 145 and “Static Conditional Fields” on
page 157 of the ACL for Windows User Guide.
Constants
Any date, numeric, string, or logical value that does not change as ACL processes a
record.
COUNTn
A special ACL variable created automatically by specific ACL commands, such as the
STATISTICS command. COUNTn contains the number of records in the file, on which
that command was last issued.
CR File
A file in which the end of a record is indicated by a carriage return (CR). This is the
standard means of separating line files on Macintosh-compatible computers.
CR/LF File
A variable record length file in which the end of a record is indicated by a carriage return
(CR) and a line feed (LF) character.
Data File
A file in which computer-based data is stored. Also called a source file. The data file is
not actually stored as part of an ACL Project, but rather is linked to the Project by way of
the input file definition. ACL does not alter the data file in any way.
Data Types
See “Field Types” on page 373.
372 ACL for Windows 7 Reference Manual
Default View
A view that displays defined data fields in the order in which they appear in the data file.
The user has the option of changing the order in the Default View. However, if the
changes are saved, the modified view will be the default view the next time the Project is
opened.
Delimited File
Files in which each field in a record is separated from the others by a field separator
character. The fields do not have a fixed position.
There are two major conventions for delimited files: CSVs (Comma Separated Values)
and TSVs (Tab Separated Values). In both cases, a carriage return (CR) and a line feed
(LF) usually separates each record in the file.
EBCDIC
An acronym of Extended Binary Coded Decimal Interchange Code. A character set
used mainly by IBM mini and mainframe computers as opposed to the ASCII character
set used by most microcomputers.
See also “ASCII” on page 370.
ELSE
An ACL command you can use in a Group of commands to provide an alternative
processing method if all previous tests are false. ELSE can only be used in a Group, never
on its own.
END
An ACL command that closes or finalizes a Group of commands. END can only be used
in a Group, never on its own.
End of File
Abbreviated as EOF. Indicates the end of a set of data. As a parameter, EOF causes the
command to be executed one additional time after the end of file has been reached.
Expression
A set of operators and values ‘used to perform calculations, specify conditions for a test,
or to create values that do not exist directly in the data. An ACL expression can be a
combination of data fields or computed fields, operators, constants, functions, and
variables. Named expressions are saved as part of the input file definition, and conse-
quently as part of the Project. Ad hoc, unnamed expressions can only be used for a
single calculation and are not saved as part of the input file definition.
Appendix C Glossary 373
See also “Computed Field” on page 371, “Extract” on page 373, “Filter” on page 373,
“Global Filter” on page 374, and “Local Filter” on page 376.
Extract
The process of creating a subset of a file that contains some or all of the records or fields
in an input file.
Field
The individual pieces of information that make up a record in a file. A record can have
many fields. Each field has a name for reference.
See also “Record” on page 378.
Field Definition
A field definition identifies and describes the format of the data in a file. Computer files
can have many fields for the same record. Typically, each record in a file contains the
same fields.
Field Types
The types of data readable by ACL. Because data types usually apply to the fields of input
data records, they are commonly called field types.
ACL supports most field types, including those found in specific applications, such as
the numeric field type found in the ACCPAC accounting system.
File History
A record of the process used when ACL creates a data file as output. The file history
includes each step used in creating the file, along with a time and date stamp. ACL also
indicates the number of records in the output file, plus the name of the file from which
the output file was created, and the number of records in that file.
See also “History” on page 374.
Filter
An expression that selects records based on whether a test or condition is true. A filter is
actually a type of expression. A filter is also known as a logical type.
See also “Global Filter” on page 374 and “Local Filter” on page 376.
First
A scope parameter that selects a specified number of records, starting from the first
record in the file.
See also “Scope Parameter” on page 379.
374 ACL for Windows 7 Reference Manual
Function
A routine that accepts zero or more parameters, performs a calculation, and then
returns a value.
GAPDUPn
A special ACL variable created automatically by specific ACL commands, such as the
SEQUENCE, GAPS, or DUPLICATES command, that contains the number of gaps and/or
duplicates in the file on which that command was last issued.
Global Filter
A filter that applies to all commands and views for an entire input file. A global filter
stays in place until it is removed.
See also “Filter” on page 373.
Group
A series of commands that is processed as a unit in a single pass of a file. You can create
a group in a batch, then run the batch to execute the commands in the group. Using
groups increases processing speed, because ACL performs all group commands in one
pass of the file, as opposed to one pass of the file for each command.
HIGHn
A special ACL variable created automatically by specific ACL commands, such as the
STATISTICS command, that contains the five (by default) highest values of the field on
which that command was last issued.
Histogram
A horizontal bar graph created using the ACL HISTOGRAM command. Histograms show
the distribution of values in a field or expression. A histogram is the graphical equivalent
of stratifying data.
History
A file-specific log that records the commands and the source of the data you use. The
history is added to the input file definition whenever ACL creates a data file as output.
ACL time and date stamps all entries in a file history. Various preferences in the Printing
Options allow you to print a file history and other information when you print a report
or a view.
Appendix C Glossary 375
If
A scope parameter that selects only certain records from the whole file or limits the
execution of ACL commands. For example, COUNT IF AMOUNT > 0.
See also “Scope Parameter” on page 379.
Also a command that performs an action if a condition is true, such as: IF
TOTAL>1,000,000.
Improper Data
Data that is technically valid, but not correct. For example, negative amounts in a
numeric field that should contain only positive amounts.
Incomplete Data
Data that contains gaps or is not in the proper sequence.
Inconsistent Data
Data for which comparable or matching data does not exist in another field or file.
Index
A method of sequencing data. The ACL INDEX command also creates an index file. This
file contains pointers that allow ACL to read data in the sorted order, even though the
records in the original input file are not sorted. Creating an index file is called
“indexing”.
Input File
An inclusive term which refers to the data file and the input file definition taken together.
See also “Data File” on page 371 and “Input File Definition” on page 375.
Interactive Batch
A batch that prompts the user for information while the batch is running.
See also “Batch” on page 370.
376 ACL for Windows 7 Reference Manual
Invalid Data
Data in a field that does not match the field type assigned to that field.
Joining Files
A process that matches transaction data with master file records or compares the
contents of two files. The ACL JOIN command allows you to combine the fields of two
files with different structures into a third file, and can also identify matched or
unmatched records in one or both files.
Key Field
A sort field. When sorting a file, the key field is the field you tell ACL to use to create the
sort order.
Legacy File
Older data files generated primarily on mainframe computers. These kinds of files have
no internal data definition, so you must create an input file definition for them.
See also “Input File Definition” on page 375.
Local Filter
An expression that limits the records processed to those that meet a certain logical
condition. For example, you can create a local filter to focus on either a portion of the file
or a specific type of transaction.
See also “Filter” on page 373 and “Global Filter” on page 374.
Log File
A cumulative record of all ACL commands issued, followed by their results, from
previous ACL sessions to the point the log was last cleared.
ACL automatically creates a log file specific to the Project created, and time and date
stamps each entry.
LOWn
A special ACL variable created automatically by specific ACL commands, such as the
STATISTICS command, that contains the five (by default) lowest values of the field on
which that command was last issued.
Materiality Level
In sampling, the maximum extrapolated dollar value that is acceptable to confirm a
hypothesis.
Appendix C Glossary 377
MAXn
A special ACL variable created automatically by specific ACL commands, such as the
STATISTICS command, that contains the highest value of the field on which that
command was last issued.
Merging
A process that combines two sorted files with an identical record structure into a third
file. For example, you can merge identically structured files from two different time
periods or from two different company branches into a new file.
See “Append” on page 369.
MINn
A special ACL variable created automatically by specific ACL commands, such as the
STATISTICS command, that contains the lowest value of the field on which that
command was last issued.
MLEn
A special ACL variable created automatically by specific ACL commands, such as the
EVALUATE command, that contains the most likely error of the file on which that
command was last issued.
Multiple-Record-Type File
A data file that contains more than one record type. For example, a report file that has
header, detail, and trailer records. The record length may be fixed or variable.
Multi-reel File
A data file that spans more than one reel of magnetic tape or cartridge, or that spans
several data sets on one reel or cartridge that have the same field format.
Nested Group
A group of commands embedded within another group of commands. “Nesting”
groups extends the power of groups by enabling control over which commands are
executed for which record.
See also “Group” on page 374.
378 ACL for Windows 7 Reference Manual
Next
A scope parameter that causes the current command to be applied only to a subsequent
portion of the primary file.
See also “Scope Parameter” on page 379.
Operators
Mathematical and logical symbols used in building expressions. The operators in ACL
include:
() - ^ * / +
< > = >= <= <>
NOT AND & OR |
Overlapping Field
The portion of an already defined field that is redefined as a different field.
Physical Field
As opposed to a virtual or computed field, a physical field refers to data that exists
directly in the data file.
See also “Computed Field” on page 371.
Primary File
The single file you are currently working with. You can have only one primary file open
at a time. A primary and a secondary file are used in Join and Merge operations.
See also “Secondary File” on page 379.
Random Seed
The starting value for random record sampling.
See also “Record Sampling” on page 379.
RANGEn
A special ACL variable created automatically by specific ACL commands, such as the
STATISTICS command, that contains the difference between the MAXn and MINn
variables. This gives the range between the highest and lowest value.
Record
A unit of related items of information which makes up a file. Each record contains
individual pieces of information called fields.
Appendix C Glossary 379
Record Sampling
In sampling, a method of selecting records where each record has an equal chance of
being selected. Record sampling is also known as attribute sampling.
Report File
A file that is usually an exact duplicate of a hard copy report in electronic format. A
report file is sometimes called a print spool file.
Ruler
The ACL ruler is used as a guide to defining fields, because it marks the byte position of
each field in the data file.
SAMPINTn
A special ACL variable created automatically by specific ACL commands, such as the
SIZE command, that contains the sample interval based on data given to the command.
SAMPSIZEn
A special ACL variable created automatically by specific ACL commands, such as the
SIZE command, that contains the sample size based on data given to the command.
Scope Parameter
A statement that can be included in an ACL command to limit how much of a file is
processed, or to limit the execution of a command or batch. Examples are: IF, WHILE,
NEXT, and FIRST. Scope parameters can be used separately or in conjunction with each
other.
Secondary File
The second file you open when you have two files open at once. You can only have one
secondary file open or set at a time. A primary and a secondary file are used in Join and
Merge operations. The secondary file is the second file you use in Join and Merge opera-
tions.
See also “Primary File” on page 378.
Seed
The starting value for the sequence of random numbers ACL generates when random
numbers are required. Each unique seed value results in a different series of random
numbers being generated, but each series can be regenerated from its seed.
380 ACL for Windows 7 Reference Manual
Sequential File
A data file (such as a tape file) whose records must be accessed in a fixed order, one after
the other.
Static
This term refers to a record whose field values you want to remain unchanged for all
related records. The static modifier is generally used in conjunction with
multiple-record-type files where the values in one record relate to subsequent records.
Tainting
In sampling, the amount of error for a particular item.
UELn
A special ACL variable created automatically by specific ACL commands, such as the
EVALUATE command, that contains the upper error limit of the data set on which the
command was last performed.
Variables
Temporary values that exist in memory for, at most, the length of an ACL session.
Variables can be used to retain and carry forward information from one ACL command
to another. The only exception is a variable whose name starts with an underscore (_).
These variables are stored as part of your Project.
Some commands automatically create variables when they are executed. You can use
these ACL generated variables, or variables you create yourself, when processing other
ACL commands. A variable retains its value until it is changed, deleted or until you quit
ACL.
View
The display of data in a file according to the way you have defined the file’s fields. An
ACL view does not contain data. It is only an on-screen arrangement or presentation of
the data.
Virtual Field
See “Computed Field” on page 371.
While
A scope parameter that terminates the processing of a file as soon as the associated test
fails. This is useful for limiting the scope of commands that otherwise process the whole
file.
See also “Scope Parameter” on page 379.
Appendix C Glossary 381
White Space
The white area surrounding text. ACL uses the available white space in a report to ensure
that your data is fully displayed.
Workspace
A file that stores field definitions which are portable across a number of data files.
Usually, these are computed fields that refer to the current environment, but they can
also be unique field names and descriptions. Using a workspace file allows you to extend
your current input file without having to define extra fields.
WRITEn
A special ACL variable created automatically by specific ACL commands, such as the
SEQUENCE, GAPS, or DUPLICATES commands, that contains the number of data
sequence errors encountered; up to the maximum number specified in your preferences.
383
Index
A All parameter, using 89 OS/390 359
ALLTRIM( ) function, about 29 Batches
Absolute value
American dates, formatting closing 254
calculate using ABSOLUTE( )
convention 15 comments, inserting 141
function 28
Annuities, calculating future computed fields, defining 145
find using Statistics
value 49–50 conditions, specifying 169–171
command 328
Append parameter, using 89–90 creating 169–171
ABSOLUTE( ) function, about 28
Append to existing file custom dialog boxes,
Accept command
parameter, using 89–90 creating 153
about 113–117
Appending output to existing deleting in command mode 151
Fields parameter 114
file 89 filters, setting 311
ACCPAC field type, described 9
As parameter, using 90 group commands,
Accumulate fields
Ascending processing 202–206
Age command 121
sort order 324 indexes, opening 312
Stratify command 333
sort order, about 91 pausing to display messages 250
Summarize command 340
ASCII renaming 276
ACL Client/Server. See
byte characters 35–36 running 169–171
Client/Server
converting to EBCDID 42–43 temporary relationships,
ACL field type, described 9
decimal value equivalent 36–37 defining 275
ACL field types, common data type
decimal value, finding 29 Benford command
equivalents 7
display, using Dump about 129–132
Activate command
command 173–175 dialog box, Benford On 129
about 118–120
format, List command 233 digits, specifying maximum
example 119–120
symbols, adding to fields for number 130
Activating
formatting 36–37 graph output 131
index files 217
variable length files, opening in positive and negative values,
workspaces 118–120
command mode 246 separating 130
Adjust field start position using
ASCII( ) function, about 29 table output 130–131
OFFSET( ) 64–65
Assign command zero-valued records 130
Age command
about 127–128 Benford frequency, finding 47–48
about 121–126
examples 128 BETWEEN( ) function, about 32–
Accumulate Fields 121
variable-name = expression 127 33
examples 124–126
AT( ) function, about 30–32 Bias, sampling selection 284–285
output, described 123
Autoexecuting Bidirectional data, reversing display
periods, changing default 121
Classify command 135 order 81
selecting fields to age 121
Sequence command 304 Binary field type, described 10
specifying aging periods 121
Statistics command 328 Binomial distribution, compared to
Age On
Stratify command 333 Poisson 314–315
Age command dialog box 121
Total command 347 BIT( ) function, about 33–34
AGE( ) function, about 28
Verify command 350 Bits
Aging
extracting from byte using
periods, specify using Age
MASK( ) 58–59
command 121
using functions to calculate 28
B finding strings 33–34
BASIC field type, described 9 shifting left or right 76–77
Align fields using Fieldshift
Batch files converted from Blank Invalid Data preference,
command 193–195
384 Index
field type, described 17 keys, specifying 240 Next parameter, using 102
functions, summary 24 prerequisites 239 No Repeats option, Sample dialog
Loop command Presort check box 240 box 289
about 237–238 Presort keyword 242 Nodups parameter, using 103
dialog box, displaying 237 Merging in command mode 242 Nominal interest rate,
End keyword 238 Messages calculating 62–63
example 237–238 OS/390 conversions 357–358 NOMINAL( ) function, about 62–
syntax example 238 Pause command, creating 250 63
Loops, close using End 238 Micro field type, described 17 Non-printable characters
Lotus 1-2-3 format, ACL data 186 Minimum interval value, Stratify finding 36–37
LOWER( ) function, about 56 command 334 testing for 29
Lowercase, converting alphabetic MINIMUM( ) function, about 61 Normalizing data fields using
characters 56 Miscellaneous functions, REMOVE( ) 72–73
LTRIM( ) function, about 56–57 summary 26 Notify command
Lump sum, calculating present Missing about 243–245
value 68 information, finding in fields 53 address, specifying 243
items, list using Sequence examples, local and remote
command 305 e-mail 244
M Mixed case, converting to Microsoft e-mail
Many-to-one relationships between lowercase 56 applications 243
parent and child files 261 MOD( ) function, about 62 Password keyword 245
MAP( ) function, about 57–58 Monetary unit sampling syntax 245
MASK( ) function, about 58–59 fields, selecting 290 Nozeros parameter, using 104
MATCH( ) function, about 59–60 selection bias 285 NPER( ) function, about 63
Matched records all primary and all type, specifying 316, 317 Numbers
secondary, Join command Most likely error, monetary unit current records, finding 71–72
option 225 sampling 180–181 finding greater or lesser of
Matched records all primary, Join Multiline reports, creating 282 two 60–61
command option 224 Multiple relations, building 268– random, generating 69, 255–258
Matched records all secondary, Join 270 Numeric
command option 224 Multiple-prompt dialog boxes, data types, about 6
Matched records, Join command creating 117 expression, converting to
option 224 MUS date 38–39
Matching similar sounding See also Monetary unit sampling field type, described 17
items 77–78 Sample dialog box 289 fields, punctuation 17
Materiality, specifying in Size MVS. See OS/390 format, converting from
command 316 character 84
Mathematical functions, format, converting to zoned 85–
summary 25 N 86
Maximum Name Numeric data
interval value, Stratify 334 See also To parameter BASIC field type 9
tolerable tainting, defined 314 field, changing in command converting to unsigned
MAXIMUM( ) function, about 60– mode 276–278 format 82–83
61 file, changing in command creating in packed format 65
Memory, finding amount available mode 276–278 in character fields 6
for use 167 parameter, using 102 Numeric fields
Merge command Navigating to beginning of file 346 display totals 347
about 239–242 NDATE date parameter, stratifying 334
compared to Join 239 described 15 summary profiles 251–253
example 241–242 Nested groups, creating 205–206
Index 391
RAND( ) or RND( ) function, Reducing file size before REMOVE( ) function, about 72–73
about 69 sorting 189 Removing characters from fields 44
Random Refresh command Rename button, using 276
numbers, generating 69, 255– about 259–275 Rename command
258 button, using 259 about 277–278
Sample dialog box option 290 examples 260 examples 277–278
Random command password 259 Repayment period loans,
about 255–258 syntax 259 calculating 63
columns display, specifying 255 Refresh option, Dump REPEAT(› function, about 73
examples 257 command 175 Repeated values, displayed as
range, specifying 255 Refreshing ODBC data in command blanks 103
sort order, specifying 256 mode 259–275 REPLACE( ) function, about 73–74
starting point, specifying 255 Regenerating Report command
unique numbers only 256 commands used 196 about 279–283
Ranges, find using Statistics samples 286–288 examples 281–282
command 328 Related page setup dialog box,
RATE( ) function, about 69–70 fields, adding to view 272 displaying 280
Rate, calculating interest on fields, using in Expression suppressing blank detail
annuity 69–70 Builder 271 lines 281
Realign data using Fieldshift files, missing or duplicate totals and subtotals
command 193 records 261 summary 280
RECLEN( ) function, about 70–71 Relating files, procedure 268–270 Report files converted from
RECNO( ) function, about 71–72 Relation Name, Relations dialog OS/390 360
Record box 267 Report Selection Order, Sample
lengths, finding 70–71 Relations dialog box 290
number, finding current 71–72 between files, planning 264–266 Reports
parameter, using 106 Client/Server files 262 creating in command mode 283
Sample dialog box option 290 closing files using Close display width, specifying 111
Record sampling command 138 excluding specified totals 107
determining sample sizes 316 defining in command mode 274 formatting steps 279
Size command, specifying 316, deleting in command mode 151 multiline, creating 282
317 key fields, choosing 262 previewing 280
Records key fields, creating identical printing in command mode 172
blank lines, inserting 233 format 73–74 zeros, suppressing 283
conditional, finding 299 many-to-one 261 Reverse quotes, dates 11
count using Statistics Relations command REVERSE( ) function, about 75
command 328 about 261–273 Reversing order of characters in
count using Stratify child file, selecting 268 string 75
command 333 compared to Join 223 Rewind tape
counting, criteria 142 Parent file, Relations dialog accelerating speed 365
finding in command mode 198– box 268 using Tape command 345
199 Relation Name text box 268 RJUSTIFY( ) function, about 75
first, find using Seek Relationships ROOT( ) function, about 75–76
command 303 delete using dialog box 273–275 ROUND( ) function, about 76
including undefined fields in deleting in command mode 274 Rounding to nearest whole
output 106 displaying in command number 76
limiting processing with Next mode 274
parameter 102 temporary, establishing 275
number, finding 299, 300 Remainder from division, S
specific, finding 235–236 isolating 62 Sample command
Index 393
indexed files 217 Stratifying in command mode 338 files, indexing, joining, and
Random command 256 STRING( ) function, about 79 merging 367
specifying 323 Strings files, opening 247
Sorting character, breaking into labeled, calculating file marks to
in command mode 327 segments 78 skip 345
compared to indexing 323–324 compare using MAP( ) 57–58 rewind using Tape
space requirements 324 starting byte position, command 345
SOUNDEX( ) function, about 77 finding 80–81 switching between tape and
SOUNDSLIKE( ) function, Subsample, Sample dialog box disk 366
about 77–78 option 291 troubleshooting procedures 367
Space requirements, Sort SUBSTRING( ) function, unlabeled, calculating file marks
command 324 about 79–80 to skip 345
Space. See RAM Substrings, finding in character Tape command
Spelling inconsistencies, finding 77 strings 79 about 344–345
SPLIT( ) function, about 78 Subtotals, generating with break examples 345
Square root, calculating 75–76 option 92 Skip keyword 344
Standard deviation Summarize command Temporary relationships,
finding 328 about 339–343 establishing 275
specifying in Statistics accumulating fields and Test
command 328 expressions 340 create using If command 214
Start of century date, defined 12 additional fields, specifying 340 create using If parameter 100
Start, Sample dialog box option 290 example 342 TEST( ) function, about 80–81
Starting byte position, finding 80– fields or expressions, Text
81 selecting 340 boxes, create in dialog boxes 113
Statistics command large files, generating totals 339 format, ACL data 186
about 328–332 Other Fields button 340 messages, adding to dialog
autoexecuting 328 presorting files 339 boxes 157
examples 329–331 Summarizing Text format, ACL data 186
fields and expressions, in command mode 343 TIME( ) function, about 81
selecting 329 field value totals 339 Time, finding current 81
high and low values, number to using Classify command 135 To
retain 328 Suppress field modifier, using 107 See also Name, Output, Print,
standard deviation, Suppress Others parameter, Screen, Graph
specifying 328 described 107 parameter, described 109
Statistics, obtaining in command Suppressing Top command, about 346
mode 332 blank lines using Report Total command
Stratify command command 281 about 347–349
about 333–338 detail lines using Report autoexecuting 347
Accumulate fields 333 command 280 examples 348–349
autoexecuting 333 zeros in reports 283 groups, using 347
example, even intervals 334–335 numeric fields and expressions,
example, free intervals 336–337 displaying 347
free, interval start and end T Totalling numeric fields in
points 333 Tape command mode 349
graphing output 337 accelerating rewind 365 Totals, excluding outside specified
intervals, specifying 333 data, obtaining 363 range 107
maximum interval value 334 drive system, acquiring 361 Trailing blanks, removing 82
minimum interval value 334 drive system, components 362 TRANSFORM( ) function,
output 337 files, accessing 344 about 81
values, determining 251 files, defining 366 TRIM( ) function, about 82
Index 395
7 Reference Manual
Reference Manual
ACL for Windows
™
7
E-mail: info_europe@acl.com Web: www.acl.com
Singapore 339505
Tel: +65-299-3350 Fax: +65-299-5110
E-mail: info_asia@acl.com Web: www.acl.com