Anda di halaman 1dari 413

ACL™

Version

7 Reference Manual

Reference Manual
ACL for Windows

ACL Services Ltd.


1550 Alberni Street
Vancouver, BC, Canada V6G 1A5
Tel: +1-604-669-4225 Fax: +1-604-669-3562
E-mail: info@acl.com Web: www.acl.com

ACL Europe S.A.


Rue de Hennin 67 – 69
1050 Brussels, Belgium
Tel: +32-2-642-22-90 Fax: +32-2-642-22-91

7
E-mail: info_europe@acl.com Web: www.acl.com

ACL Services (Singapore) Pte. Ltd.


50 Kallang Avenue
#07-05 Noel Corporate Building
for Windows
ACL™
Version
WDE7087

Singapore 339505
Tel: +65-299-3350 Fax: +65-299-5110
E-mail: info_asia@acl.com Web: www.acl.com
Reference Manual

ACL for Windows


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.

Published March 2001 by:

ACL Services Ltd.


1550 Alberni Street
Vancouver, BC
Canada V6G 1A5
Telephone: +1-604-669-4225
Fax: +1-604-669-3562
E-mail: info@acl.com
Web: www.acl.com

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

About this Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Chapter 1: Field Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5


Categories of Data .................................................................................... 5
ACL Field Types ................................................................................ 5
Data Types and ACL Field Types ..................................................... 7
ACCPAC ................................................................................................... 9
ACL ........................................................................................................... 9
ASCII ........................................................................................................ 9
BASIC ....................................................................................................... 9
Binary ...................................................................................................... 10
Custom ................................................................................................... 10
Date ......................................................................................................... 11
Blank or Invalid Dates .................................................................... 11
Two-Digit Years .............................................................................. 12
Serial Dates ...................................................................................... 12
Dates in Compressed Numeric Fields ............................................ 12
Date Formats ................................................................................... 14
Date Formatting Conventions ........................................................ 15
Command Mode Syntax ................................................................. 15
EBCDIC .................................................................................................. 15
Float ........................................................................................................ 16
Halfbyte .................................................................................................. 16
IBMfloat .................................................................................................. 16
Logical ..................................................................................................... 17
Micro ...................................................................................................... 17
Numeric .................................................................................................. 17
Packed ..................................................................................................... 18
Dates in Packed Numeric Fields ..................................................... 19
Century Codes in Packed Date Fields ............................................ 19
PCASCII ................................................................................................. 20
Print ........................................................................................................ 20
Unisys ..................................................................................................... 21
Unsigned ................................................................................................. 21
iv 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

Chapter 3: Common Command Parameters . . . . . . . . . . . . . . . . . . 89


All ........................................................................................................... 89
Append/Append to Existing File ........................................................... 89
As ............................................................................................................ 90
Ascending ............................................................................................... 91
Break ...................................................................................................... 92
Descending ............................................................................................. 93
End of File .............................................................................................. 94
File .......................................................................................................... 95
File Type ................................................................................................. 96
First ......................................................................................................... 96
Footer ..................................................................................................... 97
Graph ..................................................................................................... 98
Header .................................................................................................... 99
If ............................................................................................................ 100
Key ......................................................................................................... 100
Local ...................................................................................................... 101
Name ..................................................................................................... 102
Next ....................................................................................................... 102
Nodups .................................................................................................. 103
Nozeros ................................................................................................. 104
Open ...................................................................................................... 104
Page ....................................................................................................... 105
Picture ................................................................................................... 105
Print ....................................................................................................... 106
Record ................................................................................................... 106
Screen .................................................................................................... 107
Suppress ................................................................................................ 107
To .......................................................................................................... 109
Use Output File ..................................................................................... 110
Contents vii

While ..................................................................................................... 110


Width .................................................................................................... 111

Chapter 4: Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113


Accept ................................................................................................... 113
Parameters ..................................................................................... 114
Command Mode Syntax ............................................................... 114
Activate ................................................................................................. 118
Parameters ..................................................................................... 118
Command Mode Syntax ............................................................... 119
Age ........................................................................................................ 121
Parameters ..................................................................................... 121
Age Dialog Box .............................................................................. 123
Command Mode Syntax ............................................................... 126
Assign .................................................................................................... 127
Parameters ..................................................................................... 127
Command Mode Syntax ............................................................... 127
Benford ................................................................................................. 129
Parameters ..................................................................................... 129
Input .............................................................................................. 130
Output ........................................................................................... 130
Benford Dialog Box ....................................................................... 131
Command Mode Syntax ............................................................... 132
Calculate ............................................................................................... 133
Parameters ..................................................................................... 133
Command Mode Syntax ............................................................... 133
Classify .................................................................................................. 135
Parameters ..................................................................................... 135
Command Output ........................................................................ 136
Classify Dialog Box ....................................................................... 136
Command Mode Syntax ............................................................... 137
Close ..................................................................................................... 138
Command Mode Syntax ............................................................... 138
Comment .............................................................................................. 140
Comment Dialog Box ................................................................... 140
Command Mode Syntax ............................................................... 140
viii Contents

Count .................................................................................................... 142


Parameters ..................................................................................... 142
Count Dialog Box .......................................................................... 142
Command Mode Syntax ............................................................... 143
Define Field ........................................................................................... 144
Parameters ..................................................................................... 144
Command Mode Syntax ............................................................... 145
Define Relations .................................................................................... 148
Define Report ........................................................................................ 149
Command Mode Syntax ............................................................... 149
Delete .................................................................................................... 150
Parameters ..................................................................................... 150
Command Mode Syntax ............................................................... 151
Dialog .................................................................................................... 153
Dialog Builder ................................................................................ 153
Command Mode Syntax ............................................................... 165
Display .................................................................................................. 167
Parameters ..................................................................................... 167
Command Mode Syntax ............................................................... 168
Do Batch ................................................................................................ 169
Parameters ..................................................................................... 169
Do Batch Dialog Box ..................................................................... 169
Command Mode Syntax ............................................................... 171
Do Report .............................................................................................. 172
Command Mode Syntax ............................................................... 172
Dump .................................................................................................... 173
Dump Dialog Box .......................................................................... 173
Parameters ..................................................................................... 173
Command Mode Syntax ............................................................... 175
Duplicates ............................................................................................. 176
Parameters ..................................................................................... 176
Duplicates Dialog Box ................................................................... 176
Duplicates ............................................................................................. 176
Parameters ..................................................................................... 176
Duplicates Dialog Box ................................................................... 176
Duplicates ............................................................................................. 176
Parameters ..................................................................................... 176
Duplicates Dialog Box ................................................................... 176
Contents ix

Else ........................................................................................................ 177


Parameters ..................................................................................... 177
Else Dialog Box ............................................................................. 177
Command Mode Syntax ............................................................... 177
End ........................................................................................................ 178
Command Mode Syntax ............................................................... 178
Evaluate ................................................................................................. 179
Parameters ..................................................................................... 181
Evaluate Dialog Box ...................................................................... 182
Command Mode Syntax ............................................................... 185
Export ................................................................................................... 186
Parameters ..................................................................................... 186
Export Dialog Box ......................................................................... 187
Command Mode Syntax ............................................................... 188
Extract ................................................................................................... 189
Parameters ..................................................................................... 189
Extract Dialog Box ........................................................................ 190
Command Mode Syntax ............................................................... 192
Fieldshift ............................................................................................... 193
Parameters ..................................................................................... 193
Shift Fields Button ......................................................................... 194
Command Mode Syntax ............................................................... 195
File History ........................................................................................... 196
File History Menu Item ................................................................ 196
Command Mode Syntax ............................................................... 197
Find ....................................................................................................... 198
Command Mode Syntax ............................................................... 198
Gaps ...................................................................................................... 200
Parameters ..................................................................................... 200
Gaps Dialog Box ............................................................................ 200
Group .................................................................................................... 202
Parameters ..................................................................................... 202
Group Dialog Box ......................................................................... 202
Command Mode Syntax ............................................................... 203
Help ...................................................................................................... 207
Help Button ................................................................................... 207
Command Mode Syntax ............................................................... 207
x Contents

Histogram ............................................................................................. 208


Parameters ..................................................................................... 208
Histogram Dialog Box ................................................................... 210
Command Mode Syntax ............................................................... 213
If ............................................................................................................ 214
Command Mode Syntax ............................................................... 214
Import ................................................................................................... 215
ODBC Option Button ................................................................... 215
Command Mode Syntax ............................................................... 215
Index ..................................................................................................... 216
Indexing versus Sorting ................................................................. 216
Sort Order ...................................................................................... 217
Activating Indexes ......................................................................... 217
Indexing Tips ................................................................................. 218
Filters and Conditions ................................................................... 218
Parameters ..................................................................................... 218
Index Dialog Box ........................................................................... 219
Command Mode Syntax ............................................................... 222
Join ........................................................................................................ 223
Join Versus Relations .................................................................... 223
Join Output Options ...................................................................... 224
Output File Field Names ............................................................... 225
Source File Locations .................................................................... 225
Preparing Key Fields ..................................................................... 226
Parameters ..................................................................................... 226
Join Dialog Box .............................................................................. 228
Command Mode Syntax ............................................................... 231
List ......................................................................................................... 232
Parameters ..................................................................................... 232
Command Mode Syntax ............................................................... 233
Locate .................................................................................................... 235
Parameters ..................................................................................... 235
Command Mode Syntax ............................................................... 235
Loop ...................................................................................................... 237
Parameters ..................................................................................... 237
Loop Dialog Box ............................................................................ 237
Command Mode Syntax ............................................................... 238
Contents xi

Merge .................................................................................................... 239


Parameters ..................................................................................... 240
Merge Dialog Box ......................................................................... 241
Command Mode Syntax ............................................................... 242
Notify .................................................................................................... 243
Parameters ..................................................................................... 243
Notify Dialog Box ......................................................................... 244
Command Mode Syntax ............................................................... 245
Open ..................................................................................................... 246
Parameters ..................................................................................... 246
Command Mode Syntax ............................................................... 248
Password ............................................................................................... 249
Command Mode Syntax ............................................................... 249
Pause ..................................................................................................... 250
Parameters ..................................................................................... 250
Command Mode Syntax ............................................................... 250
Profile .................................................................................................... 251
Parameters ..................................................................................... 251
Profile Dialog Box ......................................................................... 252
Command Mode Syntax ............................................................... 253
Quit ....................................................................................................... 254
Command Mode Syntax ............................................................... 254
Random ................................................................................................ 255
Parameters ..................................................................................... 255
Random Dialog Box ...................................................................... 256
Command Mode Syntax ............................................................... 258
Refresh .................................................................................................. 259
Parameters ..................................................................................... 259
Refresh from Source File Button .................................................. 259
Command Mode Syntax ............................................................... 259
Relations ............................................................................................... 261
Parent and Child Files ................................................................... 261
Prerequisites for Relating Files ..................................................... 262
Planning Relations Between Data Files ........................................ 264
Parameters ..................................................................................... 266
Relations Dialog Box ..................................................................... 268
Relating Files ................................................................................. 268
Accessing Related Fields ............................................................... 270
Adding Fields to the View ............................................................. 272
xii Contents

Deleting Relationships .................................................................. 273


Command Mode Syntax ............................................................... 274
Rename ................................................................................................. 276
Parameters ..................................................................................... 276
Command Mode Syntax ............................................................... 277
Report .................................................................................................... 279
Parameters ..................................................................................... 279
Report Dialog Box ......................................................................... 281
Command Mode Syntax ............................................................... 283
Sample ................................................................................................... 284
Sampling Bias ................................................................................ 284
Sample Type .................................................................................. 285
Parameters ..................................................................................... 288
Sample Dialog Box ........................................................................ 291
Command Mode Syntax ............................................................... 295
Save ........................................................................................................ 296
Parameters ..................................................................................... 296
Command Mode Syntax ............................................................... 296
Search .................................................................................................... 298
Parameters ..................................................................................... 298
Search Dialog Box ......................................................................... 300
Command Mode Syntax ............................................................... 302
Seek ....................................................................................................... 303
Command Mode Syntax ............................................................... 303
Sequence ............................................................................................... 304
Parameters ..................................................................................... 304
Sequence Dialog Box ..................................................................... 306
Command Mode Syntax ............................................................... 308
Set .......................................................................................................... 309
Preference Equivalents .................................................................. 309
No Preference Equivalents ............................................................ 310
Size ........................................................................................................ 314
Parameters ..................................................................................... 315
Size Dialog Box .............................................................................. 317
Command Mode Syntax ............................................................... 322
Sort ........................................................................................................ 323
Parameters ..................................................................................... 324
Sort Dialog Box .............................................................................. 325
Command Mode Syntax ............................................................... 327
Contents xiii

Statistics ................................................................................................ 328


Parameters ..................................................................................... 328
Statistics Dialog Box ...................................................................... 329
Command Mode Syntax ............................................................... 332
Stratify ................................................................................................... 333
Parameters ..................................................................................... 333
Stratify Dialog Box ........................................................................ 334
Command Output ........................................................................ 337
Command Mode Syntax ............................................................... 338
Summarize ............................................................................................ 339
Parameters ..................................................................................... 340
Summarize Dialog Box ................................................................. 341
Command Mode Syntax ............................................................... 343
Tape ...................................................................................................... 344
Parameters ..................................................................................... 344
Command Mode Syntax ............................................................... 345
Top ........................................................................................................ 346
Command Mode Syntax ............................................................... 346
Total ...................................................................................................... 347
Parameters ..................................................................................... 347
Total Dialog Box ........................................................................... 347
Command Mode Syntax ............................................................... 349
Verify .................................................................................................... 350
Parameters ..................................................................................... 350
Verify Dialog Box .......................................................................... 351
Command Mode Syntax ............................................................... 353

Appendix A: Using the ACL Utility . . . . . . . . . . . . . . . . . . . . . . . . . . 355


Converting from OS/390 to Windows ................................................. 355
Conversion Messages .................................................................... 357
Informational Messages ................................................................ 357
Error Messages .............................................................................. 358
Fatal Error Messages ..................................................................... 358
Using Converted OS/390 Files ............................................................. 359
Batches .......................................................................................... 359
Format Files ................................................................................... 360
Reports .......................................................................................... 360
xiv Contents

Appendix B: Working With Tape . . . . . . . . . . . . . . . . . . . . . . . . . . . 361


Acquiring a Tape Drive System ............................................................ 361
Tape Drive System Components .................................................. 362
Before You Begin .................................................................................. 363
How Data is Organized on Tape .......................................................... 364
Data Sets and File Marks ............................................................... 364
Positioning Tape ........................................................................... 364
Switching Between Tape and Disk ................................................ 366
Working with Tape Files ....................................................................... 366
Creating an Input File Definition .................................................. 366
Processing Tape Files .................................................................... 367
Troubleshooting Tape .......................................................................... 367

Appendix C: Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369


1

About this Manual

This manual provides detailed information on:


 ACL field types
 ACL functions
 ACL commands
The ACL for Windows Reference Manual is provided to licensed users of ACL. To
purchase additional copies, visit www.acl.com.

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.

ACL for Windows Workbook


The ACL for Windows Workbook is a self-study guide. Whether you are new to data
analysis, or already have some experience with ACL, it will help you to master ACL for
Windows and apply it to real world problems.
The ACL for Windows Workbook is provided to licensed users of ACL. To purchase
additional copies, visit www.acl.com.
2 ACL for Windows 7

Document Conventions
This manual uses the following conventions to describe the command mode syntax of
ACL commands and functions.

Monospace Denotes command syntax used in the command line or in a batch.

Monospace italic Denotes user-specified items such as field names.

Angle brackets < > Denote optional command parameters or choices.

Braces { } Enclose a set of options from which one must be chosen.

Bars | | | Vertical bars separate options.

Ellipsis ... Indicates that the preceding item may be repeated.

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

Online Support Center


If you have access to the World Wide Web, go to www.acl.com and click the Online
Support Center. There you will find helpful tools and resources to enhance your use of
ACL.

Global Help Desk


The Americas
 Phone: +1-604-669-4997
 Fax: +1-604-689-4209
 E-mail: support@acl.com.
Europe, Africa, and Middle-East
 Phone: +32-2-642-22-90
 Fax: +32-2-642-22-91
 E-mail: support_europe@acl.com.
Asia and Pacific Rim
 Phone: +65-299-3350
 Fax: +65-299-5110
 E-mail: support_asia@acl.com.

We’d Like to Hear From You!


ACL is committed to providing you with quality products and services for data access,
analysis, and reporting. To ensure your continued satisfaction, we welcome your sugges-
tions for improvements to ACL for Windows, our user documentation, and online Help.
Please send your comments to our Product Management team at:
 Phone: +1-604-669-4225
 Fax: +1-604-669-3557
 E-mail: product_mgmt@acl.com
You can also send mail to:
ACL Services Ltd.
1550 Alberni Street
Vancouver, BC
Canada V6G 1A5
Chapter 1 F IELD T YPES

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.

ACL Field Types


Within each category there are several types of data. Some data types are defined by
industry standards, such as ASCII. Others were developed to address the specific needs
of a computer manufacturer or software developer, such as IBM Float or ACCPAC.
ACL recognizes all of the most common data types. The descriptions of these data types
are called field types in ACL. If the explicitly defined field types do not represent the data
encountered, you can use computed fields and functions to access the data.
The following table lists the ACL field types, organized by category. Note that the names
of field types are always capitalized in ACL.

ACL Field Categories and Field Types

Field Category ACL Field Type

Character ASCII

EBCDIC

Custom

PCASCII

5
6 ACL for Windows 7 Reference Manual
Categories of Data

Field Category ACL Field Type

Numeric ACL

ACCPAC

Basic

Binary

Float

Halfbyte

IBMFloat

Micro

Numeric

Packed

Print

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.

Data Types and ACL Field Types


When you use the Data Definition Wizard to create a new input file definition, ACL
automatically recognizes most data types. For some data files you may have to manually
define the data type.
The table below cross-references a number of common data types with the corre-
sponding ACL field types. In addition to the data types listed in this table, ACL supports
several proprietary field types, such as VAXfloat and Unisys packed fields, as well as
numeric field types unique to the ACCPAC accounting system.
ACL also has its own numeric field type for storing the results of computed fields and the
values of variables in output data files.

Cross-reference of Common Data Types to ACL Field Types

Source Data Type ACL Field Type

Character ASCII or EBCDIC

PIC X (COBOL) ASCII or EBCDIC

String (BASIC) ASCII or EBCDIC

Computational-1 (COBOL) Binary

Computational-3 (COBOL) Packed


8 ACL for Windows 7 Reference Manual
Categories of Data

Source Data Type ACL Field Type

PIC 999 (COBOL) Zoned

Fixed Binary (PL/1) Binary

Fixed Decimal (PL/1) Packed

Integer (most micros) Micro (length of 2)

Integer (most mini/mainframes) Binary or Micro (length of 2)

Long Integer or Micro (length of 4)

Real Float

Single Precision (BASIC) BASIC (length of 4)

Double Precision (BASIC) BASIC (length of 8)


Chapter 1 Field Types 9
ACCPAC

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.

Blank or Invalid Dates


ACL assigns the value “19000101” to date fields that contain blanks or invalid dates. To
search for blank date fields:
1. Click (Edit View Filter) in the view to display the Edit View Filter dialog box.
2. In the Expression text box, enter Datefield = `19000101`, then click [OK].
The view displays only records that have a blank date field.

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.

Dates in Compressed Numeric Fields


ACL cannot automatically recognize dates stored in compressed numeric fields, such as
packed data fields. When you create an input file definition, ACL recognizes the packed
data as packed numeric data.
For ACL to recognize the packed numeric data as date information, you need to edit the
input file definition, select the field, select the data parameter, and specify the date
format. The date format indicates which numbers in the source file represent the day, the
month, and the year.
Chapter 1 Field Types 13
Date

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:

Format Characters Date Element

DD Day (1 – 31)

DDD Julian day (1 – 366)

MM Month (1 – 12)

MMM Month name (Jan. – Dec.)

YY Short year format (1 – 99)

YYYY Long year format (1900 – 1999)

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.

Stored Date ACL Date Format

991231 YYMMDD

12311999 MMDDYYYY

31DEC1999 DDMMMYYYY

12/31/99 MM/DD/YY

99365 YYDDD

December 31, 1999 MMM DD, YYYY


Chapter 1 Field Types 15
EBCDIC

Date Formatting Conventions


There are many date formatting conventions in use. The most common are shown in the
table below.

Example Using
Common Date Format Type December 31, 1999

YYYY-MM-DD ISO 1999-12-31

DD/MM/YY, DD.MM.YY, or DD-MM-YY European 31/12/99

MM/DD/YY American 12/31/99

YYDDD Julian 99365

Command Mode Syntax


You can describe the format of dates stored in numeric fields using the date field
modifier NDATE followed by the date format. For example, to describe a field with
numbers in the form 991231 as a date, you would use the NDATE field modifier as
shown below:
DEFINE FIELD Datefield NUMERIC 1 6 0 NDATE PIC "YYMMDD"

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.

Century Codes for Two Digit Years in Packed Fields


For more information, see “Century Codes in Packed Date Fields” on page 19.

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

Dates in Packed Numeric Fields


You need to manually specify the date format when dates are stored in compressed
numeric fields, such as packed fields. For more information, see “To Have ACL
Recognize the Century Code” on page 19.

Century Codes in Packed Date Fields


Two digits have long been used to represent the year in packed numeric fields used to
store dates. Some systems now add a third digit called a century code to indicate the
century to which the two digit year belongs.
The most common century codes use either a leading “0” or a leading “1” to indicate the
twentieth century:
 When a leading “0” in the packed field is used to represent 1900, any other
number, usually “1”, represents 2000.
0990101 represents January 1, 1999.
1000101 represents January 1, 2000.
 When a leading “1” in the packed field is used to represent 1900, any other
number, usually “2”, represents 2000.
1990101 represents January 1, 1999.
2000101 represents January 1, 2000.

To Have ACL Recognize the Century Code


After using the Data Definition Wizard to define a packed numeric field, you must
manually modify the date format as follows:
1. Select Edit from the menu bar and choose Edit Input File Definition. ACL displays
the Input File Definition window.
2. Under the [Fields/Expressions] tab, in the field list view, double-click the numeric
field you want to edit. ACL displays the field format options.
3. Click the Date check box.
4. Specify a date format in the Format drop-down list. Then, in the Format text box,
add a “0” or a “1” to the beginning of the packed date field format to specify the digit
representing the 1900s.
For example, the format “0YYMMDD” indicates that 0991231 is December 31,
1999. Similarly, “1YYMMDD” indicates that 1991231 is December 31, 1999.
5. Click (Accept Entry), then click [OK] to save the change.
You can see the formatted field in the View window.
20 ACL for Windows 7 Reference Manual
PCASCII

Date displayed as 1990101

Specify date format


Click to accept the
change

Click to save format

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.

BIT( ) Returns a string of 0s and 1s representing a specified byte position in the


current record.

BYTE( ) Returns the byte at a specified position in the current record.

CHR( ) CHR( ) returns the ASCII character corresponding to the decimal value
that you specify.

DIGIT( ) Returns the upper or lower digit of a specified packed byte.

HEXADECIMAL( ) Returns a string of hexadecimal values representing the contents of a


field.

MASK( ) Extracts individual bits from the first byte of a character expression.

SHIFT( ) Shifts the first character of an expression left or right by a specified


number of bits.

Conversion Functions

DECIMALS( ) Returns a numeric expression with a specified number of decimal places.

EBCDIC( ) Converts a string into EBCDIC characters.

PACKED( ) Converts numeric data into a PACKED data type of a specified length.

STRING( ) Converts a numeric expression into a string of characters.

UNSIGNED( ) Converts numeric data into an UNSIGNED data type of a specified length.

23
24 ACL for Windows 7 Reference Manual
Summary of Functions

VALUE( ) Converts a character expression into the numeric equivalent.

ZONED( ) Converts numeric data to a ZONED data format.

Date and Time 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.

CTOD( ) Converts a character or numeric expression into a valid date expression


for comparison with date field values.

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

BETWEEN( ) Tests whether input values fall within a specified range.

FIND( ) Searches for a string inside a field or record.

ISBLANK( ) Tests whether an input value is entirely blank.

MAP( ) Compares a string to a specified format.

MATCH( ) Compares an expression or field value to specified expressions or field


values to determine whether there is at least one match.

SOUNDSLIKE( ) Indicates whether two strings sound phonetically alike.

TEST( ) Searches for specified character strings at specified locations in a


record.

VERIFY( ) Searches for invalid data.


Chapter 2 Functions 25
Summary of Functions

Mathematical Functions

ABSOLUTE( ) Returns the absolute value of a numeric expression.

EXPONENT( ) Returns the exponential value (base 10) of a numeric expression.

FREQUENCY( ) Returns the expected Benford frequency for sequential leading positive
numeric digits to a precision of eight digits.

INTEGER( ) Returns the integer value of a numeric expression.

LOGARITHM( ) Returns the logarithm (base 10) of a numeric expression.

MAXIMUM( ) Returns the greater of two numeric parameters.

MINIMUM( ) Returns the lesser of two numeric parameters.

MOD( ) Returns the remainder of a division calculation.

RANDOM( ) Returns a random number between zero and the value of a numeric
expression.

ROOT( ) Returns the square root of a numeric expression.

ROUND( ) Returns a rounded number from a numeric expression.

ZSTAT( ) Calculates the standard Z-statistic for use in many problem-solving


tasks, including digital analysis.

Financial Functions

EFFECTIVE( ) Returns the effective annual interest rate on a loan.

FVANNUITY( ) Returns the future value of a series of payments.

FVLUMPSUM( ) Returns the future value of a lump sum.

NOMINAL( ) Returns the annual nominal interest rate.

NPER( ) Returns the periods required to pay off a loan.

PMT( ) Returns the periodic payments required to pay off a loan.

PVANNUITY( ) Returns the present value of a series of payments.


26 ACL for Windows 7 Reference Manual
Summary of Functions

PVLUMPSUM( ) Returns the present value of a lump sum due in a number of periods.

RATE( ) Returns the interest rate per period.

Miscellaneous Functions

FILESIZE( ) Returns the size of a specified file in bytes.

FTYPE( ) Returns the field type of a specified field.

LEADING( ) Returns a character string containing a specified number of leading


digits.

OFFSET( ) Adjusts the starting position of a field in the current record.

RECLEN( ) Returns the length of the current record.

RECNO( ) Returns the current logical record number.

String Access Functions

ALLTRIM( ) Removes leading and trailing blanks from character strings. Does not
affect blanks inside the string.

AT( ) Locates where a specified occurrence of a character string starts


within another character string.

BLANKS( ) Creates a character string of specified length consisting solely of


blanks. Compare with “REPEAT( )” below.

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.

INSERT( ) Inserts characters or blanks at a specified location in a character


string.

LAST( ) Captures a specified number of characters from the end of a string.

LENGTH( ) Calculates the number of characters in a specified string.


Chapter 2 Functions 27
Summary of Functions

LOWER( ) Converts all alphabetic characters of an expression to lowercase.

LTRIM( ) Removes blanks from the beginning of a string.

OCCURS( ) Counts the number of times a character string occurs within a longer
string.

PROPER( ) Converts alphabetic characters in a string to uppercase and lowercase,


in a manner appropriate for proper names.

REMOVE( ) Removes unwanted characters from a character string.

REPEAT( ) Creates a character string that repeats a constant value a specified


number of times. Compare with “BLANKS” above.

REPLACE( ) Replaces all occurrences of one character string with another.

REVERSE( ) Reverses the order of characters in a string.

RJUSTIFY( ) Right-justifies a string to a specified length, and moves any trailing


blanks to the front of the string.

SOUNDEX( ) Returns a four-character value for a string, which can be compared


with the value of another string to see if both strings are phonetically
similar.

SPLIT( ) Returns a specified segment of a character string delimited by


separators such as spaces or commas.

SUBSTRING( ) Returns a substring of a character expression.

TRANSFORM( ) Allows Hebrew characters in a string to display properly.

TRIM( ) Removes blanks from the end of a string.

UPPER( ) Converts all alphabetic characters of an expression to uppercase.


28 ACL for Windows 7 Reference Manual
ABSOLUTE( )

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.

C1 specifies the character string to search for.

C2 specifies the character string to be searched.

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.

For more information, see FIND( ) on page 305.

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

Extracted file name

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( )

Or if the data is mixed case, specify:

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

Extracted file name

In this example, SUBSTR( ) is used to look at the third bit.


Chapter 2 Functions 35
BLANKS( )

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( )

The first parameter is assumed to be stored as either “YYYYMMDD” or “YYMMDD.”


If it isn’t, ACL allows you to specify an optional format string. For example, to convert a
Julian date of the form “YYDDD”, specify:
CTOD(JULIAN_DATE,“YYDDD”)

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.

periods is the number of compounding periods per year. periods is truncated to an


integer.
This function is the opposite of NOMINAL( ).
The result will be returned to eight decimal places accuracy, that is, 0.12345678 or
12.345678%.
If you enter an obviously invalid parameter such as a negative interest rate, ACL returns
an error.

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",)

Finding Characters in a Field


Use the FIND( ) function to find any string of characters within the field you specify.

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.

Finding Characters in a Record


If you leave the field parameter blank, the FIND( ) function searches for that string of
characters in the entire record.
For example, to search for the words “New York” anywhere in the record, do the
following:
1. In the View window, enter FIND("New York") in the filter text box.
2. Click (Set Filter). ACL searches the input file and identifies those records that
have “New York” anywhere in the record.

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.

periods is the total number of payment periods in an annuity.

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( )

The result is returned to two decimal places.


FVANNUITY( ) assumes a present 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.

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.

periods is the total number of periods.

amount is the payment made at the start of the first 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.
Chapter 2 Functions 51
HEXADECIMAL( )

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: By definition, numbers following a decimal are truncated.

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.

For more information, see “TRIM( )” on page 82.


By definition, the length of a character field is always constant.

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:

Use this: To do this:

X,x Match any alphabetic character (a-z, A-Z, European characters)

9 Match any number (0-9)

! Match any nonblank character


58 ACL for Windows 7 Reference Manual
MASK( )

Use this: To do this:

? Match any character

\ Specify that the following character is a literal, regardless of its value

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( )

To extract all records for the research division, specify:

Extract records

Condition

Extracted file name

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.

periods is the number of compounding periods per year. periods is truncated to an


integer.
The result will be returned to eight decimal places, 0.12345678 or 12.345678%.
This function is the opposite of EFFECTIVE( ).
Chapter 2 Functions 63
NPER( )

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.

payment is the payment made each period.

amount is the amount on which payments are based.

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.

periods is the total number of payment periods in an annuity.

amount is the present value; the amount of the investment to be repaid.

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.

periods is the total number of payment periods in an annuity.

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.

periods is the total number of periods.

amount is the payment made at the end of the last 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
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.

payment is the payment made each period.

amount is the amount on which payments are based.

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

Extracted file name

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( )

This function is not case-sensitive, so “SMITH” is equivalent to “smith.”


Use SOUNDSLIKE( ) to identify items that sound similar for the purpose of matching.

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.

If C is not a character expression, ensure that you surround it in quotes.

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( )

To create a filter identifying page headings, specify:


TEST(1,"Page:")

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.

# specifies the length of the ASCII ZONED character field.

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:

ZONED (-6448.95,4) = "489N"

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.

Function Format for Parameters Expressed as Numbers


ZSTAT(v1,v2,v3)
v1 represents the actual count, such as a leading digit or a leading digit combination.

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.

Example with Parameters Expressed as Numbers


Based on 10 years of previous data, you know that the distribution of worker disability
claims per month is normally highly uniform. In April, May, and June of this year, claims
were higher by about 10 percent, averaging 220 per month instead of 200. Claims in July
Chapter 2 Functions 87
ZSTAT( )

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.

Function Format for Parameters Expressed as Proportions


ZSTAT(v1,v2,v3)
v1 represents the actual proportion of the value being tested and must be between 0 and
1 inclusive.
v2 represents the expected proportion of the value being tested and must be between 0
and 1 exclusive.
v3 represents the total number of items being tested and must be a positive whole
number greater than 0.

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.

Example with Parameters Expressed as Proportions


Based on 10 years of previous data, you know that the distribution of worker disability
claims per month is normally highly uniform. In April, May, and June of this year, claims
were higher by about 10 percent, averaging 220 per month instead of 200. Claims in July
88 ACL for Windows 7 Reference Manual
ZSTAT( )

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.

Command Mode Syntax


In command mode, All specifies that a command is to be executed on all fields, expres-
sions, or variables of an appropriate type, usually numeric.
In the following example, All causes the Total command to be executed against all fields
or expressions. Because the Total command can be used only for numeric fields, only
fields of this type are totalled.

&
TOTAL ALL

Command Dialog Box


The All option button is available from the [More] tab. All is selected by default. In the
command dialog box, All specifies that every record is to be processed.

Append/Append to Existing File


Append/Append to Existing File is a scope parameter that adds output produced by a
command to the end of an existing file instead of overwriting it. This parameter is valid
only when a command creates an output file.

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

Command Mode Syntax


In the following example, output from the Extract command is appended to the existing
file Xtract.txt:

&
EXTRACT RECORD TO XTRACT.TXT APPEND

Command Dialog Box


The Append to Existing File check box is available from the [More] tab.

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.

% As can be used in command mode only.

Command Mode Syntax


AS "Replacement_name"
The following command displays results in a field called “Inventory Value” (the
semicolon causes a line break):
Chapter 3 Common Command Parameters 91
Ascending

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.

Command Mode Syntax


Ascending order is implicit. There is no notation for Ascending.
In the following example, the Sort command is executed on the Location, Product Class,
and Quantity on Hand fields. The output is sent to an output file, File2. The sort order
of the output file is ascending for the Location and Product Class, and Quantity on
Hand fields.

&
SORT ON Loc ProdCls QtyOH TO "File2"

Command Dialog Box


Click [Index On], [Sequence On], or [Sort On] and select fields. The sort order button
is displayed with the field name in the Selected Fields list box. The sort order is set by
default to ascending. Click the button to change the sort order.

Sort order button


92 ACL for Windows 7 Reference Manual
Break

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.

Command Mode Syntax

&
See “Key” on page 100.

Command Dialog Box


Break options are available from the [More] tab. To specify a key field, enter a field name
in the Break text box or click [Break] and select a field. To specify more than one key
field, click [Break] and then [Expr] to call up the Expression Builder. You can build an
expression consisting of more than one field by clicking field names and concatenating
them with a plus sign (+). Field names must be surrounded by quotes. For more infor-
mation, see “Expression Builder” on page 247 in the ACL for Windows User Guide.
Chapter 3 Common Command Parameters 93
Descending

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.

Command Mode Syntax


Descending is abbreviated to “D”.
Selected_fields D
In the following example, the Sort command is executed on the Location, Product Class,
and Quantity on Hand fields. The output is sent to an output file, File2. The sort order
of the output file is ascending for Location and Product Class, and descending for
Quantity on Hand.

&
SORT ON Loc ProdCls QtyOH D TO "File2"

Command Dialog Box


Click [Index On], [Sequence On], or [Sort On] and select fields. The sort order button
is displayed with the field name in the Selected Fields list box. The sort order is set by
default to ascending. Click the button to change the sort order.

Sort order button


94 ACL for Windows 7 Reference Manual
End of File

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.

Command Mode Syntax


End of File is abbreviated to “EOF”.
In the following example, the batch will fill variables for each record with the field infor-
mation and then extract out the variables when a blank record is found. The batch
repeats the process for each address. This process works if the pattern of blanks
continues and the last line in the batch also contains a blank. However, if the last line is
not a blank, then the final address can be missed. In this situation, using EOF will force
the Extract command to execute one additional time when the end of the file is reached,
preventing the loss of the last address.
ADDRESS1=ADDRESSMAIN
ADDRESS2=ADDRESSMAIN
ADDRESS3=ADDRESSMAIN
ADDRESS4=ADDRESSMAIN
COUNTER=0
GROUP IF ADDRESSMAIN=" "
EXTRACT ADDRESS1 ADDRESS2 ADDRESS3 ADDRESS4 TO OUT EOF
COUNTER=0
ELSE IF COUNTER=0
ADDRESS1=ADDRESSMAIN
ADDRESS2=" "
ADDRESS3=" "
ADDRESS4=" "
COUNTER=1
ELSE IF COUNTER=1
ADDRESS2=ADDRESSMAIN
COUNTER=2
ELSE IF COUNTER=2
ADDRESS3=ADDRESSMAIN
COUNTER=3
ELSE IF COUNTER=3
ADDRESS4=ADDRESSMAIN
COUNTER=4
END
Chapter 3 Common Command Parameters 95
File

& Command Dialog Box


The EOF check box is available from the [More] tab.

File

%
File specifies that output from a command is to be saved in a separate file. For more
information, see “To” on page 109.

Command Mode Syntax


The parameter “File” is usually omitted from commands as it is assumed by default.s
TO "File_name"
TO FILE "File_name"
In the following example, the Statistics command produces an output file called
Stattest.txt.

&
STATISTICS ON CstDte QtyOH SalePr TO "Stattest.TXT" NUMBER 5

Command Dialog Box


The File option is available from the [Output] tab. To save output in a file, select the File
option, select the type from the File Type drop-down box. Either enter a name in the
Name text box or click [Name] and enter a name in the File Name text box.
96 ACL for Windows 7 Reference Manual
File Type

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).

Command Mode Syntax


See “To” on page 109. File type is specified by the file extension.

Command Dialog Box


See “File” on page 95.

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

Command Mode Syntax


FIRST N
In the following example, First causes the Total command to terminate after 10 records:
TOTAL ALL FIRST 10
The record position will always be 11 after the above command has been executed,

&
regardless of the position at the start of the command.

Command Dialog Box


The First option button is available from the [More] tab.

Footer

%
Footer inserts text at the bottom of each page of a report. This overrides any value set by
a footer variable.

Command Mode Syntax


FOOTER "Footer_text"
In the following example, the Stratify command produces a file which contains a footer.
STRATIFY ON UnCst ACCUMULATE QtyOH MINIMUM 10.00 MAXIMUM 100
INTERVALS 10 TO "UnitCost.TXT" HEADER "***START DATA***"

&
FOOTER "***END DATA***"

Command Dialog Box


The Footer button is available from the [Output] tab. To include a footer in the report,
enter text directly in the Footer text box or click [Footer] and enter text in the Footer
dialog box.
98 ACL for Windows 7 Reference Manual
Graph

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.

Command Mode Syntax


See “To” on page 109.
In the following example, output from the Stratify command is displayed in a graph:
STRATIFY ON UnCst ACCUMULATE QtyOH MINIMUM 10.00 MAXIMUM 100

&
INTERVALS 10 TO GRAPH

Command Dialog Box


The Graph option is available from the [Output] tab.
Chapter 3 Common Command Parameters 99
Header

Header

%
Header inserts text at the top of each page of a report. This overrides any value set by a
header variable.

Command Mode Syntax


HEADER "Header_text"
In the following example, the Stratify command produces a file which contains a header.
STRATIFY ON UnCst ACCUMULATE QtyOH MINIMUM 10.00 MAXIMUM 100
INTERVALS 10 TO "UnitCost.TXT" HEADER "***START DATA***"

&
FOOTER "***END DATA***"

Command Dialog Box


The Header button is available from the [Output] tab. To include a header in the report,
enter text directly in the Header text box or click [Header] and enter text in the Header
dialog box.
100 ACL for Windows 7 Reference Manual
If

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.

Command Mode Syntax


IF Test
In the following example, records having a value of less than 50 in the Quantity on Hand
field are counted:

&
COUNT IF QtyOH < 50

Command Dialog Box


The [If] button is available from the [Main] tab. Enter the condition directly in the If text
box or click [If] to display the Expression Builder. For more information, see
“Expression Builder” on page 247 in the ACL for Windows User Guide.

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.

Command Mode Syntax


KEY Break_fields
In the following example, results of the Stratify command are displayed by product class.
Separate totals are generated for each product class in the source file.
STRATIFY ON QtyOH ACCUMULATE SalePr Value MINIMUM 25 MAXIMUM
100 INTERVALS 10 KEY ProdCls TO SCREEN

Command Dialog Box


See “Break” on page 92.

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.

Command Mode Syntax


In the following example, output from the Classify command is saved to the local drive.
CLASSIFY ON Part_No TO "Parts Summary" LOCAL OPEN

Command Dialog Box


Output options are available from the [Output] tab.
102 ACL for Windows 7 Reference Manual
Name

Name
Name is used to specify the name of the output file created by a command.

Command Mode Syntax

&
See “To” on page 109.

Command Dialog Box


Output options are available from the [Output] tab.

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

Command Mode Syntax


NEXT N
In the following example, Next causes the command to terminate after 10 records:
TOTAL ALL NEXT 10
The record position is set at the first record after 10 records have been processed. For
example, if the record position was 2 at the start of the above command, it will be

&
positioned at 12 after the command has been executed.

Command Dialog Box


The Next option button is available from the [More] tab.

Nodups
Nodups is a field modifier that causes repeated values in a field to be displayed as blanks
in a report.

% Nodups can be used in command mode only.

Command Mode Syntax


Field_names NODUPS
For example, the following Report command suppresses repeated values in the Product
Class field.
REPORT ON Loc ProdCls NODUPS ACCUMULATE QtyOH
104 ACL for Windows 7 Reference Manual
Nozeros

Nozeros
Nozeros is a field modifier that causes zero values in a field to be displayed as blanks in a
report.

% Nozeros can be used in command mode only.

Command Mode Syntax


Field_names NOZEROS
For example, the following Report command suppresses zeroes in the Quantity on
Hand field:
REPORT ON Loc ACCUMULATE QtyOH NOZEROS

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.

% For information on using Open as a command, see “Open” on page 246.

Command Mode Syntax


"New_file" OPEN
In the following example, the Extract command creates a file, “Stockonhand,” and
opens the file automatically.
EXTRACT FIELDS Loc QtyOH TO "Stockonhand" OPEN

Command Dialog Box


See “Use Output File” on page 110.
Chapter 3 Common Command Parameters 105
Page

Page
Page is a field modifier that inserts a page break after the totals for the specified key field.

% Page can be used in command mode only.

Command Mode Syntax


Selected_fields PAGE
For example, the following command produces a report with two levels of subtotals: by
location and by product class within location. After each location subtotal line, the
report continues at the top of a new page.
REPORT ON Loc PAGE ProdCls ACCUMULATE QtyOH

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.

Command Mode Syntax


Picture is abbreviated to “PIC”.
PIC "Format"
For example, the following command causes an output file, Negfile, to be produced. In
Negfile, amounts in the Value field are displayed with a leading dollar sign, separator
commas, and a decimal point.
106 ACL for Windows 7 Reference Manual
Print

Print

% Print specifies that output from a command is to be printed.

Command Mode Syntax


See “To” on page 109.
In the following example, output from the Stratify command is printed:
STRATIFY ON UnCst ACCUMULATE QtyOH MINIMUM 10 MAXIMUM 100

&
INTERVALS 10 TO PRINT

Command Dialog Box


The Print option is available from the [Output] tab.

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.

Command Mode Syntax


In the following example, the Extract command produces an output file containing all
records in which the Unit Cost is greater than zero.

&
EXTRACT RECORD IF UnCst > 0 TO "EXTR_1"

Command Dialog Box


The Record option is available from the [Main] tab.
Chapter 3 Common Command Parameters 107
Screen

Screen

%
Screen specifies that output from a command is to be displayed in the command log for
on-screen review.

Command Mode Syntax


See “To” on page 109.
In the following example, output from the Stratify command is displayed in the
command log:
STRATIFY ON UnCst ACCUMULATE QtyOH MINIMUM 10 MAXIMUM 100

&
INTERVALS 10 TO SCREEN

Command Dialog Box


The Screen option is available from the [Output] tab.

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

Command Mode Syntax


In the following example, only data in the specified range from 25 to 100 appear in the
report:
STRATIFY ON QtyOO MINIMUM 25 MAXIMUM 100 INTERVALS 10
SUPPRESS TO SCREEN

& Command Dialog Box


From the [More] tab, check Suppress Others to limit the action of the command to the
range of values specified on the [Main] tab.
Chapter 3 Common Command Parameters 109
To

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.

Command Mode Syntax


TO SCREEN
TO PRINT
TO GRAPH
TO "File_name"
In the following example, output from the Stratify command is saved to a file called
“Rept1.txt”:
STRATIFY ON UnCst ACCUMULATE QtyOH MINIMUM 10.00 MAXIMUM 100

&
INTERVALS 10 TO "Rept1.TXT"

Command Dialog Box


Output options are available from the [Output] tab.
110 ACL for Windows 7 Reference Manual
Use Output File

Use Output File


By checking the Use Output File check box, ACL opens the file which has been created
by a command. If an input file is already open, ACL closes the open file prior to opening
the newly created file which, in turn, becomes the current input file.

Command Mode Syntax

&
See “Open” on page 104.

Command Dialog Box


The Use Output File check box is available from the [Main] tab.

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.

Command Mode Syntax


WHILE Test
In the following example the Count command is executed, starting at the current record
position, on the Quantity on Hand field as long as the Product Class is 07:
COUNT WHILE ProdCls = "07"
As soon as the command fails the While test, processing stops and the record position is

&
set at the first record that failed the test.

Command Dialog Box


The [While] button is available from the [More] tab. Enter the condition directly in the
While text box or click [While] to display the Expression Builder. For more information,
see “Expression Builder” on page 247 in the ACL for Windows User Guide

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

Command Mode Syntax


FIELDS Field_name WIDTH Value
In the following example, the Export command produces a report containing the
Product Description and Quantity on Hand fields, which have widths of 50 and 25
respectively.
EXPORT FIELDS ProdDesc WIDTH 50 QtyOH WIDTH 25 ASCII TO
"ProdQty"
Chapter 4 C OMMANDS

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.

Dialog Boxes Created with Accept


When ACL encounters the Accept command, it temporarily suspends the batch and
displays a dialog box prompting the user to enter information. Clicking [OK] in the
dialog box instructs ACL to accept the information and resume processing of the batch.
Clicking [Cancel] cancels execution of the batch.
There are two ways to request input from a user. You can have the user enter text in a text
box, or make a selection from a drop-down list. Drop-down lists can contain the names
of fields, variables, or Project items such as batches, IFDs, indexes, views, and reports. To
create a drop-down list, use the optional Fields parameter with one or more of the
field-type identifiers. For more information, see “Field Type Syntax” on page 115.

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.

Command Mode Syntax


Each separate Accept command generates a separate dialog box. To create a dialog box
with multiple prompts, use a single Accept command with multiple prompt strings and
variable names separated by commas.
ACCEPT "prompt-string" <FIELDS "field types"> TO
variable-name <, .... >
prompt-string specifies the message that prompts the user for information during
execution of the batch. The prompt string must be surrounded by quotes and should be
brief.
variable-name specifies the name of the character variable that stores the user’s
response and does not require quotes. If the named variable already has a value, the
dialog box displays it.
field types specify the field types to be displayed in the drop-down list. The field
types must be surrounded by quotes. Field names and variable names can appear in the
same drop-down list. For example, FIELDS "CNLD" generates a drop-down list
containing the names of all fields, and FIELDS "CNLDcnld" generates a drop-down
list containing the names of all fields and all variables.

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

Field Type Syntax

Field type Generates a drop-down list containing

C character fields

c character variables

N numeric fields

n numeric variables

L logical fields (filters)

l logical variables

D date fields

d date variables

xb batches

xf input files

xi indexes

xr views and reports

xw workspaces

Single-Prompt Dialog Boxes


To create a single-prompt dialog box, use only one prompt string for each instance of the
Accept command. Use the following syntax to create a batch named Random_sample
that generates separate prompts for a file name, a drop-down list of fields that can be
sampled, a sampling interval, and a random start value. Note that the % character is
used to refer to the variable name when it represents a file name or a field name.
116 ACL for Windows 7 Reference Manual
Accept

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.

Multiple-Prompt Dialog Box


To create a multiple-prompt dialog box, enter multiple sets of command parameters
separated by commas for one instance of the Accept command, all on the same line, as
follows:
ACCEPT 'Select the field to sample' FIELDS 'N' TO SAMFIELD,
'Enter the sampling interval' TO SAMINT, 'Enter the random
start value' TO RANSTART
The Accept command above produces the following dialog box with one drop-down list
of field names and two text boxes.
118 ACL for Windows 7 Reference Manual
Activate

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

Command Mode Syntax


ACTIVATE <WORKSPACE> workspace-name <OK>
workspace-name specifies the name of the workspace you want to activate for your
current Project.

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:

ACL displays the contents of the file in the command log.

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

& Age Dialog Box


Click (Age) or select Analyze from the menu bar and choose Age to display the Age
dialog box.

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.

Click to select the field,


then use the arrow
or
Double-click the field

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.

Accumulate this field


Click to display calendar

Click arrows or month to


change the month

Click to change year

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

The COUNT column displays the number of records in each category.


The command log shows that the value of transactions that are 30 to 59 days past due
is 54,676.94. This amount represents 22.02% of the total number of records and
11.66% of the total accounts receivable.

%
Items aged over 10,000 days probably constitute invalid date fields.

Command Mode Syntax


AGE <ON> date-field-name <CUTOFF yymmdd>
<ACCUMULATE numeric-field-name>
<INTERVAL>
Interval-start-point
<, ....>
Interval-end-point
<KEY break-field> <+....>
<IF test> <WHILE test> <FIRST|NEXT range>
<TO create-file-name|SCREEN|GRAPH|PRINT>
<HEADER heading>
<FOOTER footer>
<SUPPRESS>
<APPEND>
Chapter 4 Commands 127
Assign

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”.

Command Mode Syntax


<ASSIGN> variable-name = expression <IF test>
ASSIGN is optional in the command syntax, because the “=” sign is the assignment
operator in ACL.
variable-name = expression is interpreted automatically as an assignment.
128 ACL for Windows 7 Reference Manual
Assign

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.

Include Upper and Lower Bounds


Allows you to include upper and lower bounds in your output.
130 ACL for Windows 7 Reference Manual
Benford

Number of Leading Digits


Allows you to specify the number of leading digits to be analyzed. Enter a value from 1
to 6.
For example, if a numeric field called Amount contains the value $-6,234.56, the value
analyzed is:
623 if Leading Digits = 3
62345 if Leading Digits = 5
If a numeric field called Amount contains the value $3.55, the value analyzed is:
355 if Leading Digits = 3
35500 if Leading Digits = 5

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 Dialog Box


Click (Benford) or select Analyze from the menu bar and choose Benford to
display the Benford dialog box.
132 ACL for Windows 7 Reference Manual

%
Benford

Command Mode Syntax


BENFORD ON numeric field LEADING <n> IF <condition> BOUNDS
TO <ACL file|SCREEN|GRAPH|PRINT> HEADER <header> FOOTER
<footer> <WHILE condition> <FIRST> <NEXT> <APPEND> <OPEN>
numeric field specifies the numeric field to analyze.
LEADING <n> specifies the number of leading digits to be analyzed. Assign <n> a
positive value of 1 to 6. The default is 1.
BOUNDS includes the upper and lower bounds in the output.

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”.

Command Mode Syntax


CALCULATE expression <AS "expression-name">
<, ....>
expression You can specify any valid ACL expression subject to the prerequisites
above. See “Expression Builder” on page 247 of the ACL for Windows User Guide for
details on the order of precedence of evaluation of ACL expressions and a list of valid
operators.
134 ACL for Windows 7 Reference Manual
Calculate

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:

Note: ACL rounds the result 86.95 to 87.0.

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.

Classify Dialog Box


Click (Classify) or select Data from the menu bar and choose Classify to display the
Classify dialog box.

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.

The default view of the Prodsale file appears as follows:

% Command Mode Syntax


CLASSIFY <ON> character-field-name
<TO create-file-name|SCREEN|GRAPH|PRINT>
<IF test> <WHILE test> <FIRST|NEXT range>
<ACCUMULATE numeric-field-list>
<INTERVALS=n>
<SUPPRESS>
<HEADER heading>
<FOOTER footer>
<KEY break-field-expression>
138 ACL for Windows 7 Reference Manual
Close

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.

Command Mode Syntax


CLOSE
CLOSE {PRIMARY|SECONDARY|LEARN|INDEX}
CLOSE file-name
INDEX closes the current index.

LOG returns the log file to the default.

PRIMARY closes the primary file.

SECONDARY closes the secondary file.

LEARN closes the currently open Learn file.


Chapter 4 Commands 139
Close

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:

The status bar now indicates that no input file is open.


You can also enter CLOSE PRIMARY.
140 ACL for Windows 7 Reference Manual
Comment

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.

Comment Dialog Box


Click (Comment) or select the Tools menu and choose Comment to display the
Comment dialog box.

% Command Mode Syntax


COMMENT comment-line
or
COMMENT
comment-line
comment-line
...
comment-line allows you to enter text into a log file, a batch or a group.
Chapter 4 Commands 141
Comment

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:

After executing the batch, the comment appears in the results:

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”.

& Count Dialog Box


Click (Count) or select Analyze from the menu bar and choose Count to display the
Count dialog box.

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.

Command Mode Syntax


COUNT <IF test> <WHILE test> <FIRST | NEXT range>
144 ACL for Windows 7 Reference Manual
Define Field

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

Command Mode Syntax


You must include the entire field definition in a single command line. You cannot have
ACL prompt you for parameters.
DEFINE FIELD field-name field-type start-position
field-length <decimals|date format> <AS "alternate column
title"> <WIDTH> <PIC "format">

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.

Unconditional Computed Field


DEFINE FIELD field-name COMPUTED expression ¿
<AS "alternate column title"> <WIDTH> <PIC "format">

Conditional Computed Field


Always put the first condition and value pair on the third line. Leave the second line
blank if you are not including an IF condition, a static modifier, a field description, or an
AS, WIDTH, or PIC clause.
DEFINE FIELD field-name COMPUTED ¿
<IF condition> <static> <AS field-description> <WIDTH> <PIC
"format"> ¿
<value IF condition> ¿
<value IF condition> ¿
<value IF condition> ¿
default value
146 ACL for Windows 7 Reference Manual
Define Field

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.

value specifies a value based on the condition.

default value specifies the value if none of the conditions is met.

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.

Command Mode Syntax


DEFINE REPORT view-name
view-name allows you to access an existing view or create a new view with the
specified name. If you give the view a two-word name, be sure to include the underscore
character between the two words.
150 ACL for Windows 7 Reference Manual
Delete

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

Command Mode Syntax


DELETE {field-name|variable-name|file-name|ALL} <OK>
DELETE HISTORY <number-to-retain>
DELETE RELATION <OK>
DELETE BATCH <batch-name>
DELETE FORMAT <input file definition-name>
DELETE REPORT <view-name>
DELETE WORKSPACE <workspace-name>
DELETE INDEX <index-name>
Number-to-retain indicates the number of histories to retain. You can use the SET
HISTORY command to set the maximum number of histories to retain. For example,
the command SET HISTORY 4 means that the number of histories retained never grows
beyond four.
FORMAT <input file definition-name> deletes the specified input file
definition, its default view, and its associated indexes and relations. All other views for
the specified input file definition are retained. If you select the preference Delete Data
File with Input File Definition in the Edit ACL Preferences dialog box, the data file
linked to the input file definition is also deleted.

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

Creating a Custom Dialog Box


To create a custom dialog box, follow these steps:
1. Display the batch window by doing one of the following:
 In the Overview window, select Batches and click (New).
 In the Overview window, double-click the batch in which you want to create a
dialog box. ACL asks if you want to edit or run the batch. Click [Edit].

Build new 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

Definition area Resize handle


Chapter 4 Commands 155
Dialog

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

Check box Radio buttons

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].

Project Item Lists


A Project item list displays a drop-down list of items that are in your ACL Project. Only
one item can be selected. This control creates a text variable. You can display one or
more definitions including:
 Character, numeric, logical, or date fields
 Character, numeric, logical, or date variables
 Input file definitions
 Batches
162 ACL for Windows 7 Reference Manual
Dialog

 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).

Editing a Custom Dialog Box


You can edit a custom dialog box either while you are still working in the Dialog Builder,
or after you have added it to a batch.

Editing a Dialog Box in the Dialog Builder


To edit a dialog box while you are still working in the Dialog Builder, follow these steps:
1. Double-click anywhere in the definition area where there is no control. ACL displays
the dialog edit box.

2. Edit parameters for the dialog box.


3. Click [OK].
164 ACL for Windows 7 Reference Manual
Dialog

You can also change the size of the dialog box by dragging the resize handle at the
bottom right corner of the definition area.

Editing a Dialog Box in a Batch


To edit a dialog box after you have added it to a batch, do the following:
1. In the Overview window, double-click an existing batch or drag the icon of an
existing batch onto the application workspace. ACL displays a dialog box asking
“Would you like to edit or run batch?”
2. Click [Edit]. ACL displays the batch window.
3. Select the Dialog command in the command line.

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

Command Mode Syntax


The command mode syntax for the Dialog command consists of a set of basic param-
eters and a set of parameters for each control in the custom dialog box.
Parameter sets are enclosed in parentheses. By default, a Dialog command includes a set
of parameters for the dialog box itself and the OK/Cancel button set. Parameter sets for
other controls follow the button set.
DIALOG (DIALOG TITLE "text" WIDTH px_value HEIGHT px_value)
(BUTTONSET TITLE "&OK;&Cancel" AT x_coord y_coord DEFAULT
number) OTHER_PARAMETER_SETS
(CHECKBOX TITLE "text" TO "variable" AT x_coord y_coord
WIDTH px_value HEIGHT px_value)
(DROPDOWN TITLE "item1;item2;..." TO "variable" AT x_coord
y_coord WIDTH px_value HEIGHT px_value DEFAULT number)
(EDIT TO "EDIT1" AT x_coord y_coord WIDTH px_value HEIGHT
px_value DEFAULT "text")
(ITEM TITLE "item_index" TO "variable" AT x_coord y_coord
WIDTH px_value HEIGHT px_value DEFAULT "item_category")
(RADIOBUTTON TITLE "item1;item2;..." TO "variable" AT
x_coord y_coord WIDTH px_value HEIGHT px_value DEFAULT
number)
(TEXT TITLE "text" AT x_coord y_coord WIDTH px_value HEIGHT
px_value)
text specifies a text string.

px_value specifies a pixel value.

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.

item_index specifies categories in a Project item list. Each category is represented by


a letter.
item_category specifies the default Project item category.
166 ACL for Windows 7 Reference Manual
Dialog

Project Item Category Syntax

Project Item Category Index

Batches b

Character Fields C

Character Variables c

Date Fields D

Date Variables d

Indexes i

Input File Definitions f

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.

Command Mode Syntax


DISPLAY <PRIMARY>
DISPLAY SECONDARY
DISPLAY DATE |TIME
DISPLAY VARIABLES
DISPLAY HISTORY
DISPLAY FREE |SPACE
DISPLAY VERSION
DISPLAY OPEN
DISPLAY RELATION

Example
To display the input file definition for the primary file, Inventory, enter the following
into the command log:

ACL displays the result in the command log:


Chapter 4 Commands 169
Do Batch

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”.

Do Batch Dialog Box


Click (Do Batch) or select Tools from the menu bar and choose Do Batch to display
the Do Batch dialog box. The Do Batch list box allows you to select the batch to be run.
If no batches have been created, the list box is empty.
170 ACL for Windows 7 Reference Manual
Do Batch

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.

The results are displayed in the command log.


Chapter 4 Commands 171

%
Do Batch

Command Mode Syntax


DO <BATCH> batch-name <IF test|WHILE test>
If you use a WHILE test in a DO BATCH command, the processing speed is substantially
slower because the commands in the batch are repeated for each call made.
When using WHILE in a DO BATCH command, ensure that your test eventually turns
false because there is no protection against “infinite loops”. If you do create an infinite
loop, press ESC to break out of it.
172 ACL for Windows 7 Reference Manual
Do Report

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.

Command Mode Syntax


DO REPORT report-name
report-name allows you to specify the report to be printed. Because a report is
generated from a view, enter the view name as the value for this parameter. If the view is
named with two words, be sure to include the underscore character between the words.
Chapter 4 Commands 173
Dump

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.

Dump Dialog Box


Click (Dump) or select Tools from the menu bar and choose Dump to display the
Dump dialog box.

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.

Command Mode Syntax


In command mode, you can either display a file, or a record of a currently open file.
To display a file in blocks of 16 characters on the screen in hexadecimal, ASCII, and
EBCDIC format:
DUMP file-name <SKIP n>
<COLUMNS c>
<HORIZONTAL>
To display the contents of the current record in the primary file in hexadecimal, ASCII,
and EBCDIC format when a primary file is already open:
DUMP RECORD
<COLUMNS c>
<HORIZONTAL> TO <FILENAME>
To display a particular record, use the LOCATE command. For example, if you enter
LOCATE RECORD 13 on the line above DUMP RECORD, DUMP displays record 13.

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.

Duplicates Dialog Box


Click (Duplicates) or select Analyze from the menu bar and choose Duplicates to
display the Duplicates dialog box.

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”.

Else Dialog Box


Click (Else) in a batch window to display the Else dialog box.

Example

%
See “Group” on page 202.

Command Mode Syntax


ELSE <IF test>
178 ACL for Windows 7 Reference Manual
End

& 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.

Command Mode Syntax


END

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.

How Evaluate Works


The Evaluate command uses the original sampling parameters and any errors found in
the sample to calculate the upper error limit for the population.
For record samples, the UEL is the rate of error (expressed as a percentage) that you are
confident is not exceeded. For example, you can be 90% confident that the total error
rate does not exceed 6.5%.
For monetary samples, the errors recorded are processed and reported in detail. The
report includes the effects of each error and shows the most likely amount of total error
and the UEL expressed as a monetary amount. This is the amount you are confident that
180 ACL for Windows 7 Reference Manual
Evaluate

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.

How ACL Evaluates Sampling Errors


In evaluating sampling errors, ACL uses the upper error limit cumulative factors of the
Poisson distribution.

Record Sample Evaluation


ACL uses the following formula to evaluate record errors:

UEL Cumulative Factor


Upper Error Limit Frequency =
Sample Size

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.

Monetary Sample Evaluation


ACL uses a slightly more complex formula to evaluate monetary errors, but the formula
is also based on the UEL cumulative factors for the Poisson distribution:
 The basic precision is the amount of error we are confident of not exceeding if no
errors are reported for the sample. It is determined by multiplying the sampling
interval by the Poisson UEL factor for the specified confidence (assuming no
errors).
 For each error entered, the percentage of tainting is determined by dividing the
error amount by the recorded item amount.
 For each error entered, an estimate of the most likely error in the population is
determined.
For items smaller than the selection interval, the most likely error is the tainting
percentage multiplied by the interval used for selection. This calculation is based
on the fact that the particular item selected was not certain to be selected, and
therefore is representative of other errors in the population.
For items equal to or greater than the interval (top stratum items), the most likely
error is the amount of the error. The previous formula does not apply because all
top stratum items are selected, and therefore the error is not representative of
others in the population.
 On completing the error entry, the errors are sorted in decreasing size of most
likely error amount, with top stratum and understatement items listed at the end.
 A precision adjustment factor is calculated for each error.
For items smaller than the sampling interval, the precision adjustment factor is
the most likely error multiplied by the UEL cumulative factor for that error
Chapter 4 Commands 181
Evaluate

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.

Evaluate Dialog Box


Click (Evaluate) or select Sampling from the menu bar and choose Evaluate to
display the Evaluate dialog box. By default, ACL displays the options for monetary unit
sampling.
Chapter 4 Commands 183
Evaluate

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:

Enter level of confidence


Enter number of sample items tested
Enter number of errors found in sample

The result is:

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:

Enter level of confidence


Enter interval used for sample tested

Enter recorded amount of sample item


and amount of error found in that item.
Separate with a comma.

The results are:

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.

Command Mode Syntax


EVALUATE RECORD CONFIDENCE confidence-level SIZE sample-size
ERROR number-of-errors
EVALUATE MONETARY CONFIDENCE confidence-level ERRORLIMIT
item-amount,error
INTERVAL monetary-interval
186 ACL for Windows 7 Reference Manual
Export

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.

Using Export with the ACL Client/Server System


During an active session, Export always directs output to the client. Consequently, you
cannot export files to the server. To create a data set that can be used on the server, use
Extract instead. For more information, see “Extract” on page 189.

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

& Export Dialog Box


Click (Export) or select Data from the menu bar and choose Export to display the
Export dialog box.

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.

Command Mode Syntax


EXPORT <FIELDS> field-list TO create-file-name
<IF test> <WHILE test> <FIRST|NEXT range>
{ASCII|DBASE|DELIMITED|EXCEL|LOTUS|WORD|WP|WDPF6
|CLIPBOARD}
<APPEND>
Chapter 4 Commands 189
Extract

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

& Extract Dialog Box


Click (Extract) or select Data from the menu bar and choose Extract to display the
Extract dialog box.

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:

% Command Mode Syntax


EXTRACT {RECORD|<FIELDS> extract-fields} TO create-file-name
<IF test> <WHILE test>
<FIRST|NEXT range>
<EOF>
<APPEND><OPEN>
Chapter 4 Commands 193
Fieldshift

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

& Shift Fields Button


To shift fields using the Shift Fields button:
1. Select Edit from the menu bar and choose Input File Definition to display the Input
File Definition window.
2. From the list of fields on the [Edit Fields/Expressions] tab, select the name of the
leftmost data field of those fields that you want to shift. Then click (Shift Fields)
to open the Shift Fields dialog box.
Or you can click the Shift Fields button to open the Shift Fields dialog box, then
enter the starting byte of the first data field that you want to shift in the Start Shifting
Fields From position text box.
To display fields in order of their start positions from left to right, click the heading
titled Start in the list view on the [Edit Fields/Expressions] tab.
In multiple record-type files, you can shift fields related to a particular record type
by first selecting the name of the filter that identifies these fields from the drop-down
list on the [Edit Fields/Expressions] tab.
3. Enter the number of bytes that you want the fields to shift in the Shift fields by the
following number of bytes text box. Enter a positive number to move the fields to
the right, or a negative number to move the fields to the left.
4. Click [OK], then click [Yes] to confirm the realignment.
Click to display fields in order of their
start positions, left to right.

Select filter name


for specific
record type
fields.
Shift Fields button

Enter the starting


byte of the field
to shift and the
number of bytes
to shift, then click
[OK].
Chapter 4 Commands 195

%
Fieldshift

Command Mode Syntax


FIELDSHIFT START starting_position COLUMNS bytes_to_shift
<data_filter_name> <OK>
starting_position specifies the byte position of the first field you want to shift.

bytes_to_shift specifies the number of bytes to shift.

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.

File History Menu Item


Click (File History) or select Tools from the menu bar and choose File History. This
issues the Display History command. For more information and command mode
syntax, see “Display” on page 167.

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.

In the command log text box, enter DISPLAY HISTORY.


The file history shows the date and time the file Negative_value was created, and that it
was created by extracting all records from the inventory file that had a negative value or

%
quantity on hand.

Command Mode Syntax


See “Display” on page 167.
198 ACL for Windows 7 Reference Manual
Find

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.

Command Mode Syntax


FIND character-search-key
character-search-key indicates the value of the key to be found.

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.

Gaps Dialog Box


Click (Gaps) or select Analyze from the menu bar and choose Gaps to display the
Gaps dialog box.
Chapter 4 Commands 201
Gaps

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”.

Group Dialog Box


Click (Group) within a batch to display the Group dialog box.

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.

Command Mode Syntax


Each Group command must be closed with an End command. Within a group, you can
specify If or While parameters to test for a condition, and Else to specify what happens
to records that do not meet the condition.

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.

GROUP <IF test> <WHILE test> <FIRST|NEXT range>


commands
...
<ELSE> <IF test>
commands
...
END
You can also include a Loop command within a group when you need to execute a series
of commands more than once against repeating information in a particular record. The
Loop command behaves similarly to the Group command, except that the commands
between Loop and End are executed repeatedly against the current record until the
result of the test is false. For more information, see “Loop” on page 237.
204 ACL for Windows 7 Reference Manual
Group

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.

Is ProdCls < 05?

If yes, execute the Count, Histogram and Classify commands

Otherwise, is it equal to 05?

If yes, total the QtyOH field for all records in which ProdCls=05

Otherwise, is it equal to 06?

If yes, total the QtyOH field for all records in which ProdCls=06

Otherwise, is it equal to 07?

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.

& Help Button


Select Help from the menu bar and choose Contents or click
bar.
(Help) on the button

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.

Command Mode Syntax


HELP
In a batch window, you can select the name of a command to get help for the selected
command.
Help information is not recorded in the command log.
208 ACL for Windows 7 Reference Manual
Histogram

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.

Histogram offers the following options:


 A histogram of numeric fields with a specified number of equally-sized intervals.
 A histogram of numeric fields with intervals of varying size. The Free option lets
you specify the interval sizes.
 A histogram of nonnumeric fields or expression values. A histogram bar is
displayed for each unique value of the field or expression. These values are
displayed in ascending sorted order.
You can autoexecute this command.
To autoexecute, see “Command Options” on page 288 of the ACL for Windows User
Guide.

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

& Histogram Dialog Box


Click (Histogram) or select Analyze from the menu bar and choose Histogram to
display the Histogram dialog box.

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.

ACL also produces a character-based representation of the graph in the command


log. You can call up the graph by double-clicking <<<Graphable Data>>> or any
of the text of the histogram results in the command log.
212 ACL for Windows 7 Reference Manual
Histogram

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.

% Command Mode Syntax


HISTOGRAM <ON> numeric-field-name <INTERVALS=n>
MAXIMUM=max
MINIMUM=min
HISTOGRAM <ON> numeric-field-name FREE
Interval-start-points
Final-interval-end-point
HISTOGRAM <ON> character-field-name
You can add the following options to each syntax format:
<TO create-file-name|SCREEN|GRAPH|PRINT>
<IF test> <WHILE test>
<FIRST|NEXT range>
<HEADER heading>
<FOOTER footer>
<KEY break-field <+ ....>>
<SUPPRESS>
<COLUMNS=n>
<APPEND>
214 ACL for Windows 7 Reference Manual
If

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.

Command Mode Syntax


IF test command

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.

ODBC Option Button


In menu mode, you can import an ODBC database by selecting the ODBC option
button in the Data Source dialog box. For more information, see “Importing ODBC

%
Data” on page 125 of the ACL for Windows User Guide.

Command Mode Syntax


IMPORT ODBC SOURCE source-name
TABLE table-name
<QUALIFIER data-qualifier>
<OWNER user-name>
<USERID user-id>
<PASSWORD n>
<WHERE where-clause>
<TO <path>ifd-name>
<WIDTH max-char-column-width>
<MAXimum max-text-width>
<FIELDS field-list...>
216 ACL for Windows 7 Reference Manual
Index

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.

Indexing versus Sorting


The Index command, as an alternative to the Sort command, is usually faster, and the
resulting index file is generally much smaller. However, processing in an indexed file
sequentially is significantly slower than processing a sorted file.
The following table compares the benefits and drawbacks of the Sort and Index
commands.

Sorting Indexing

Execution speed Slower Faster

Resulting file size Larger Smaller

Required disk space More Less

Subsequent processing of an Much faster Much slower


entire file

Subsequent processing Much slower Much faster


searching for a few records
Chapter 4 Commands 217
Index

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.

Filters and Conditions


If you create an index using a filter, ACL displays “Filtered Index” in the status bar to let
you know you are only referencing the part of the file that matches the filter’s condition.
A conditional index eliminates records that do not meet a specified condition. This
allows you to create separate index files for subsets of a larger file for later manipulation.
Do not include a condition if you want the entire file to be indexed.
In addition to an If test, you can select the [More] dialog box and specify While, Next,
and First parameters. Only the records from the open input file which meet the specified
condition have pointers in the resulting index file. If processing is terminated early by
one of these parameters, the subsequent records are not included in the index file and
cannot be accessed when using it. It may not always be obvious that you are not working
with the entire file. To verify that you are working with an Indexed file, look for the word
“Filtered Index” on the status bar. Only records that have met the condition are
processed by the commands executed while the index is active.

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

& Index Dialog Box


Click (Index) or select Data from the menu bar and choose Index to display the
Index dialog box.

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

3. Enter a name for the index file in the To text box.


4. Click [OK] to close the dialog box and execute the Index command. ACL lists the
index in the Overview window under the associated input file definition and under
Indexes.

Example
To alphabetize a customer file for easy reference, use Index.
Index on the customer name field to the index file, Customer_name.

Before indexing the customer file looks like this:


222 ACL for Windows 7 Reference Manual
Index

After indexing, the file appears like this:

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.

Command Mode Syntax


INDEX <ON> key-field <D>... TO create-file-name
<IF test> <WHILE test> <FIRST|NEXT range>
<OPEN>
Chapter 4 Commands 223
Join

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.

Join Versus Relations


Join and Relations both allow you to work with data from more than one file. Join
provides several include/exclude options that are not available through Relations.
However, certain kinds of analyses are more easily performed with Relations.
Depending on the type of analysis required, one command may be more efficient than
the other.
Join allows you to combine data from two different files, with output going to a third file
consisting of matched or unmatched data, depending on the type of Join you specify.
Relations allows you to create virtual joins between files. Data from separate but related
files can be analyzed as though it existed in a single file.
In both cases, you need a key field common to the two files to be joined or related.
Join uses more disk space than Relations for three reasons:
 For a Join, you must sort the secondary file and preferably sort or index the
primary file as well. But to relate two files, you need to index only one file. Sorting
creates a new data file as large as the original one. Indexing creates a small index
file that points to the original file.
 Join creates a new file that can be larger than both the primary and secondary
files together, depending on the type of Join performed. Relations does not write
a new file. If you need a file that contains the related data, you can create one by
extracting the related fields using the Extract command.
 To join four files, you need to perform three sorts and three joins. To relate four
files, you need the original file and three indexes on the remaining files.
224 ACL for Windows 7 Reference Manual
Join

Join Output Options


The Join command has five output options, based on key field comparisons. The output
option you choose determines which records are included in the output file. The
following table illustrates which records are included in the output file for each option.

Matched Matched Unmatched Unmatched


Option Primary Secondary Primary Secondary

Matched Records Y Y

Matched Records: All Y Y Y


Primary

Matched Records: All Y Y Y


Secondary

Matched Records: All Y Y Y Y


Primary and All Secondary

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.

Matched Records: All Primary


Creates an output file of selected fields from the primary and secondary files for all
records in the primary file, including those with no matches in the secondary file. The
fields for those records with no secondary file match are filled with blanks or nulls,
depending on the field type.
Non-matching records from the secondary file are ignored.

Matched Records: All Secondary


Creates an output file of selected fields from the primary and secondary files for all
records from the secondary file, including those with no match in the primary file. Fields
for those records with no match in the primary file are filled with blanks or nulls,
depending on the field type.
Non-matching records from the primary file are ignored.
Chapter 4 Commands 225
Join

Matched Records: All Primary and All Secondary


Creates an output file of selected fields for all records from both primary and secondary
files, whether the records have matches or not. The fields for unmatched records from
either file and duplicates from the secondary file are filled with blanks or nulls,
depending on the field type.

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.

The IMS One to Many Option


Users with a client/server connection to an IMS database can also perform joins that
include an IMS dataset as the secondary file. Select this option to perform a
one-to-many type of join with an IMS dataset as the secondary file.

Note: ACL supplies an error message to the command log if the IMS secondary file is not
HDAM.

Output File Field Names


If any fields in the primary and secondary files have the same name, Join automatically
assigns a new name to the secondary field in the output file. For example, if both files
contain a field named Amount, Join tries to name the secondary field Amount2,
Amount3, and so on, until it finds a name that does not conflict with any field names in
the output file.

Source File Locations


Both of the files that you join must belong to the same ACL Project. Similarly, in a
client/server environment, you can log on to only one server at a time so the files you
join must reside on the same server. Consequently, you cannot join a client file to a
server file.
226 ACL for Windows 7 Reference Manual
Join

Preparing Key Fields


You can select more than one key field. You might want to do this, for example, if you had
one supplier with the same vendor number in different locations. To capture all records
for this vendor, regardless of location, you could select both supplier and location fields
as key fields. You would then need to select two corresponding key fields in the
secondary file, too.
Before using Join, you must sort the secondary file in ascending sequence on the key
character fields. While not mandatory, it is also recommended that you sort the primary
file on the key fields. You can do this by selecting the Presort check box in the Join dialog
box. Or you can index the primary file instead of sorting it.
You can use Join with an unsorted primary file but for large joins, processing time
increases dramatically. If the primary file is partially sorted on the key field, as would
happen when a file is sorted by account code for individual months, processing time
increases, but not as dramatically.
Key fields must be character fields. Their lengths must be the same in both the primary
and secondary files. If fields are not identical, you can use various ACL functions, such
as String( ), Date( ), and Substring( ), to convert fields from one data type to another
and to modify their structures, making them suitable for use as key fields.
To convert numeric fields to character format, see “STRING( )” on page 79. Also see
“Expression Builder” on page 247 of the ACL for Windows User Guide and Chapter 2:
“Functions” of this manual for other modifications you can make.

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”.

IMS One to Many


Includes the records of an IMS dataset in the output file. This option is enabled only if
the secondary file is an IMS dataset.

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.

Matched Records: All Primary


Includes matched records from the primary and secondary files and unmatched records
from the primary file in the output file.
Chapter 4 Commands 227
Join

Matched Records: All Secondary


Includes matched records from the primary and secondary files and unmatched records
from the secondary file in the output file.

Matched Records: All Primary and All Secondary


Includes all records from both the primary and secondary files in the output file.

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

& Join Dialog Box


Click (Join) or select Data from the menu bar and choose Join to display the Join
dialog box.

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

Command Mode Syntax


There are five variations of Join in command mode:
JOIN
JOIN {PRIMARY|BOTH}
JOIN SECONDARY
JOIN PRIMARY SECONDARY
JOIN UNMATCHED
You can also add any of these options to the syntax format:
<FIELDS> primary-field-list
<PRESORT>
WITH secondary-field-list
<IF test> <WHILE test> <FIRST|NEXT range>
TO create-file-name
PKEY primary-key-field-list
SKEY secondary-key-field-list
<OPEN>
<APPEND>
<MANY> allows you to perform a one-to-many join when you have a client/server
connection and your secondary file is an IMS database.
232 ACL for Windows 7 Reference Manual
List

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.

Command Mode Syntax


LIST {<FIELDS>list-fields|ALL} <TO file-name>
LINE n list-fields
<UNFORMATTED>
<IF test> <WHILE test> <FIRST|NEXT range>
<HEADER heading>
<FOOTER footer>
<SKIP n>
<EOF>
<APPEND>
list-fields specifies the fields to be listed. Any field or expression may be used.
Enter ALL to list every defined field. When used with the LINE parameter, list-fields
specifies the fields or expressions to be listed on that line.
LINE n can be a value between 2 and 60.

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

Enter the following into the command log text box:


LIST PRODNO PRODDESC QTYOH UNCST VALUE IF QTYOH < 0 OR UNCST
< 0 HEADER ‘NEGATIVE VALUES’
The result of the List command appears in the command log.

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”.

Command Mode Syntax


LOCATE <IF test> <WHILE test> <FIRST|NEXT range>
LOCATE RECORD n
n record number to be located.

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”.

Loop Dialog Box


Click (Loop) in a batch window to display the Loop dialog box.

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

5. Click [OK] to close the Loop dialog box.


6. Enter commands.

%
7. Enter an End command to close the loop.

Command Mode Syntax


Each Loop command must be closed with an End command. Within a loop, you must
specify While parameters to test for a condition. The commands between Loop and End
are executed repeatedly for the current record as long as the test specified is true. If the
test is initially false, the commands are not executed.

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.

LOOP WHILE test


commands
...
END

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.

See “Extract” on page 189 for other possible alternatives.

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

& Merge Dialog Box


Click (Merge) or select Data from the menu bar and choose Merge to display the
Merge dialog box.

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.

Command Mode Syntax


MERGE ON key-field-list
MERGE PKEY primary-key-fields SKEY secondary-key-fields
You can add the following options to either syntax format:
TO create-file-name
<PRESORT>
<IF test> <WHILE test> <NEXT|FIRST range>
<APPEND>
<OPEN>

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

& Notify Dialog Box


Select File from the menu bar and choose Notify to display the Notify dialog box. The
information you provide depends on whether you are sending local or remote e-mail.
Not all protocols require that you enter information in every text box.

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

% Command Mode Syntax


NOTIFY USER username <PASSWORD xxxx> MAILBOX pathname
ADDRESS recipient MESSAGE message
246 ACL for Windows 7 Reference Manual
Open

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

Command Mode Syntax


OPEN input-file-name
OPEN {data-file-name|TAPE}
<FORMAT input-file-name>
<BUFFERLENGTH n>
<CRLF>
<DBASE>
<INDEX index-file-name>
<PRIMARY|SECONDARY>
<SKIP value>
<RELATION key-expression>
input-file-name is the name of the input file you want to open (as displayed in the
Overview window if already created). The data file that was last used is also selected.
data-file-name is the name of the new data file to be associated with the input file
specified after the Format parameter. This data file replaces the previous one until a
different file is specified.
key-expression is a character type expression, based on already opened files, that
will be used to locate related records in this file.

Example 1
To open an accounts receivable input file, Ar, use Open. Enter the following into the
command log text box:

The status bar indicates that the Ar file is open.

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.

Command Mode Syntax


PASSWORD n <prompt>
n must be a value from 1 to 5.

prompt may be any valid character expression.

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”.

Command Mode Syntax


PAUSE message <IF test>
message specifies any valid character string of up to 200 characters.

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

& Profile Dialog Box


Click (Profile) or select Analyze from the menu bar and choose Profile to display the
Profile dialog box.

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.

ACL displays the result in the command log.


Chapter 4 Commands 253
Profile

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.

Command Mode Syntax


PROFILE numeric-field-list
<IF test> <WHILE test> <FIRST|NEXT range>
254 ACL for Windows 7 Reference Manual
Quit

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.

Command Mode Syntax


QUIT
Chapter 4 Commands 255
Random

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.

Random Dialog Box


Click (Random) or select Tools from the menu bar and choose Random to display
the Random dialog box.
Chapter 4 Commands 257
Random

Example
To generate 10 unique random numbers between 1 and 1000 sorted in ascending order,
in 2 columns, use Random.

The 10 numbers appear in the command log.

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

Command Mode Syntax


RANDOM NUMBER=n
<SEED seed-value>
MINIMUM min
MAXIMUM max
<UNIQUE>
<COLUMNS columns-in-output>
<SORTED>
<TO file-name|PRINT>
<APPEND>
Chapter 4 Commands 259
Refresh

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.

Refresh from Source File Button


The Refresh from Source File button is available only if you obtained the data file
through ODBC.
 In the Overview window, select the input file definition name. Then click
(Refresh from Source File).
 In the Input File Definition window, click (Refresh from Source File) on the
[Input File Options] tab. ACL asks if you are sure you want to refresh the data

%
from its source. Click [Yes].

Command Mode Syntax


REFRESH input-file-definition-name <PASSWORD n>
input-file-definition-name is the name of the input file definition that you
created through the original ODBC import. When you refresh this file, its associated
data files are updated and overwritten without prompting.
260 ACL for Windows 7 Reference Manual
Refresh

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.

Parent and Child Files


Data relationships created with the Relations command are hierarchical. The primary
file is called the parent file, and the dependent files are called related or child files. A
parent can have many child files. Child files can be parents, too, with child files of their
own. A parent file can also be related to itself. A grandchild relation has to be created
from the parent.
You begin a relationship by opening a parent file in the view. The parent file does not
have to be sorted or indexed. Once a relationship is established, you can add fields from
the child file to the view, or access them in other ways for analysis. The related fields can
be viewed only in the parent file.
ACL lets you name each relationship individually. This lets you establish more than one
relationship between a parent file and a related file, and lets you relate a parent file to
itself.
An originating ACL parent file can actively reference information from up to 17 related
files. An ACL Project can have many originating parent files. ACL stores all relationships
and related fields in the ACL Project until you delete them.
There is a many-to-one relationship between a parent and a child file. The parent file can
have duplicate or missing records in the key field. A child file should not have duplicate
or missing records in the key field.
ACL compares the two files according to the contents of the key field, record by record.
The contents of the key field in each file must be identical to obtain a match. When the
data in the key field is identical, ACL can relate, or virtually join, the record data in the
child file to the corresponding record in the parent file.
262 ACL for Windows 7 Reference Manual
Relations

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.

Prerequisites for Relating Files


The files that you relate must each contain a key field, and must be defined within the
same ACL Project. When working with the ACL Client/Server System, all files to be
related and their indexes must reside on the same server. You cannot relate a file on the
local drive to a file on the server.
Before you can relate two files, you must:
 Make sure that the key field is ASCII
 Make sure that each file has a key field
 Make sure that the key fields are normalized
 Index the related (child) file on the key field

Choosing Key Fields


The key field is the common element that allows the data from the two files to be related.
For meaningful results, key fields must be identical in every way, except their name. Key
fields must have the following characteristics:
 They must be character fields
 They should have the same field length
 They should have the data aligned the same way (left or right)
 They should have the data formatted in the same way (same spelling, same use of
capitalization, same punctuation)
Key fields can also be computed fields. That is, you can create a computed field to act as
the key field.

Normalizing Key Fields


The key fields in both parent and child files must be character fields or expressions,
identical in structure. Sometimes it is necessary to modify or normalize the contents of
a field before it can be used as a key field. You can use ACL functions to convert fields to
character format and to modify their contents.
You can use functions in the Expression Builder such as STRING( ) or DATE( ) to
convert fields to character format. See “Expression Builder” on page 247 of the ACL for
Windows User Guide for more details. Other functions allow you to combine two fields
Chapter 4 Commands 263
Relations

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.

Choosing Related Files


There are several factors to consider before deciding which file should be the parent, and
which should be the related or child file:
Consider the many-to-one relationship between the keys of the parent file and the keys
of the related file. ACL matches each key in the parent file with the first matching key in
the related file. This may affect your decision about which file should be the parent and
which should be the related file.
Another way of saying this is that the parent file should contain all the records you want
to analyze. For example, if you have an Accounts Receivable (Ar) file with 500 invoices
(records) and a Customer file with 100 records, choosing the Ar file as the parent file
allows you to analyze all 500 invoices. On the other hand, if you choose the Customer file
as the parent file, you can only analyze 100 records, that is, one invoice for each
customer.
Consider also that the relationship is established in one direction, from the parent to the
child. Only a parent file can access fields from a child file. A child file has no information
about its parent file.
Finally, remember that related files must be defined within the same ACL Project as the
parent file.

Indexing Related Files on their Key Fields


Once you have selected the related file and made sure the key field is normalized, you
need to index the related file on the key field using the Index command. For more infor-
mation, see “Index” on page 216.

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.

Planning Relations Between Data Files


Successful data relations require careful planning. Determine which files contain fields
you need to relate, and consider the most effective way to relate them.
For example, you may need to analyze data that is found in several different files. You
will need to identify which files contain the data fields you need, and which additional
fields could serve as key fields. It is often useful to create a diagram, similar to the one
below, to identify the relationship possibilities.

Ar (parent file) Customer (child file)

Invoice No. Customer Number


Invoice Date Customer Name
Customer Number Address
Contract Number Credit Limit
Invoice Amount

Fields to be compared

Contract (child file) Sales Rep (child file)

Contract Number Sales Rep Number


Contract Date Sales Rep Name
Contract Type Address
Sales Rep Number YTD Sales

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.

Both files related on Cust No as key field

Ar (parent file) Customer (child file)

Ar with fields from Customer added

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].

Parent Child Key Field Relation Name

Ar Customer Customer number Customer

Ar Customer New key field Customer 2

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

& Relations Dialog Box


Click (Relations) on the button bar or select Data from the menu bar and choose
Relations to display the Relations dialog box.

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.

7. Click [Done] to close the Relations dialog box.

Accessing Related Fields


After establishing relations, you can access fields from child files through the view,
through command dialog boxes, and through the Expression Builder:

To Access Through the View


Add fields from the child file to the view using the Add Columns button on the button
bar of the View window. See “Adding Fields to the View” on page 272.

To Access Through Command Dialog Boxes


This example shows the Sort command, but you can access fields in the same way with
any command that contains an Available Fields list box.
1. Select Data from the menu bar and choose Sort or click [Sort] on the button bar to
display the Sort dialog box.
2. Click [Sort On] to display the Selected Fields dialog box.
3. From the From Input File drop-down list, select a child file to display a list of all
fields from the chosen file in the Available Fields list box. Fields are displayed in the
filename.fieldname format to show which input file definition the fields came from.
Chapter 4 Commands 271
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.

To Access Through the Expression Builder


1. Click (Edit View Filter) on the button bar of the View window to display the Edit
View Filter dialog box, commonly called the Expression Builder.

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.

Adding Fields to the View


To add fields from the Customer file to the view of the Ar file:
1. Click (Add Columns) on the button bar of the View window to display the Add
Columns dialog box.
2. Select Customer from the From Input File drop-down list to display the fields of the
related file. The format filename.fieldname indicates the source of the fields.

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

Command Mode Syntax


In command mode, you can use the Define, Delete, and Display commands to work
with relations. You can also use a parameter of the Open command to define a
temporary relationship.

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

Defining Temporary Relationships


You can also use the Open command to open a related file and define a temporary
relationship to that file. In other words, the child file temporarily becomes a parent file.
First, open the parent file. Then open the related file, using the Relation parameter on
the Open command:
OPEN related-file-name INDEX index-name RELATION
primary-file-related-field-name
Because this is a temporary relationship, it ceases to exist when you close any of the files.
You also cannot use the Display Relation command to view details of temporary
relationships created this way. Display Relation shows details of permanent relationships
only.
DISPLAY RELATION
No related files currently defined
Instead, you use the Display command on the parent file:
DISPLAY OPEN
Defining temporary relationships is most useful in batch mode where you can use the
Open command to open and define a relationship using one command.
276 ACL for Windows 7 Reference Manual
Rename

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”.

Batch, Format, Index, Report, Workspace


Specifies the type of the item to be renamed.
Chapter 4 Commands 277
Rename

Data, Log, Text


Specifies the type of file to be renamed. Implies an appropriate file extension (for
example, Data.fil, Log.log, Text.txt).

Field
Allows you to rename a field.

OK

%
Indicates that the renaming process can proceed without confirmation.

Command Mode Syntax


RENAME <FIELD> {old-field-name|old-variable-name}
RENAME {BATCH|FORMAT|INDEX|REPORT|WORKSPACE} old-item-name
RENAME <DATA|FILE|LOG|TEXT|old-file-name>
<AS|TO> new-name
<OK>

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.

Click [OK] to rename the field.


278 ACL for Windows 7 Reference Manual
Rename

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”.

Detail Line Spacing


Lets you specify the number of spaces between the detail lines on the report. Select
single, double or triple spacing from the drop-down list.
These options do not apply to a summarized report.
Default: Single Spaced.

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

Suppress Blank Detail Lines


Does not display detail lines that are blank. The report will automatically move data up
to fill in the “white space” of blank detail lines. This reduces needless white space in your
reports and makes the report and data easier to read. See “Suppress Blank Detail Lines”

&
on page 197 of the ACL for Windows User Guide for details.

Report Dialog Box


Click (Report) or select Data from the menu bar and choose Report to display the
Report dialog box.

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

Command Mode Syntax


REPORT <ON> key-field <NODUPS>
<PAGE> ...
{FIELDS|ACCUMULATE} other-fields<SUPPRESS><NOZEROS>...
<LINE n other-fields>
<SUMMARIZED>
<TO create-file-name> <HTML>
<IF test> <WHILE test> <FIRST|NEXT range>
<HEADER heading>
<FOOTER footer>
<SKIP n>
<APPEND>
<EOF>

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.

The Sample command offers the following types of sampling:


 Random sampling
 Interval sampling
 Fixed interval selection after random start
 Cell sampling (random selection within each interval)
 Conditional sampling with If, While, Next, and First clauses
The sampling approach you choose depends on your assessment of the characteristics of
the population you want to sample as well as your needs and preferences.
When choosing a sampling approach, it is useful to understand the affect of sampling
bias and selection method on the results of each ACL sampling option.S

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.

Monetary Unit Sampling


A monetary unit sampling biases higher valued items. A million-dollar item is more
likely to be selected than a hundred dollar item. The chance of an item being selected is
directly proportional to its size.
Monetary unit samples are useful for substantive or overstatement tests. By biasing
higher value items, an MUS sample provides a high level of assurance that all significant
items in the population are subject to testing. When testing for overstatement, it is the
high value items that present the greatest risk of containing a material error. The
population for an MUS is the absolute value of the field being sampled. Fields can
contain negative as well as positive numbers and negative numbers cannot result in
overstatement.

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.

Fixed Interval Sampling


In a fixed interval sample, you must specify an interval value and a random start
number. If you specify a random start of 611 and an interval of 900, ACL selects the 611th
item and every 900th item thereafter. Because an item is usually either a record or a
dollar, the 611th item could be record 611 or the 611th dollar in the population.
286 ACL for Windows 7 Reference Manual
Sample

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.

For more information, see Chapter 10: “Sampling with ACL”.

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.

Report Selection Order


Causes the selection order to be output as a field. See the section on Random Sampling
above.

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.

Note: Options vary depending on the sampling method chosen.

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.

& Sample Dialog Box


Click (Sample) or select Sampling from the menu bar and choose Sample to display
the Sample dialog box.
292 ACL for Windows 7 Reference Manual
Sample

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 Inventory_mus file appears as follows:

Use the scroll bar to view the entire file.


As is typical for MUS sampling, larger dollar values have been selected.
The command log shows summary information on the sampling results.

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 file Ar_sample appears as follows:

Use the scroll bar to view the entire file.


The command log shows summary information on the sampling results.
Chapter 4 Commands 295
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.

Command Mode Syntax


SAMPLE RECORD
SAMPLE <ON> numeric-field-name
<SUBSAMPLE>
<CUTOFF top-stratum-cutoff>
<NOREPLACEMENT>
You can add the following options to the syntax:
INTERVAL = interval-value FIXED = start-value
INTERVAL = interval-value RANDOM = random-seed
RANDOM = random-seed POPULATION = population-size
{NUMBER|SIZE} = sample-size
{<FIELDS> extract-fields|RECORD}
<ORDER>
<IF test> <WHILE test> <FIRST|NEXT range>
<TO create-file-name|PRINT>
<HEADER heading>
<FOOTER footer>
296 ACL for Windows 7 Reference Manual
Save

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.

Command Mode Syntax


SAVE WORKSPACE workspace-name workspace-fields

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.

See “Index” on page 216 for details.


See also “Find” on page 198, and “Seek” on page 303.

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

& Search Dialog Box


Click (Search) or select Analyze from the menu bar and choose Search to display the
Search dialog box.

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.

To achieve the same results, you could also:


 Select Seek Expression in the Search dialog box, and enter ‘NY’ in the text box.

%
 Select Locate If in the Search dialog box, and enter STATE=‘NY’ in the text box.

Command Mode Syntax


For Locate Record and Locate If, see “Search” on page 298.
For Find Literal, see “Find” on page 198.
For Seek Expression, see “Seek” on page 303.
Chapter 4 Commands 303
Seek

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.

Command Mode Syntax


SEEK character-expression
character-expression indicates the value of the index key expression (in quotes if
it is a simple character string), or the name of a field or variable which contains a
character value.
304 ACL for Windows 7 Reference Manual
Sequence

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.

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 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.

List Gap Ranges


Specifies that the output list from the gaps testing is to report gap ranges, instead of
listing each missing item. The key field values on either side of the gap are listed.

List Missing Items


Specifies that the output list from the gaps testing is to list each missing item. If the size
of the gap is less than or equal to the Items Limit (see below), each missing key is listed.
If the gap is larger, only the first and last missing key are listed.
For example, you may have an invoice file for several branches, each with its own
numbering sequence. When you reach the last number for one branch and start into the
first number for the next branch, a missing range is almost always reported.
306 ACL for Windows 7 Reference Manual
Sequence

Maximum Missing Items


Specifies the maximum number of missing items to be reported within a given gap for
the List Missing Items test. If the limit is exceeded, the missing items are reported as a
range, as in List Gap Ranges.
The Maximum Missing Items limit does not restrict the total number of missing items
reported, only the number reported within a specific gap. Default: 5 items.

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.

Sequence Dialog Box


Click (Sequence) or select Analyze from the menu bar and choose Sequence to
display the Sequence 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.

% Command Mode Syntax


SEQUENCE <ON> key-field <D>...
<TO create-file-name|PRINT>
<UNFORMATTED>
<HEADER heading>
<FOOTER footer>
<IF test> <WHILE test> <FIRST|NEXT range>
<DUPLICATES> <OTHER field-list>
<PRESORT>
<GAPS|MISSINGn>
<ERRORLIMIT=n>
<APPEND>
<OPEN>

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 Option in Command Mode Equivalent ACL Preference

SET BEEP 0-255 Interface Options tab

SET CENTURY 0-99 Date Options tab

SET CLEAN ON|OFF View Options tab

SET DATE 1|2|‘string’ Date Options tab

SET DESIGNATION View Options tab

SET EXACT ON|OFF Input File Options tab

SET FORMAT ON|OFF Input File Options tab

SET MARGIN {LEFT| RIGHT|TOP| Print Options tab


BOTTOM} <TO> n

SET MONTHS <TO> Date Options tab


‘Jan,Feb,Mar,Apr,May,Jun,
Jul,Aug,Sep,Oct,Nov,Dec’

SET ORDER <TO> ‘string’ Input File Options tab

SET OVERFLOW ON|OFF Numeric Options tab


310 ACL for Windows 7 Reference Manual
Set

Set Option in Command Mode Equivalent ACL Preference

SET PERIODS <TO> Date Options tab


“period1,period2...”

SET READAHEAD <TO> buffer-size Input File Options tab

SET SAFETY ON|OFF Interface Options tab

SET TEST ON|OFF Command Options tab

SET VERIFY ON|OFF|BLANK Numeric Options tab

%
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

Command Mode Syntax


SET ECHO {ON|NONE}

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.

Command Mode Syntax


SET FILTER <TO> test

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

Command Mode Syntax


SET HISTORY <TO> 0-100

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.

Default: Not set.

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.

Command Mode Syntax


SET LOG <TO> {logfile-name|OFF}

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

Command Mode Syntax


SET PASSWORD n <TO> <password>
n must be a value from 1 to 5.

password may be any valid character expression.

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”.

Monetary Unit Sample Size


Confidence
Specify the reliability you would like the sample to generate. For example, entering 95 in
the text box indicates 95% confidence in the sample. That is, it would likely be wrong
only one time in 20.
316 ACL for Windows 7 Reference Manual
Size

Expected Total Errors


Specify the total dollar amount of errors expected in the population. This increases the
sample size to allow for the expected errors.

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.

Record Sample Size


Confidence
Specify the reliability you would like the sample to generate. For example, entering 95 in
the text box indicates 95% confidence in the sample. That is, it would likely be wrong
only one time in 20.

Expected Error Rate


Specify the percentage error rate expected in the population. This is the maximum
amount of error you are willing to accept in the population without detection.

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.

Upper Error Limit


Specify the error rate you want to prove is not exceeded in the population.
Chapter 4 Commands 317
Size

& Size Dialog Box


Monetary Option
Click (Size) or select Sampling from the menu bar and choose Size to display the
Size dialog box. By default, ACL displays the Monetary option and its corresponding
parameters.
Click [Calculate] to display the calculated results after entering the Size parameter
values. Sample size, interval, and maximum tolerable taintings are displayed in the
Results area of the dialog box.

Record Sample Option


Click (Size) or select Sampling from the menu bar and choose Size to display the
Size dialog box. By default, ACL displays the Monetary option and its corresponding
parameters. Select Record to display the record sample option.
Click [Calculate] to display the calculated results after entering the Size parameter
values. Sample size, interval, and the number of tolerable errors are displayed in the
Results area of the dialog box.
318 ACL for Windows 7 Reference Manual
Size
Chapter 4 Commands 319
Size

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.

Command Mode Syntax


SIZE MONETARY
POPULATION population-size
CONFIDENCE confidence-level
MATERIALITY materiality-level
<ERROR expected-error-amount>
<TO text-file-name>
SIZE {RECORD|ATTRIBUTE}
POPULATION population-size
CONFIDENCE confidence-level
PRECISION precision-level
<ERROR expected-error-rate>
<TO text-file-name>
Chapter 4 Commands 323
Sort

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 versus Indexing


The Index command is an alternative to sorting. Sorting is slower and requires more
disk space than indexing. However, processing a sorted file is much faster than
processing an indexed one. The following table compares the benefits and drawbacks of
the Sort and Index commands.

Sorting Indexing

Execution speed Slower Faster

Resulting file size Larger Smaller

Required disk space More Less

Subsequent processing of an Much faster Much slower


entire file

Subsequent processing Much slower Much faster


searching for a few records

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.

Disk Space Requirements


Sorting requires free disk space of at least 2.5 times the size of the file to be sorted.

Classifying versus Sorting and Summarizing


Because the Classify command does not require a sorted file, whenever possible use
Classify instead of the Sort and then Summarize procedure to prepare summarized
reports. Sorting a file takes up a significant amount of memory and should be avoided
when other ACL commands can be equally effective.

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.

& Sort Dialog Box


Click (Sort) or select Data from the menu bar and choose Sort to display the Sort
dialog box.

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

To create an inventory file named Sort_product_class sorted in ascending order (the


default sort order) by product class (the second column in the view):
1. Select Data from the menu bar and choose Sort to display the Sort dialog box.
2. Select ProdCls from the Sort On list view.
The default sort order is ascending, but if you want to change it, you can select the
field from the Selected Fields dialog box instead. To do this:
 Click [Sort On] to display the Selected Fields dialog box. When you move the
field you want to sort from the Available Fields list view to the Selected Fields list
box, a triangular indicator appears next to the field name.
 Click the indicator to change the sort order.
 Select the field named ProdCls from the list, change the sort order if necessary,
and click [OK] to return to the Sort dialog box.
A column appears at the left of the Sort On list view showing in which order
fields were selected for sorting.

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

Command Mode Syntax


SORT ON key-field <D>... TO create-file-name
<IF test> <WHILE test> <FIRST|NEXT range>
<APPEND>
<OPEN>
328 ACL for Windows 7 Reference Manual
Statistics

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.

Statistics Dialog Box


Click (Statistics) or select Analyze from the menu bar and choose Statistics to
display the Statistics dialog box.

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

ACL displays the result in the command log.


Chapter 4 Commands 331
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

Command Mode Syntax


STATISTICS <numeric-field-list|ALL>
<STD> <NUMBER n>
<TO file-name|PRINT>
<IF test> <WHILE test><FIRST|NEXT range>
<APPEND>
Chapter 4 Commands 333
Stratify

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.

Stratify Dialog Box


Click (Stratify) or select Analyze from the menu bar and choose Stratify to display
the Stratify 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

The results appear in the command log.

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

Command Mode Syntax


STRATIFY <ON> numeric-field-name <INTERVALS=n>
MAXIMUM=max
MINIMUM=min
STRATIFY <ON> numeric-field-name FREE
interval-start-points...
MINIMUM=min
<MAXIMUM=max>
You can add the following options to each syntax format:
<TO create-file-name|PRINT>
<IF test> <WHILE test> <FIRST|NEXT range>
<SUPPRESS>
<ACCUMULATE numeric-field-list>
<HEADER heading>
<FOOTER footer>
<KEY break-field <+ ....>>
<APPEND>
<OPEN>
The command log shows that most of the balances from the 69.89 to 983.10 stratum fall
into the 500 to 750 range.
Chapter 4 Commands 339
Summarize

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

& Summarize Dialog Box


Click (Summarize) or select Data from the menu bar and choose Summarize to
display the Summarize dialog box.
342 ACL for Windows 7 Reference Manual
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.

The Default View for Summarize_sort_location appears as follows:


Chapter 4 Commands 343

%
Summarize

Command Mode Syntax


SUMMARIZE ON key-fields ACCUMULATE summarize-fields
<OTHER> other-fields
<TO create-file-name>
<IF test> <WHILE test> <FIRST|NEXT range>
<PRESORT>
<APPEND>
<OPEN>

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.

File mark Data block

Data 1 Data 2 Data 3 Data 4 Data 5

Labeled tape contains an extra block of data called a label before and after each data
block.

File mark Data block Labels

Label Data 1 Label Label Data 2 Label Label

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

Command Mode Syntax


TAPE <SKIP> n
n specifies how many file marks to skip.

Example1: Unlabeled Tape


To calculate n, the number of file marks to skip, specify n = (d–1), where d is the data
block number minus one. To move to data block 3, specify n = (3–1) = 2.

TAPE SKIP 2
ACL skips two file marks, taking you to the third block of data.

Example 2: Labeled Tape


To calculate the number of file marks to skip, use the formula 3(d–1)+1, where d is the
number of the data block that you want to access. To move to Data 2 on the labeled tape
above, n = 3(2–1)+1 = 4:
TAPE SKIP 4
ACL skips four file marks, which takes you to the fifth block of data, Data 2.

Example 3: Rewinding Tape


TAPE SKIP –10
You can rewind the tape by specifying a large negative amount. The minus sign tells ACL
to move backward. If you are working with a tape that contains many files, make sure
that you specify a sufficient number of file marks to move to the beginning of the tape.
346 ACL for Windows 7 Reference Manual
Top

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.

Command Mode Syntax


TOP
Chapter 4 Commands 347
Total

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.

Total Dialog Box


Click (Total) or select Analyze from the menu bar and choose Total to display the
Total dialog box.
348 ACL for Windows 7 Reference Manual
Total

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.

ACL displays the result in the command log.


Chapter 4 Commands 349
Total

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.

% Command Mode Syntax


TOTAL numeric-field-list
350 ACL for Windows 7 Reference Manual
Verify

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.

See “VERIFY( )” on page 84 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 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.

Verify Dialog Box


Click (Verify) or select Analyze from the menu bar and choose Verify to display the
Verify dialog box.

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 result in the command log.

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

Command Mode Syntax


VERIFY field-list
<IF test> <WHILE test> <FIRST|NEXT range>
<ERRORLIMIT n>
<TO create-file-name|PRINT>
Appendix A U SING THE ACL U TILITY

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.

Converting from OS/390 to Windows


Also see “Overview Window Buttons” on page 28 of the ACL for Windows User Guide for
information on using the Import from ACL for OS/390 button.
The Convert from OS/390 option in the ACL Conversion Utility transforms all the ACL
for OS/390 format, batch, workspace, and report files in a directory and includes them in
a single ACL for Windows Project. It is a good idea to review the directories containing
your ACL for OS/390 files before you convert them. You might want to reorganize the
files to include only related applications in the converted Project.
The utility only converts files with FMT, BAT, WSP, and RPT extensions. If you have
format, batch, workspace, or report files that have extensions other than these and you
want to convert them, you must rename them.
It is a good idea to remove temporary, test, and redundant files you do not expect to use
again. This will result in a clean and organized set of converted files.
Ensure that you have enough free disk space to store the new set of files the utility will
create. You will need disk space approximately equal to the total of the FMT, BAT, WSP,
and RPT files that you want to convert.
To convert ACL for OS/390 files:
1. In the ACL program group, double-click the ACL Utility icon to display the ACL
Conversion Utility window.
2. Select Convert from the menu bar and choose OS/390 to Windows.
ACL displays a message informing you that your ACL for OS/390 files will be
converted and placed in an ACL for Windows Project. Click [OK].

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

6. To convert more files, repeat steps 2 through 5.


7. When you are done, select Convert from the menu bar and choose Exit.

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.

Processing Report Files


Indicates that the utility is processing report files (*.rpt). The utility links the report with
the correct input file definition (format).

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.

<filename> format name truncated


Indicates that while processing format files, a format name was found that exceeded the
maximum allowable length of eight characters.
The utility truncates the format name to the maximum allowable length and does not
include a file extension.

Format name too long


Indicates that a report file was found with a name that exceeded the maximum allowable
length of eight characters.

Invalid format <filename>, not included


Indicates that while processing a format file, a RECORD_LENGTH line could not be
found.
Because this is not a valid format, it is not included in the created Project.

Date field not correctly formatted


Indicates that while processing a format file, a field defined as a Date field type was
found with an invalid date format.
The invalid Date field is not included in the Project.

Fatal Error Messages


Not enough memory to process comments
Not enough memory to process batches
Indicates that there is not enough RAM for processing. Quit any other open programs
and try doing the conversion again.

Error writing to compound Project


Indicates that the utility is unable to write to the Project it is creating. This should only
happen if you run out of disk space. Free up disk space and try doing the conversion
again.
Appendix A Using the ACL Utility 359
Using Converted OS/390 Files

Using Converted OS/390 Files


All the converted files appear in the Overview window. To display the Overview window,
do the following:
1. Start ACL for Windows and look in your working directory to open the Project with
the converted files.
2. Select Window from the menu bar and choose Open Overview.
ACL displays the Overview window, which shows the batches, input file definitions
(formats), views (reports), and workspaces included in your Project.

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.

Acquiring a Tape Drive System


If you need to purchase a tape drive, a device driver, a controller card, or a cable, this
section will help you determine the best options for your working environment.
If you have an information systems department, work closely with them in planning and
acquiring your tape drive system. This will ensure that the components you purchase are
compatible with the tapes with which you will work.
You can also contact ACL Technical Support for advice and suggestions on setting up a
tape drive system.

361
362 ACL for Windows 7 Reference Manual
Acquiring a Tape Drive System

Tape Drive System Components


The components of a tape drive system are:
 tape drive
 device driver
 controller card
 connecting cable
Together, the components let you access and read data generated on a mainframe or
minicomputer and stored on magnetic tape.

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.

Before You Begin


Before you begin to read data stored on tape, make sure you request:
 A working copy of the data file on tape, not a backup copy.
Explicitly request a flat, sequential file that has not been translated to ASCII as
ASCII translation is often done automatically. ACL reads untranslated data more
quickly, and there is less chance of the data being altered.
 A file definition or layout.
For example, the types of fields in each record, their length, sequential order, and
so on.
 Information about how the data has been organized on the tape.
For example, if the tape is unlabeled or labeled.
When you have all the information about the tape and file you want to work with and the
tape is in your drive, you are ready to begin.
364 ACL for Windows 7 Reference Manual
How Data is Organized on Tape

How Data is Organized on Tape


Knowing the physical layout of the tape you are working with helps you correctly
position your drive at the data you want to access.

Data Sets and File Marks


Data on tape is organized in a series of consecutive files called data sets that are
separated by file marks.
The information in each file is divided into blocks that the tape drive handles as a unit.
A block can contain one or more data records. Between each block on the tape there is a
gap or empty space. After the last data block, there are two file marks that indicate the
end of recorded data on that tape.
Tapes can be unlabeled or labeled.

Unlabeled Tape
An unlabeled tape is organized into consecutive data files separated by file marks. The
dark rectangles shown below represent file marks.

Data 1 Data 2 Data 3 Data 4 Data 5

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.

Label Data 1 Label Label Data 2 Label Label

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.

Command Mode Syntax


TAPE <SKIP> n
n equals the number of file marks to skip. Enter positive n to move forward on the tape
or negative n to move backward.

Accelerating Tape Rewind


If you are working with a very large data file, you can use the Set command with the
ACCELERATE keyword to accelerate the rewind speed. You must specify the number of
file marks to skip at the start of the file.
For example, if the first file you want to read is on an unlabeled tape, enter SET ACCEL-
ERATE 0 in the text box of the command log. If the first file you want to read is on a
labeled tape, you can skip the tape label by typing SET ACCELERATE 1.
366 ACL for Windows 7 Reference Manual

%
Working with Tape Files

Command Mode Syntax


SET ACCELERATE n
n equals the number of file marks to skip.

You must cancel the SET ACCELERATE command to return to the regular rewind
speed. To cancel SET ACCELERATE, enter:
SET ACCELERATE 100

Switching Between Tape and Disk


If you want to switch from a file on tape to a file on disk that has the same input file
definition, simply select Data from the menu bar and choose Select. Click [Link Data
File] to display the Locate File dialog box. Then choose the file you want to use from the
Locate Data File dialog box.
To switch back to tape later, choose either Tape - One Reel or Tape - Multi Reel, as appro-
priate, from the Media Type drop-down in the Input File Definition window.
If you want to use a file on a different tape that has the same input file definition, simply
mount the other tape.

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.

Working with Tape Files


To begin working with tape files, you must first either open an existing input file
definition or create an input file definition. Follow the instructions in “Working with
Input File Definitions” on page 164 of the ACL for Windows User Guide to open an
existing input file definition for use with data files on tape.

Creating an Input File Definition


Creating an input file definition for data on tape is similar to creating an input file
definition for data from any other source. The only difference is that you select the Tape
option on the Select Data Source page of the Data Definition Wizard. Then you can
Appendix B Working With Tape 367
Troubleshooting Tape

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.

Processing Tape Files


Once you define a file on tape, you can use most ACL commands and functions to
process the file. When processing tape files:
 You cannot use a file on tape as a secondary file in the Join or Merge commands.
 You cannot use the Index command to index a file on tape, because tape is not a
random-access device.
 When working with multi-reel tapes, you can process the entire file, but you can
only view one reel at a time.
 You cannot output to tape.
 Close the file on tape before you close your Project or exit from ACL because at
the start of your next session, ACL attempts to access the last input file in use.

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.

Break Field or Column


A sort key field or column that ACL uses to automatically print a subtotal line on a report
each time the contents of the field or column changes.

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

Fixed Point Arithmetic


A processing method used by ACL for all numeric operations (as opposed to floating
point arithmetic). Fixed point arithmetic improves processing speed and allows user
control over decimals and rounding.

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

See also “File History” on page 373.

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.

Input File Definition


Describes the structure, contents, and layout of a data file and links the data file to the
Project. It includes information such as field names, field definitions, and field types.
ACL automatically provides some of this information for you, such as the file type,
character type, media type, the number of records, and the record length. An input file
definition is only defined or created once for a given data file.

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.

Monetary Unit Sampling


Abbreviated as MUS. In sampling, a method of selecting records where the likelihood of
selection is proportional to the value of a field; the larger the value of the field, the more
likely that field will be selected.

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 |

See also “Expression” on page 372.

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

See also “Field” on page 373.

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

compared to CLEAN( ) 37–38 multiple, performing 133 about 37–38


Blank lines, suppress using Report Case compared to Blank Invalid Data
command 281 changing 56, 83–84 preference 37–38
Blanks converting to mixed 66–67 Click and drag method of opening
adding to fields 35 Categories of data 5 files 268
in date fields 11 CDOW( ) function, about 36 Client/Server
finding in fields 53 Cell check box, Sample dialog exporting files 186
in numeric fields 17 box 288 relating files 262
inserting in string 52 Century codes saving files to local drive 101
leading, find using Seek changing in packed date fields 19 Close command
command 303 changing default 12 about 138–139
leading, removing from modifying date format 19 example 139
string 56–57 Character data, described 6 Index keyword 138
related files 261 Character fields Learn keyword 138
removing with ALLTRIM( ) 29 length, finding 55 Log keyword 138
repeated values 103 types in ACL 5 Primary keyword 138
trailing, removing 82 Character format Secondary keyword 138
zero values 104 converting from numeric Closing files using Quit
BLANKS( ) function, about 35 expressions 79 command 254
Bounds, upper and lower in Benford converting to date 38–39 COBOL
command 129 converting to numeric 84 computational-3 field type 18
Break Character strings field type in binary fields 10
See also Key parameter counting occurrences 64 OCCURS clause, adjusting
fields, specifying 92 finding in other character starting position 64–65
page, inserting in command strings 30–32 Comma delimited format, ACL
mode 105 isolating substrings 79–80 data 186
parameter, about 92 Characters Command
Buffer length, specifying in finding in a record 46–47 output, saving to file 95
command mode 246 inserting in a string 52 parameters, described 89–112
BYTE( ) function, about 35–36 inserting specified string 51–52 Command log
Byte-aligned data, field types to isolating specified number from notes, inserting 140
use 16 end of string 54 Stratify command output,
Bytes removing from fields 44 explained 337
character representation, reversing order in string 75 Command mode
finding 35–36 unwanted, removing from formatting date or numeric
converting with BIT( ) 33–34 string 72–73 fields 105
finding digit for specified Check boxes, adding to custom Commands
half 41–42 dialog boxes 159 closing in loops 238
shift, using Fieldshift Child file, selecting in Relations confirming execution 193
command 193 dialog box 268 executing one additional time at
skipping, in Dump CHR( ) function, about 36–37 end of file 94
command 173–175 Classify command group processing 202–206
about 135–137 group, closing 203
Accumulate Fields button 135 group, indenting 203
C alternative to Sort 324 history, displaying 196–197
Calculate command autoexecuting 135 logging, Set Echo 310–311
about 133–134 Classify On button 135 used, viewing 196–197
examples 134 output, explained 136 Comment command
field values in expressions 133 Classifying in command mode 137 about 140–141
Calculations CLEAN( ) function comment-line parameter 140–
Index 385

141 character format to numeric 84 displaying in command


example 141 character values to dates 38–39 mode 168
Comments, inserting in command from ASCII to EBCDIC 42–43 field type, described 11
log 140 from numeric to zoned format characters, described 14
Comparing format 85–86 formats, about 14–15
character strings 33 numeric to character format 79 formats, defining in packed
expressions or field values 59–60 numeric values to dates 38–39 fields 19
phonetic similarity 77 OS/390 data to ACL Project 355– formats, modifying century
strings, using MAP( ) 57–58 357 code 19
Compressed numeric fields, Copying files using Extract Date fields
specifying date formats 12 command 189 blank, finding 11
COMPUTATIONAL-1 field type in COUNT DATE( ) function, about 39–40
binary fields 10 Classify command log 135 Dates
Computed fields Count command log 142 American, formatting
defining in command mode 145 Count command conventions 15
definitions, storing 296–297 about 142–143 converting to character
deleting in command mode 150 example 142–143 strings 39–40
results stored in ACL fields 9 Counting day of week, finding 36
setting default value 73 character string occurrences 64 European formatting
Condition records using Classify conventions 15
specify using If command 214 command 135 formatting in compressed
specify using While records using Stratify 333 numeric fields 13
parameter 110 CTOD( ) function, about 38–39 ISO formatting conventions 15
Conditional Custom negative value returns 28
computed fields, defining in field type, described 10 quotation marks, enclosing in 11
command mode 145–146 field type, using in foreign searching for ranges 32–33
groups, creating 204–205 language applications 10 serial type, described 12
index files, creating 218 Cutoff Day of the week
Confidence date, specifying in Age converting to digit 42
Evaluate dialog box, entering 181 command 122 finding for specified date 36
Size command, specifying 315 parameter, Sample dialog dBASE
Confirming execution of box 288 files, opening in command
commands 193 mode 247
Connecting cable, tape drive 363 format, ACL data 186
Constants D Decimal places, changing
date, using in functions 28 Data number 40–41
Contacting ACL 3 categories 5 Decimals
Control totals, produce using Total character, described 6 ASCII character equivalent 36–
command 347 date, characteristics 7 37
Controller card, tape system field types, ACL equivalents 7 implicit, in numeric fields 17
requirements 363 logical, characteristics 7 specifying in packed fields 18
Controls, custom dialog boxes numeric, described 6 DECIMALS( ) function, about 40–
adding 156 tape, obtaining 363 41
deleting 163 Data relations. See Relations Define
editing 163 Date Field keyword, about 144–147
Conversion functions, summary 23 comparisons, using Age Field keyword, example 146–147
Conversion utility command 122 Field keyword, parameters
ACL, about 355–357 data stored as character data 7 described 145–146
Converted OS/390 files, using 359 data stored as numeric data 7 Relation keyword 274
Converting data, characteristics 7 Report keyword, about 149
386 Index

Define Relations. See Relations 155 E


Definitions of fields, storing in DIGIT( ) function, about 41–42
EBCDIC
workspace files 296 Digital analysis using Benford
converting from ASCII 42–43
Delete command command 129
display, using Dump
about 150–152 Digits
command 173–175
All option 150 finding specific
field type, described 15
OK option 150 combinations 47–48
printable characters 15
Deleting representing day of the week 42
EBCDIC( ) function, about 42–43
computed fields in command Display command
Echo, Set command keyword 310–
mode 150 about 167–168
311
file history 150, 151 Date keyword 167, 168
Edit boxes, adding to custom dialog
history 151 example 168
boxes 158
in command mode 151 History keyword 167
Edit view filter. See Expression
relationships in command Primary keyword 167, 168
Builder
mode 274 Relation keyword 274
EFFECTIVE( ) function, about 43
relationships using dialog Secondary keyword 167, 168
Else command, about 177
box 273–275 Displaying open files in command
E-mail, send using Notify 244–245
Descending mode 167
End command
field modifier, using 93 Division, finding remainder 62
about 178
sort order 324 Do Batch command
using in groups 178
Detail lines, suppress using Report about 169–171
End of file parameter, using 94
command 280 example 170
EOF. See End of file
Dialog boxes If option, dialog box 169–170
Error limit
design using graphical using in groups 169–171
Sequence command 305
interface 154–155 Do Report command, about 172
Verify command, specifying 351
drop-down lists, creating 113 Documenting ACL sessions 140
Errors, entering for Evaluate
multiple-prompt type, DOS. See OS/390
command 182
creating 117 DOW( ) function, about 42
European dates, formatting
single-prompt type, Drop-down lists
convention 15
creating 115–117 adding to custom dialog
Evaluate command
text boxes, creating 113 boxes 161
about 179–185
Dialog builder create using Accept
Confidence, entering 181
check boxes, adding to dialog command 114
Errors parameter 182
boxes 159 field type syntax 115
example, monetary sampling 184
controls, adding to dialog Dump command
example, record sampling 183
boxes 156 about 173–175
Interval, entering 181
controls, editing 163 Find parameter 174
Number of Errors parameter 182
drop-down lists, adding to dialog Refresh parameter 175
Exact Character Comparison
boxes 161 skipping bytes 173–175
effect on Find command 198
edit boxes, adding to dialog syntax 175
using with BETWEEN( ) 32–33
boxes 158 width of display column,
Excel format, ACL data 186
project item lists, adding to dialog changing 173
EXCLUDE( ) function, about 44
boxes 161–162 Duplicate
Excluding specified totals 107
radio buttons, adding to dialog entries, finding 77
Expected error rate, specifying in
boxes 160 key fields, finding 176, 176, 176
Size command 316
text messages, adding to dialog Duplicates
Expected total errors, specifying in
boxes 157 testing, Sequence command 304
Size command 316
Dialog command Duplicates command
EXPONENT( ) function, about 44–
about 153–166 See also Sequence
45
using to create dialog boxes 154– about 176, 176, 176
Exponential value, finding 44–45
Index 387

Export command identifying 48–49 maximum entries, setting 311


about 186–188 logical, described 17 File History button, about 196
Client/Server system, using 186 micro, described 17 File History command
example 187 numeric, described 17 about 196–197
Expression Builder overlapping 144 examples 196–197
viewing function categories 23 packed, described 18 File marks
Expressions PCASCII, described 20 calculating number to skip 345
compare, using MATCH 59–60 print, described 20 defined 344
find using search 299 recognized by ACL 5–6 File parameter, using 95
replacement names 90 syntax for drop-down lists 115 File type parameter, specifying
using reverse quotes 11 Unisys, described 21 output format 96
Extensions unsigned, described 21–22 Files
.dbf 247 using computed fields to closing in command mode 254
.fil 96, 246 convert 5 history, displaying 196–197
.inx 247 using functions to convert 5 meeting test, find 235–236
.txt 96 VAXfloat, described 22 merging 239–242
Extract command zoned, described 22 naming 102
about 189–192 Fields ODBC, importing 215
examples 190–192 add blanks using BLANK( ) 35 opening in command mode 246,
Extract Fields button in Sample blank date, finding 11 246–248
dialog box 289 character data, described 6 opening, click and drag
Extracting character, types in ACL 5 method 268
fields, command mode 192 creating in command mode 144 reducing size before sorting 189
fields, Export dialog box 190 inserting character strings 51–52 related, criteria for choosing 263
records, command mode 192 key, duplicates 176, 176, 176 relating, procedure 268–270
records, Export dialog box 190 key, Join command selection renaming in command
criteria 226 mode 276–278
logical data, described 7 searching by size 45–46
F numeric data, about 6 server, saving to local drive 101
Field numeric, stratifying 334 size, finding 45–46
modifiers. See Command parameter, Accept tape, defining 366
parameters command 114 FILESIZE( ) function, about 45–46
start position, adjusting 64 related, adding to view 272 Filter, Set command keyword 311
values, compare using related, using in Expression Filters
MATCH( ) 59–60 Builder 271 indexed files 218
Field types renaming in command setting in batches 311
ACCPAC, described 9 mode 276–278 Financial functions
ACL, and common data type replacement names 90 summary 25
equivalents 7 shifting to align 193–195 Find
ACL, automatically defined 9 start position order, See also Find Literal
ACL, described 9–22 displaying 194 Dump command 174
BASIC, described 9 types, identifying 48–49 Find command
binary, described 10 Fieldshift command about 198–199
custom, described 10 about 193–195 example 199
date, described 11 Columns 193 Find Literal
defined 5 example 194 See also Find command
EBCDIC, described 15 OK 193 Search command option 298
float, described 16 Start 193 FIND( ) function, about 46–47
halfbyte, described 16 File history Finding
IBMfloat, described 16 displaying 196 character strings using
388 Index

Search 298 logical, summary 24 Header


characters in a record 46–47 mathematical, summary 25 changing variables 127
record numbers 300 miscellaneous, summary 26 inserting in reports 99
records in indexed files 217 normalizing key fields 262 parameter, compared to header
records meeting condition 299 viewing categories in Expression variable 99
sequence errors 304 Builder 23 Help command, about 207
First parameter, using 96 Future value Hexadecimal
Fixed Interval option, Sample dialog annuity, calculating 49–50 display, using Dump
box 289 investment, calculating 50–51 command 173–175
Fixed point arithmetic, Calculate FVANNUITY( ) function, equivalent value, finding 51
command 133 about 49–50 HEXADECIMAL( ) function,
Float field type, described 16 FVLUMPSUM( ) function, about 51
Floating point data, IBM 16 about 50–51 High/low values, Statistics
Footer command 328
inserting in reports 97 Histogram command
parameter, compared to footer G about 208–213
variable 97 Gap ranges columns, specifying 208
variables, changing 127 missing items, Sequence examples 210–213
Foreign language applications, command 306 Intervals parameter 209
custom field types 10 reporting, Sequence start and end points,
Format command 305 specifying 209
ASCII, display using Dump Gaps values, determining 251
command 174 finding in data 200 Histograms
converting numeric to testing, Sequence command 305 creating in command mode 213
character 79 Gaps command options available 208
display using List See also Sequence History
command 232–234 about 200–201 file, deleting 150, 151
EBCDIC, display using Dump Graph file, displaying 196–197
command 174 See also To parameter file, maximum entries 311
files, converted from OS/390 360 See also Histogram Set command keyword 311, 312
hexadecimal, display using Dump option, described 98 HTML report format,
command 174 Graphing Stratify command specifying 279
output, specifying 96, 109 output 337
Formatting Group command, about 202–206
consistency 73–74 Groups I
date or numeric fields in closing commands 178, 203 IBM floating point data, about 16
command mode 105 conditional, creating 204–205 IBM PC language, BASIC field
dates in numeric fields, command Do Batch command, using 169– type 9
syntax 15 171 If command
dates in compressed numeric or Else command, using 177 about 214
packed fields 13 indenting commands 203 examples 214
packed date fields 19 Loop command, using 237–238 If parameter
Frequency of occurrence, evaluate nested, creating 205–206 about 100
using Z-statistic 86–88 repeat processing 237–238 using with First parameter 96
FREQUENCY( ) function, simple, creating 204 using with global filter 100
about 47–48 variables, using 206 If tests in groups, Else
FTYPE( ) function, about 48–49 command 177
Functions Import command
conversion, summary 23 H about 215
financial, summary 25 Halfbyte field type, described 16 ODBC tables 215
Index 389

Importing data, find using Dump command 226


ODBC database tables in command 173
command mode 215 data, find using Verify
IMS one to many, Join command command 350 L
option 225 information, replacing 73–74 LAST( ) function, about 54
INCLUDE( ) function, about 51– Investments, calculating future Leading
52 value 50–51 digits, specifying in Benford
Index command ISBLANK( ) function, about 53 command 130
about 216–222 ISO date formatting convention 15 zeros, filtering out of string 54
example 221–222 LEADING( ) function, about 54
Index, Set command keyword 312 Length
Indexes J of character field, finding 55
activating 217 Join command record, finding 70–71
conditional, creating 218 about 223–231 LENGTH( ) function, about 55
deleting in command mode 151 compared to Merge 239 List command
filters, using 218 compared to Relations 223 about 232–234
opening in batches 312 examples 228–230 blank lines, inserting in
Indexing IMS one to many option 225 reports 233
in command mode 222 matched records option 224 example 233–234
compared to sorting 216–217 matched records, all primary and multi-line reports 232
key fields, Relations 263 all secondary option 225 List Fields, Sequence command
Initial case conversions 66–67 matched records, all primary option 305
Initialize variables, REPEAT( ) option 224 List format, displaying output 232–
function 73 matched records, all secondary 234
Input file definitions option 224 Loan repayment periods,
deleting in command mode 151 naming files 225 calculating 63
fields, adding in command output options 224–225 Loans
mode 144 unmatched records 225 calculating monthly payment 65
INSERT( ) function, about 52 Joining calculating present value 67
Inserting blanks or characters in files in command mode 231 Local
string 52 files, procedure 228–231 drive, saving server files 101
Integer value of numeric expression Julian dates, formatting parameter, about 101
or field 52–53 convention 15 Locate command
INTEGER( ) function, about 52–53 Justifying, right, using RJUSTIFY See also Locate Record and Locate
Interactive batches function 75 If
creating 113 about 235–236
dialog boxes, adding 153 example 235–236
Interest rates K Locate If
on annuity, calculating 69–70 Key See also Locate command
effective annual, calculating 43 See also Break Search command option 299
nominal, calculating 62–63 parameter, about 100 Locate Record
Interval Key fields See also Locate command
Evaluate dialog box 181 convert using functions 262 Search command option 299
Sample dialog box 289 defined 262 LOGARITHM( ) function,
Stratify dialog box 333 identical format, creating 73–74 about 55
Intervals indexing 263 Logarithmic value, finding 55
free, start and end points 333 normalizing 262 Logging commands using Set
Invalid preparing to join 226 Echo 310–311
characters, finding and relations, characteristics 262 Logical
replacing 37–38 selection criteria, Join data characteristics 7
390 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

O Packed fields Present value


century codes, about 19–20 of loans, calculating 67
OCCURS( ) function, about 64
defining century codes 19–20 of lump sum, calculating 68
ODBC
modifying date format 19 Presorting, Summarize
database tables, importing 215
recognizing date information 12 command 339
passwords, creating 249
specifying decimals 18 Preview report format 280
passwords, importing tables 215
Packed numeric data Print
refreshing data 259–275
create using PACKED( ) 65 See also To parameter
OFFSET( ) function, about 64–65
date information 12 parameter, described 106
Open
Packed numeric fields, date Print field type
parameter See also Use Output
formatting 13 compared to numeric 20
File
PACKED( ) function, about 65 decimals, implicit 20–21
files, displaying in command
Page Printable characters, EBCDIC 15
mode 167
breaks, inserting in command Printing
parameter, using 104
mode 105 in command mode 106, 172
Open command
field modifier, described 105 indexes, list of 264
about 246–248
setup dialog box, display using Profile command
Bufferlength option 246
Report command 280 about 251–253
examples 248
Password example 252–253
Relation keyword 247, 275
creating 249 fields, specifying 251
Opening
hiding in command log 310 Profiling fields in command
command created files 104
Notify command 245 mode 253
files in command mode 246–248
ODBC, importing tables 215 Project item lists
tape files 247
Refresh command 259 adding to custom dialog
Order, field display 194
Password command, about 249 boxes 161–162
OS/390
Pause command, about 250 Prompts
batch files, using 359
Payment batches, pausing 250
conversion error messages 358
loan, calculating monthly creating with Accept
conversion informational
amount 65 command 113
messages 357
PCASCII field type, described 20 PROPER( ) function, about 66–67
converted files, using 359
Phonetic similarities, finding 77–78 Punctuation
data, converting to ACL
PIC. See Picture filtering from string 54
Project 355–357
Picture field modifier, using 105 in numeric fields 17
format files, using 360
Pivot date, defined 12 PVANNUITY( ) function, about 67
report files, using 360
PL/1 PVLUMPSUM( ) function,
Other Fields button, Summarize
field type compared to packed about 68
command 340
numeric 18
Output
field type in binary fields 10
See also To parameter
appending to existing file 89
PMT( ) function, about 65 Q
Poisson distribution Quit command, about 254
displaying in a graph 98
monetary sampling Quotation marks
displaying on screen 107
evaluation 180 Find command, using 198
format, specifying 96, 109
sample size, advantages of reverse, in date expressions 11
graphing 98
using 314–315
saving in a separate file 95
Population
Overwriting compared to
appending 89
Sample dialog box 289 R
Size command, specifying 316 Radio buttons, adding to custom
Precision dialog boxes 160
adjustment factor, monetary
P sampling 180–181
RAM, display amount available for
Packed field type, described 18 use 167
392 Index

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

about 284–295 288 functions 12


example, monetary unit substantive testing 285 Server files, joining restrictions 225
sampling 292–293 understatement testing 284–285 Set command
example, record sampling 293– Save command Echo keyword 310–311
295 about 296–297 Filter keyword 311
No Repeats dialog box examples 296–297 History keyword 311
option 289 syntax 296 Index keyword 312
selecting fields or Scope parameters options, command mode 309
expressions 290 First 96 preference equivalents 309
values, determining 251 limiting record processing with Set Exact, using with
Sample dialog box options Next 102 BETWEEN( ) 32–33
Cell 288 specify condition using Shift fields button, using 194
Cutoff 288 While 110 SHIFT( ) function, about 76–77
Extract Fields 289 Screen parameter, using 107 Shifting fields in command
Fixed Interval 289 Search command mode 195
Interval 289 about 298–302 Sign indicators, hexadecimal 21
MUS 289 examples 300–302 Simple groups, creating 204
Population 289 expressions, finding 299 Single-prompt dialog boxes,
Random 290 Find Literal parameter 298 creating 115–117
Record 290 index files, using 217 Size button, Sample dialog box 290
Report Selection Order 290 Locate If, parameter 299 Size command
Seed 290 record numbers, finding 299, about 314–322
Size 290 300 confidence, specifying 315
Start 290 Searching examples 319–322
Subsample 291 in command mode 302 expected error rate,
Sample size key fields in indexed files 217 specifying 316
attribute sampling, range of values 32–33 expected total errors,
generating 314–315 Seed, Sample dialog box 290 specifying 316
calculating in command Seek command materiality, specifying 316
mode 322 See also Seek Expression option of monetary sampling type,
determining 314 Search command specifying 316, 317
Poisson distribution, advantages about 303 population, specifying 316
of using 314–315 syntax 303 record sampling, specifying 316,
Samples Seek Expression 317
regenerating 286–288 See also Find Literal upper error limit, specifying 316
Sampling Search command option 299 Skip
bias, about 284–285 Segmenting character strings 78 List command keyword 233
cell selection method 286 Sequence command Tape command keyword 344
command mode, using 295 See also Gaps and Duplicates Sort command
compliance testing 284–285 about 304–308 about 323–327
confidence, specifying in Size autoexecuting 304 Classify command
command 315 duplicates testing 304 alternative 324
errors, evaluating 179–185 fields, specifying 305 examples 325–326
fixed interval selection gap ranges, reporting 305 key fields or expressions,
method 285–286 gaps testing 305 selecting 324
most likely error 180–181 maximum number errors, order, specifying 324
overstatement testing 285 specifying 305 Sort order
precision adjustment factor 180– missing items, listing 305 ascending 91
181 Sequence errors, finding 304 ascending or descending 324
random selection method 286– Serial dates, convert using default, changing 93
394 Index

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

Troubleshooting tape, command mode 246 Z


procedures 367 Variables
Zero values, displaying as
Two-digit years, changing changing values 127
blanks 104
default 12 group commands, using 206
Zeros
names, overwriting 127
leading, filtering out 54
results stored in ACL fields 9
related files, source 261
U test using If command 214
Zoned
Unconditional computed fields, values, displaying in command
field type, described 22
defining in command mode 145 mode 168
format, converting from
Undelimited SDF format, VAXfloat field type
numeric 85–86
creating 233 about 22
ZONED( ) function, about 85–86
Undo typing in batch window 169 Verify command
ZSTAT( ) function, about 86–88
Unisys field type, described 21 about 350
Z-statistic
Unmatched records, Join command autoexecuting 350
Benford command 129
option 225 error limit, specifying 351
calculating 86–88
Unsigned example 351–352
data type, using for byte-aligned specifying fields or expressions to
data 16 verify 351
field type, about 21–22 VERIFY( ) function, about 84
format, converting numeric Verifying
data 82–83 data validity in command
UNSIGNED( ) function, about 82– mode 353
83 validity of data using VERIFY( )
Upper error limit functions 84
monetary sampling 179–185 View, access using Define Report
Size command, specifying 316 command 149
Upper error limit frequency, record View-name, command mode
sampling 179–185 syntax 149
UPPER( ) function, about 83–84
Uppercase, converting from lower
or mixed case 83–84 W
Use Output File While
See also Open parameter, using 110
parameter, described using with First parameter 96
Utility Width
ACL, about 355–357 column, changing in Dump
software, tape system 363 command 173
default, modifying 111
field modifier, using 111
V Word format, ACL data 186
Validity WordPerfect format, ACL data 186
data, test using Verify Workspaces
command 351 activating 118–120
errors, find using Verify defined 296
command 350 deleting in command mode 151
VALUE( ) function, about 84 saving 296–297
Values
compute using Calculate
command 133 Y
Variable length files, opening in Year, changing century default 12
ACL™
Version

7 Reference Manual

Reference Manual
ACL for Windows

ACL Services Ltd.


1550 Alberni Street
Vancouver, BC, Canada V6G 1A5
Tel: +1-604-669-4225 Fax: +1-604-669-3562
E-mail: info@acl.com Web: www.acl.com

ACL Europe S.A.


Rue de Hennin 67 – 69
1050 Brussels, Belgium
Tel: +32-2-642-22-90 Fax: +32-2-642-22-91

7
E-mail: info_europe@acl.com Web: www.acl.com

ACL Services (Singapore) Pte. Ltd.


50 Kallang Avenue
#07-05 Noel Corporate Building
for Windows
ACL™
Version
WDE7087

Singapore 339505
Tel: +65-299-3350 Fax: +65-299-5110
E-mail: info_asia@acl.com Web: www.acl.com

Anda mungkin juga menyukai