Using This Reference Manual Chapter 1 to Issue ACL Commands



Similar documents
Crystal Reports Payroll Exercise

TheFinancialEdge. Administration Guide

TheFinancialEdge. Administration Guide

Copyright 2006 ACL Services Ltd. All rights reserved.

ACL Command Reference

Time & Expense Entry WalkThrough

Ohio University Computer Services Center August, 2002 Crystal Reports Introduction Quick Reference Guide

COGNOS Query Studio Ad Hoc Reporting

ACL. for Windows. Version 7

User's Guide. Using RFDBManager. For 433 MHz / 2.4 GHz RF. Version

Chapter 2: Clients, charts of accounts, and bank accounts

Sample- for evaluation purposes only! Advanced QuickBooks. TeachUcomp, Inc. A Presentation of TeachUcomp Incorporated. Copyright TeachUcomp, Inc.

Getting Started with IntelleView POS Administrator Software

Tips and Tricks SAGE ACCPAC INTELLIGENCE

EXCEL Using Excel for Data Query & Management. Information Technology. MS Office Excel 2007 Users Guide. IT Training & Development

Excel 2010: Create your first spreadsheet

Business Objects Version 5 : Introduction

Lesson 07: MS ACCESS - Handout. Introduction to database (30 mins)

Scribe Online Integration Services (IS) Tutorial

LETTERS, LABELS &

Supply Chain Finance WinFinance

Basic Excel Handbook

DiskPulse DISK CHANGE MONITOR

Access Queries (Office 2003)

Blackbaud, Inc. This publication, or any part thereof, may not be reproduced or transmitted in any form or by any means, electronic, or

Strategic Asset Tracking System User Guide

Microsoft Access Basics

EXCEL PIVOT TABLE David Geffen School of Medicine, UCLA Dean s Office Oct 2002

GFI FAXmaker 14 for Exchange/Lotus/SMTP. Fax-Client Manual. By GFI Software Ltd

Excel 2003 Tutorial I

Wellspring FAX Service 1 September 2015

The information presented in this manual is subject to change without notice.

Business Insight Report Authoring Getting Started Guide

Microsoft Dynamics GP. Extender User s Guide

Web Intelligence User Guide

Unemployment Insurance Data Validation Operations Guide

SPSS: Getting Started. For Windows

MCCG PowerChart. Message Center Complete Manual. Hold the Ctrl key down & then left click on a link below to navigate to it:

Appendix A How to create a data-sharing lab

How To Backup A Database In Navision

STATGRAPHICS Online. Statistical Analysis and Data Visualization System. Revised 6/21/2012. Copyright 2012 by StatPoint Technologies, Inc.

ORACLE USER PRODUCTIVITY KIT USAGE TRACKING ADMINISTRATION & REPORTING RELEASE 3.6 PART NO. E

TheFinancialEdge. Reports Guide for Accounts Receivable

Participant Guide RP301: Ad Hoc Business Intelligence Reporting

TheFinancialEdge. Records Guide for Fixed Assets

REUTERS/TIM WIMBORNE SCHOLARONE MANUSCRIPTS COGNOS REPORTS

Microsoft Office Access 2007 Basics

How To Write Tvalue Amortization Software

NEWSTAR Training Guide. Banking, Consolidations and Tax Systems

TheFinancialEdge. Configuration Guide for Accounts Payable

Simply Accounting Intelligence Tips and Tricks Booklet Vol. 1

Query and Export Guide

ENTERPRISE DATA WAREHOUSE PRODUCT PERFORMANCE REPORTS USER GUIDE EXTERNAL. Version: 1.0

-lead Grabber Business 2010 User Guide

Blackbaud StudentInformationSystem. Reports Guide for Admissions Office

Excel Working with Data Lists

Microsoft Access 2010 Part 1: Introduction to Access

How To Create A Report In Excel

How To Create A Report On A Pc Or Macbook

Custom Reporting System User Guide

ORACLE BUSINESS INTELLIGENCE WORKSHOP

Enterprise Interface User Guide

OvidSP Quick Reference Guide

MODULE 2: SMARTLIST, REPORTS AND INQUIRIES

Checkout User Guide. Salesforce, Spring

Search help. More on Office.com: images templates. Here are some basic tasks that you can do in Microsoft Excel 2010.

To reuse a template that you ve recently used, click Recent Templates, click the template that you want, and then click Create.

SHARP Digital Signage Software Pro PN-SS05 OPERATION MANUAL

Utility Billing Software Manual

TheFinancialEdge. Reports Guide for General Ledger

Accounting Manager. User Guide A31003-P1030-U

Timeless Time and Expense Version 3.0. Copyright MAG Softwrx, Inc.

Accounts Receivable WalkThrough

MAS 500 Intelligence Tips and Tricks Booklet Vol. 1

EMC Documentum Webtop

Introduction to Business Reporting Using IBM Cognos

NDA ISSUE 1 STOCK # CallCenterWorX-Enterprise IMX MAT Quick Reference Guide MAY, NEC America, Inc.

Data Tool Platform SQL Development Tools

13 Managing Devices. Your computer is an assembly of many components from different manufacturers. LESSON OBJECTIVES

2002 Blackbaud, Inc. This publication, or any part thereof, may not be reproduced or transmitted in any form or by any means, electronic, or

Add external resources to your search by including Universal Search sites in either Basic or Advanced mode.

ArchestrA Log Viewer User s Guide Invensys Systems, Inc.

Bulk Image Downloader v3.0 User's Guide

NEC Express5800 Series NEC ESMPRO AlertManager User's Guide

AccXES Account Management Tool Administrator s Guide Version 10.0

Import Filter Editor User s Guide

Advanced Excel 10/20/2011 1

Decision Support AITS University Administration. Web Intelligence Rich Client 4.1 User Guide

Dashboard Builder TM for Microsoft Access

Wellnomics Risk Management Software 2.7.1

Microsoft Access 3: Understanding and Creating Queries

COMSPHERE 6700 SERIES NETWORK MANAGEMENT SYSTEM

Enterprise Reporting Advanced Web Intelligence Training. Enterprise Reporting Services

Project Management WalkThrough

ImageNow User. Getting Started Guide. ImageNow Version: 6.7. x

TOPS v3.2.1 Calendar/Scheduler User Guide. By TOPS Software, LLC Clearwater, Florida

ACCESS Importing and Exporting Data Files. Information Technology. MS Access 2007 Users Guide. IT Training & Development (818)

How To Use The Mail Control Console On A Pc Or Macbook (For A Macbook)

ServerView Inventory Manager

Transcription:

Copyright 1998 ACL Services Ltd. All rights reserved No part of this manual may be reproduced or transmitted in any form by any means, electronic or mechanical, including photocopying and recording, information storage, retrieval, or transmission, 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 August 1998 by: ACL Services Ltd 575 Richards Street Vancouver, BC Canada V6B 2Z5 Telephone: Fax: E-mail: Web: +1-604-669-4225 +1-604-669-3562 info@acl.com www.acl.com Printed in Canada 10 9 8 7 6 5 4 3 2 1 ISBN 0-9681454-8-5 ACL and Audit Command Language are registered trademarks of ACL, or one of its subsidiaries or licensors. 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.

Using This Reference Manual Chapter 1 The ACL for Windows Reference Manual provides the following: Information on ACL commands, including: instructions on issuing ACL commands a description of each command an explanation of command dialog boxes the command mode syntax for each command practical examples A glossary of frequently used terms in ACL Appendices containing useful information Reference information on most of the items from the Data, Analyze, and Tools menus For more information: On how to use ACL, see the ACL for Windows User Guide. Some commands can only be accessed in command mode through the Command Log window and do not have an equivalent dialog box. However, you may be able to use other ACL dialog boxes or windows to achieve the same effect. The dialog box contents describe parameters that you can use in both command mode syntax and dialog boxes. Each dialog box has an illustration and a description of its contents. Dialog boxes are shown as they would appear when selected from the appropriate menu. The examples for the commands are shown with the default preference settings in effect. For more information: On factory defaults, see Setting Preferences on page 7-1 in the ACL for Windows User Guide. 1-1

Chapter 1 Using This Reference Manual Parameters you can only use in command mode syntax for which there are no equivalent dialog boxes are described in Common Parameters on page 1-11. Note: Command-mode-only commands are clearly marked at the beginning of their descriptions. If you are an ACL for Windows user, you will probably not use command mode and can ignore the related references to it. If you do intend to use command mode, you must understand the conventions. The conventions for describing the command mode syntax are in Symbols and Conventions on page 1-4. For more information: On using ACL in command mode, see Command Mode on page 8-38 in the ACL for Windows User Guide. For easy reference, the commands are listed alphabetically, with each command beginning on a new page. Issuing Commands You can execute commands in ACL a number of different ways, depending on your skills and work preferences. Using Menus You can issue ACL commands by selecting either Data, Analyze, Sampling, or Tools from the menu bar, choosing a command, and then specifying options in dialog boxes. Using menus eliminates keyboards and helps you avoid errors. A command that is not applicable to the task at hand is disabled and appears grayed out in the menu. Using the Button Bar You can issue ACL commands by clicking a button in the button bar. A button for a command that is not applicable to the current task appears grayed out and does not respond when you click it. 1-2

Using This Reference Manual Chapter 1 For more information: For details on using the button bar, see Button Bar on page 2-6 in the ACL for Windows User Guide and Setting Up the Button Bar on page 7-19 in the ACL for Windows User Guide. Note: You can autoexecute many commands by first clicking in the column heading of an appropriate fields and then clicking a command button or choosing a command from a menu. Because the Autoexecute Commands preference is turned on by default, the command executes automatically. Using Command Log window You can also enter commands directly into the Command Log window. If the command is correct, it will execute immediately. If the command is incorrect, ACL will display an error message, and then show the appropriate dialog box. If you do not know the entire command syntax of a command, you may type the parts you do know and click the (Edit the Command) button. You can press Ctrl -z to undo the last typing you did. When finished, click [OK] in the dialog box. 1-3

Chapter 1 Using This Reference Manual Using Batches and Groups Batches and groups are ways of combining and storing commands to make processing faster and more efficient. Batches and groups can be used together, and are a powerful combination. A batch is a series of ACL commands stored in a batch file in an ACL document. This series of commands can be executed repeatedly and automatically. You can structure a batch to run unattended or to prompt the user for information each time it is run. Batches are especially useful for repeat applications and for creating standard routines for field personnel or analysts to use. A group is a series of commands that is processed in a single pass of the file. You enter groups in a batch, then run the batch to execute the commands. Using groups can greatly increase processing speed. You can also use groups to program with ACL, and to process special and complex files. If you are a new ACL user, you may want to become more familiar with the basics of ACL before creating and running groups. For more information: See Advanced Techniques, Command Mode, and Last Result on pages 8-1, 8-38 and 5-49 respectively in the ACL for Windows User Guide. Symbols and Conventions To help you use this manual more efficiently, the way information is presented has been standardized. Symbols Used in This Manual Represents a key that performs a specific function. For example, represents the key labeled Enter or Return on your keyboard. [Button] Represents a button or a tab in a dialog box that performs a specific function. For example, [OK] represents the button labeled OK. 1-4

Using This Reference Manual Chapter 1 Represents a button that performs a specific function or command. For clarity and brevity, buttons are referred to throughout the manual by their icon. For example, represents the Extract command. Indicates a command for advanced users of ACL. Note: Calls attention to important information. For more information: Indicates a reference to further information on a related subject. ; Indicates : Indicates the menu selections required to access the command. the command mode syntax for the command. Indicates the button bar icon for the command. For example, this icon would appear next to the title of the Histogram section. Text Formatting Conventions UPPERCASE lowercase italics Brackets< > Braces{ } Uppercase indicates the parameters in each command. Lowercase italics represents a user-specified entry. In Command Mode syntax, angle brackets indicate that the entry within the brackets is optional. In Command Mode syntax, braces indicate a set of choices from which one must be chosen (choices are separated by a vertical bar ). 1-5

Chapter 1 Using This Reference Manual Bar Dots... Required In Command Mode syntax, a bar indicates that a choice between options must be made (usually associated with braces { } ). In Command Mode syntax, dots indicate that the preceding item may be repeated. This notation describes the contents of a dialog box. It indicates that the parameter must be specified in order to execute the command. A message box prompts you to supply the required information. Use of Numbers and Bullets 1. Numbered lists indicate a series of steps required to complete a task. Bullets highlight a list of points in which sequence is not important. Summary of ACL Commands ACCEPT : ACTIVATE : AGE ;#: ASSIGN : CALCULATE : Allows an ACL batch program to prompt the user for information when the batch is run. Activates a workspace and temporarily adds a set of field definitions to the existing set of fields in the current input file. Produces aged summaries of data in a graph or text format. Stores a value as a variable conditionally or unconditionally. Computes and displays the value of an expression. 1-6

Using This Reference Manual Chapter 1 CLASSIFY ;#: CLOSE : COMMENT ;#: COUNT ;#: DEFINE FIELD : DEFINE RELATION ;#: DEFINE REPORT : DELETE and DELETE HISTORY : DIALOG ;#: DISPLAY : Counts the number of records falling into each unique class of a character field and accumulates field totals for each class. Closes an open input file. Inserts a remark or explanation into the log file without affecting processing or execution. Counts the number of records in the current input file, or only those records that meet a specified condition. Creates a new field. Defines relationships to other data files in your ACL document. Lets you process and analyze the information from several files at the same time. Creates a new report or allows you to edit an existing report. Removes unwanted fields, variables, batches, formats, or files. For example, DELETE HISTORY removes the file history. Prompts for user input with custom dialog boxes that control how a batch is run. You can include radiobuttons, checkboxes, and dropdowns in the custom dialog boxes. Dialog is an enhancement to ACCEPT. Displays information about your current ACL environment. 1-7

Chapter 1 Using This Reference Manual DO BATCH ;#: DO REPORT : DUMP ;#: DUPLICATES ;#: ELSE ;#: END ;#: EVALUATE ;#: EXPORT ;#: EXTRACT ;#: FILE HISTORY ; FIND : GAPS ;#: Runs an ACL batch. Prints an ACL report. Displays the contents of a file or the current record in hexadecimal, ASCII, and EBCDIC format. In menu mode, this file browser lets you specify parameters and view the results in one window. Tests for duplicates in the key field records. Provides an alternate set of commands when a Group If test is false in a conditional group. Closes or finalizes a Group or Loop command. Determines the effect of errors in sampling results. Creates a file which can be used by other software programs for further processing. Extracts selected records or fields from the current file and copies them to another file. Shows when and how a file was created. Use the Set History command to set the number of history entries. Locates the first record in an indexed input file that has an index key value equal to, or greater than, a specified value. Tests for gaps in the key field sequence. 1-8

Using This Reference Manual Chapter 1 GROUP ;#: HELP ;#: HISTOGRAM ;#: IF : IMPORT : INDEX ;#: JOIN ;#: LIST : LOCATE : LOOP ;#: MERGE ;#: OPEN : Executes a series of ACL commands with only one pass of the input file. Provides online explanations of ACL commands, field types, functions, and features. Produces the distribution of records over the values of a field, or expression, in a graphical format. Applies a condition that must be met in order to execute the next command. Copies an ODBC database table into your ACL document. Creates an index file that allows direct access to the records of an input file in logical rather than physical order. Combines fields from two sorted input files into a third file. Displays selected output data in a columnar list format. Moves to a specified record number, or to the first record meeting a specified condition. Processes the same record more than once. Combines two sorted files with identical record structures into a third file. Opens a new input file. 1-9

Chapter 1 Using This Reference Manual PASSWORD : PAUSE : PROFILE ;#: QUIT : RANDOM ;#: REFRESH : RENAME : REPORT ;#: SAMPLE ;#: SAVE : SEARCH ; SEEK : Requests a password for password protected files. Displays a message to the user. Provides summary statistics on one or more numeric fields in the input file. Ends an ACL session. Generates random numbers. Updates an ODBC database table to its current data. Changes the name of a field or file. Creates and formats a report. Sets different fonts for the report header, footer, column headings, data, and subtotals. Creates record or monetary unit samples from a population within an input file. Stores field definitions in a workspace. Moves directly to the specified records in a file. Moves directly to the first record containing a specified search key in an indexed file. 1-10

Using This Reference Manual Chapter 1 SEQUENCE ;#: SET ;#: SIZE ;#: SORT ;#: STATISTICS ;#: STRATIFY ;#: SUMMARIZE ;#: TOP : TOTAL ;#: VERIFY ;#: Determines if key fields in the current file are in sequential order and can detect and report duplicates and/or missing items in the sequence. Changes the status of the system conditions which determine how ACL operates. For example, use Set Century to set the start of century to process dates with 2-digit years correctly for the 21 st century, Set Filter to apply a filter to subsequent commands, and Set History to set the maximum number of File History entries. Determines an appropriate sampling size. Sorts the current input file into ascending or descending order based on specified key fields. Calculates descriptive statistics on one or more numeric fields in the current input file. Counts the number of records falling into specified intervals (strata) of numeric field values and totals one or more numeric fields for each stratum. Generates a record count and numeric field value totals for each distinct value of key character fields. Moves to the first record in the current input file. Totals numeric fields or expressions in the current input file. Checks for data validity errors in the current input file. 1-11

Chapter 1 Using This Reference Manual Common Parameters You can include parameters in most ACL commands to either limit how much of the active file is to be processed or limit the execution of a command or batch. Choosing Fields from a Selected Fields Dialog Box For ACL commands available through a dialog box, you can choose fields by clicking the [Command Name On] (such as [Index On] button in the command dialog box). For example, select Data from the menu bar and choose Sort to display the Sort dialog box. Click [Sort On] to display the Selected Fields dialog box. You can specify the input key fields or expressions to be used for sorting. Note: You should select the appropriate radiobutton before you select fields. The Ascending and Descending radiobuttons only relate to the fields you select after you select the appropriate radiobutton. 1-12

Using This Reference Manual Chapter 1 Ascending Descending Indicates the key field should be in ascending order. The default is Ascending. If you have changed the default to Descending, be sure to select Ascending before moving fields from the Available Fields to the Selected Fields list in the Selected Fields dialog box. If you are indexing a file on more than one key field, the sort order does not have to be consistent from one field to the next. For example, you can index Keyfield1 in ascending order and Keyfield2 in descending order. Indicates the key field should be in descending order. Be sure to select Descending before moving fields from the Available Fields to the Selected Fields list in the Selected Fields dialog box. If you are indexing a file on more than one key field, the sort order does not have to be consistent from one field to the next. For example, you can index Keyfield1 in ascending order and Keyfield2 in descending order. Choosing Parameters from a Dialog Box For ACL commands available through a dialog box, you choose parameters by clicking the [More] tab to display More options for that command: 1-13

Chapter 1 Using This Reference Manual ALL FIRST NEXT WHILE Selects all records. Selects a specified number of records, starting from the beginning of the file. Selects a specified number of records, starting at the current position of the file. Selects records or executes a command while a specified condition is true. It takes the form of While test, where test is any expression that evaluates to a true/false value. When you click [While], ACL displays the expression builder: 1-14

Using This Reference Manual Chapter 1 By default, ACL commands automatically execute from the beginning of a file. Specifying a While test will override the default, allowing processing to start from the current location. The file is positioned immediately after the end of the range unless the end of the file (EOF) is encountered, in which case the file is repositioned to the start. Because While can cause processing to be interrupted before reaching the end of the file, While cannot be used as a parameter for a command in a group. SUPPRESS OTHERS BREAK Default: No Suppression. Check this box to suppress reporting of any items outside the aging periods you specified. This checkbox is only available with certain commands. Causes the < (Minimum value) and (Maximum value)> headings and values to be suppressed. Clicking Break calls up the Expression Builder and allows you to produce new command output each time a change in the specified key break field occurs. You must specify a character field. This option is only available with certain commands. For meaningful results, your file must be sorted on the key character fields. 1-15

Chapter 1 Using This Reference Manual To break on one field, type the field in the text box or click [Break] and select the field from the Selected Fields dialog box. To break on more than one field, separate the fields with a + sign. Click [Expr] in the Selected Fields dialog box to display the expression builder. To break on a numeric field, you must first use the STRING( ) function to convert it to character format. For more information: See STRING( ) on page 4-73. For meaningful results, your file should be sorted on the same fields, and in the same order, as those specified in this option. Append To Existing File For commands that can send the output to a file, the [More] tab has an Append To Existing File checkbox. Check this box to bypass the dialog box that asks if you want to overwrite or append to an existing output file. 1-16

Using This Reference Manual Chapter 1 If you uncheck this option and the output file exists, a dialog box asks if you want to overwrite or append to the existing file. If the output file does not exist, ACL creates the file. Note: Be sure the two file structures are identical before using this option. ACL appends your output to the existing file regardless of the file structure of the two files ACL does not display the Append To Existing File checkbox for commands that do not append the output to existing files, such as the Index command. [Output] The [Output] tab lets you send output to the screen, a printer, a graph, or a text file. The Output options you choose remain selected until you change them or quit ACL. Graph Select this radiobutton, to have ACL display the results in a graph. The default is a 3D bar graph. You can select 2D or 3D bar graph, stacked bar graph, pie graph, or line graph formats. You can change the title of the graph or rotate the pie graph. 1-17

Chapter 1 Using This Reference Manual ACL does not store changes to the graph. To store your changes, you can save the graph as a bitmap file or copy it to the clipboard and paste it elsewhere. For more information: See Changing Graph Options on page 5-41 in the ACL for Windows User Guide. Note: ACL always displays and prints graphs on one page, which may make some graphs difficult to read. For more information: To change graph properties see, Changing Graph Labels on page 5-40 in the ACL for Windows User Guide. ACL still creates the character-based output in the command log as before. The graph output is an addition to, and not a replacement of, the characterbased output. You can recreate a graph from any command in the command log that can send its output to a graph. All commands that can create a graph display the line <<< Graphable Data >>> under the command in the Command Log window. To create a graph from the command line in the command log, double click the result in the command log. You can create graphs of the Age, Classify, Histogram, and Stratify commands from old command logs in previous versions of ACL. Open the command log, re-execute the command and specify the output to a graph. For output to a graph, you can specify a title and subtitle in Graph Properties. 1-18

Using This Reference Manual Chapter 1 Note: Batches cannot send their output to graphs. If a batch command is set to output to a graph, the output is written in text format in the command log. For more information: Graph Output Option on page 5-34 in the ACL for Windows User Guide. File If you select the File radiobutton, specify the name of the output file. Click [Name] to display the Save File As dialog box to specify a file name. For output to the screen, printer, or text file, you can also display or print a header centered at the top and/ or a footer centered at the bottom of each page. For the Report command, you can send the output to an HTML file that you can use on the Web. For more information: See HTML Output on page 5-29 in the ACL for Windows User Guide. Use Output File This option lets you use the new file created by the command right away as your input file. If you uncheck this checkbox, you continue to use the original input file after you run the command. Adding Parameters in Command Mode For ACL commands available only in command mode only, you add the parameters to the command mode syntax. For more information: On working in command mode, see Command Mode on page 8-38 in the ACL for Windows User Guide. 1-19

Chapter 1 Using This Reference Manual APPEND Use the Append keyword in command mode to add your command output to the bottom of the existing output file. You can achieve the same effect by checking the Append to Existing File checkbox, on the [More] tab. Be sure the two file structures are identical before using this option. ACL appends your output to the existing file regardless of the file structure of the two files. For example: EXTRACT RECORD TO create-file-name APPEND EOF FOOTER HEADER IF Causes the complete command to be executed one additional time after the end of the file has been reached. This parameter is only specified if all fields are variables relating to earlier records. Displays or prints a footer centered at the bottom of each page. This overrides any values set by the special FOOTER variable. Displays a header centered at the top of each page. This overrides any values set by the special HEADER variable. Selects only certain records from a file or limits the execution of a command. Allows you to apply this command to only those records that meet a specified condition. To specify the condition, either type it directly into the text box, or click [If] to display the expression builder to help you build an expression. For more information: See Expression Builder on page 6-1 in the ACL for Windows User Guide for details. 1-20

Using This Reference Manual Chapter 1 Note: OPEN If you are working with an input file to which a global filter has been applied, the [If] condition is applied in addition to, not instead of, the filter. Opens a new file as part of a command. For commands that create a file, include the Open keyword at the end of the command to open the new file right away. There is no need to issue a separate command. If an input file is already open, ACL closes the file before executing the command. For example: EXTRACT RECORD TO create-file-name OPEN TO Sends the output from a command to a new file with a user-specified name. You can use up to 31 characters for the file name. For file storage purposes, long names are compressed to eight characters. 1-21

Chapter 1 Using This Reference Manual Contacting ACL If you have a question about using ACL, first refer to these resources for information: ACL for Windows User Guide Online Help Your company s internal ACL technical support center, if available If you still can't find the solution to your problem and you are a supported user, in North America you can contact ACL Technical Support by telephone at +1-604-669-4997 (fax: +1-604-669-3562). If you have access to the World Wide Web, you can contact ACL s Technical Support at www.acl.com and click the Online Technical Support button to fill in the Online Technical Support Request Form. Overseas users can call their local authorized ACL distributor and/or support center. If you have access to the Internet, you can get online help at www.acl.com, or send e-mail to support@acl.com. When contacting ACL concerning problems, be sure to have the following information on hand: The serial number of your copy of ACL (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 1-22

Commands Chapter 2 ACCEPT : The Accept command allows an ACL batch to prompt for information when a batch is run. This command can only be issued in Command mode. For more information: See Command Mode on page 8-38 in the ACL for Windows User Guide. Accept is useful in creating application batches for repeated use when you want ACL to prompt you for specific variable input. For example, you may want to be prompted for sampling intervals, file names, department numbers, or report headers and footers each time a batch is run. Accept is included in a batch at the time it is created. When the batch is subsequently run and the Accept command is encountered, the associated prompt strings are displayed in a dialog box. ACL suspends execution of the batch and waits for you to enter a response into a dialog box text box. Clicking [Cancel] in the prompt dialog box cancels the execution of the batch. ACL stores the response in a variable as a character value. Note: Accept is not a valid command within a group. To prompt the user for a file name or a keyword, you must refer to the variable name as a macro. For more information: For a full discussion of interactive batches and using macros in batches, see Using Interactive Batches on page 8-8 in the ACL for Windows User Guide. ACCEPT 2-1

Chapter 2 Commands : For more information: For more complex user input from a batch, please refer to DIALOG on page 2-44. Command Mode Syntax ACCEPT prompt-string <FIELDS field types> TO variable-name <,... > prompt-string Specifies the message to be displayed to the user, prompting for information to be entered when the batch is executed. The prompt string must be surrounded by quotes and should be brief. Each separate Accept command generates a separate prompt dialog box. Including more than one prompt string in a single Accept command line results in more than one prompt in a dialog box. FIELDS Allows for the text box in the prompt dialog box to be replaced by a dropdown containing: character fields (C) numeric fields (N) logical fields (L) date fields (D) character variables (c) numeric variables (n) logical variables (l) date variables (d) views and reports (xr) batches (xb), or input files (xf); or any combination thereof. For example, FIELDS CNLD generates a dropdown containing the names of all fields; and FIELDS cnld generates a dropdown containing the names of all variables. The field types must be surrounded by quotes. 2-2 ACCEPT

Commands Chapter 2 For more information: For details on the Fields keyword, see Using Interactive Batches on page 8-8 in the ACL for Windows User Guide. TO variable-name Assigns the user response to the prompt-string to the specified variable-name. A character variable will be created. Specifies the variable name for storing the user response for use in subsequent commands in the batch If the named variable already has a value, this will be used to initialize the edit box. Example To create a batch named RANSAMP that prompts the user for a file name, a field to be sampled, a sampling interval, and a random start value, use the Accept command. The batch appears as follows: When you run the batch, the first dialog box prompts you for the file name: ACCEPT 2-3

Chapter 2 Commands Subsequent dialog boxes ask you for the field to be sampled. Notice that as a result of using the FIELDS keyword, there is a dropdown for choosing the numeric field to be sampled. The interval value: And the random start value: Note: Including the prompts for the field to be sampled, the interval value, and the random start value in the same command line in the batch creates the following dialog box: 2-4 ACCEPT

Commands Chapter 2 ACL displays the result of the batch in the Command Log window: Select INVSAMP from the Select Input File dialog box to see the sampled records. For more information: For details on creating and using macros with the Accept command, see Using Macros in Batches on page 8-27 in the ACL for Windows User Guide. ACCEPT 2-5

Chapter 2 Commands ACTIVATE : Activate is used when you have a set of fields stored in a workspace that are used with a variety of input files. This command can only be issued in Command mode. For more information: See Command Mode on page 8-38 in 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 a Workspace on page 8-94 in the ACL for Windows User Guide for details. 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: On workspaces, see Workspaces on page 8-92 in the ACL for Windows User Guide and SAVE on page 2-163 in this manual. 2-6 ACTIVATE

Commands Chapter 2 : Command Mode Syntax ACTIVATE <WORKSPACE> workspace-name <OK> WORKSPACE workspacename OK Indicates that a workspace is to be activated. Specifies the name of the workspace you want to activate for your current document. 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. Example This example uses Activate to activate a workspace, INVMARG, 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 prior to activating the workspace, type the following into the Command Log text box: ACL displays the contents of the file in the Command Log window. ACTIVATE 2-7

Chapter 2 Commands To activate the workspace, using the Activate command, type the following in the Command Log text box: Reissue the Display command to reveal the file contents after activating INVMARG, 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. 2-8 ACTIVATE

Commands Chapter 2 AGE ; Note: Use the Age command to produce aged summaries of data. This summary may be based on the current date or a specified cutoff date. Age is commonly used to classify invoices by the number of days they have been outstanding as of the fiscal year-end, or the current date. Click or select Analyze from the menu bar and choose Age. The number of records in each age classification is displayed in an ACL generated column entitled COUNT. You can accumulate totals from numeric fields for each age classification. You must specify a cutoff date to use as a reference in determining the age of a date field value or the aging will be based on the current system date. Often, the date selected will be the fiscal year-end or the date of issuing the Age command. You can specify start points and a final end point for your aging classifications, such as 0, 90, 120, and so on, or accept the default settings of 0, 30, 60, 90, 120, and 10,000 days. These defaults are set in date preferences. AGE 2-9

Chapter 2 Commands [Age On] Required Specifies the input file field or expression to be aged. Select the field from the dropdown, or click [Age On] to display the Selected Fields dialog box. For meaningful results, select a date field or expression, such as one containing due dates or transaction dates. [Accumulate Fields] Cut-off Date Periods Required [If] Generates a total for each age classification in the numeric fields or expressions selected. Select the fields from the list box, or click [Accumulate Fields] to display the Selected Fields dialog box. Allows you to specify the date to which dates in the [Age On] field will be compared. Often, the cutoff date will either be a period or fiscal year-end, or the date at time of processing. Cutoff date must be specified in YYMMDD format regardless of the format of the date field. Default: Current system date. Allows you to specify the starting point for each range. The last number entered is interpreted as the end point for the last range. Enter the values one per line in the Periods text box. Use 10,000 days to isolate items with invalid dates which default to Jan 1, 1900 (about 35,000 days). Default: 0, 30, 60, 90, 120, 10,000 days. You can change the default periods for all your Age commands in the Date Options Preference. Defines a test that filters out all records that do not meet the test. See Common Parameters on page 1-11 and IF on page 1-9. For information on building expressions, see Expression Builder on page 6-1 in the ACL for Windows User Guide. 2-10 AGE

Commands Chapter 2 [More] [Output] For more information on [More] see Choosing Parameters from a Dialog Box on page 1-13. For more information on [Output] see [Output] on page 1-16. : 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> Example To determine whether accounts receivable are collectible, it is crucial to know the aging of outstanding balances. This example ages the records in an accounts receivable file based on the due date field, accumulating the transaction amount field, using December 31, 1997, as the cutoff date, and accepting the default setting for the period intervals. AGE 2-11

Chapter 2 Commands ACL displays the result in the Command Log window: The results indicate that $217,113.27 of the outstanding balance is not yet due. These balances comprise 33.03% of the total number of records and 46.30% of the total accounts receivable balance. Each aging category can be analyzed in a similar manner. Any significant overdue balances warrant further investigation. For example, items aged over 10,000 days (25 years overdue) are likely to be invalid date fields. 2-12 AGE

Commands Chapter 2 ASSIGN : You can use the Assign command to store a value as a variable. You can also attach a condition to the Assign command. This command can only be issued in Command mode. For more information: See Command Mode on page 8-38 in the ACL for Windows User Guide. Assign is typically used in a batch where 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: Note: 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/truncated or the decimals are adjusted if required, or the variable is not used in a computed field, or is assigned outside a group, then the previous value and its specifications 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. You can also create new and edit existing variables using the expression builder. For more information: See User-Created Variables on page 8-90 in the ACL for Windows User Guide for details. ASSIGN 2-13

Chapter 2 Commands : Command Mode Syntax <ASSIGN> variable-name = expression <IF test> Use the following syntax when creating variables: ASSIGN 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. variable-name Specifies the name of the variable to be created. All field naming conventions apply. For more information: See Working with Functions on page 6-28 in the ACL for Windows User Guide for details. expression <IF> Specifies the value to be assigned to the variable. All ACL expression conventions apply. When the If test is false, the assignment is not made. If there is no test, or the test is true, the assignment is made. Example 1 Takes the value of the product class for the current record and assigns it to a variable named MPRODCLS. Type 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. 2-14 ASSIGN

Commands Chapter 2 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. ASSIGN 2-15

Chapter 2 Commands CALCULATE : The Calculate command computes and displays the value of an expression. This command can only be issued in Command mode. For more information: See Command Mode on page 8-38 in 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. For more information: See Fixed Point Arithmetic on page 6-9 in the ACL for Windows User Guide for more details. Whenever you use Calculate without providing for the result, by using the AS modifier, ACL names the result with the expression name. For more information: On the use of AS on page 8-45 of the ACL for Windows User Guide. 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: Please see FIND on page 2-71, SEEK on page 2-170, and LOCATE on page 2-111. 2-16 CALCULATE

Commands Chapter 2 : Command Mode Syntax CALCULATE expression <AS expression-name> <,...> expression You can specify any valid ACL expression subject to the prerequisites above. For more information: See Expression Builder on page 6-1 in the ACL for Windows User Guide for details on the order of precedence of evaluation of ACL expressions and a list of valid operators. 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, type CALC 4.7*18.5 in the command log text box: Click or press Enter to calculate the result. Choose Last Result from the Command Log window dropdown to display the result: Note: ACL rounds the result. CALCULATE 2-17

Chapter 2 Commands For more information: See Fixed Point Arithmetic on page 6-9 in 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 type the following into the Command Log text box: Choose Last Result from the Command Log window dropdown to display the result: 2-18 CALCULATE

Commands Chapter 2 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 value. 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. Click or select Data from the menu bar and choose Classify. For more information: This command can be Autoexecuted. For more information on the Autoexecute Commands preference, see Command Options on page 7-9 in the ACL for Windows User Guide. CLASSIFY 2-19

Chapter 2 Commands [Classify On] Required [Accumulate Fields] Specifies the input file character field or expression to be classified. Select the field from the dropdown, or click [Classify On] to display the Selected Fields dialog box where you can select fields and build expressions. 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 where you can select fields and build expressions. For more information: On the Selected Fields dialog box, see Choosing Fields from a Selected Fields Dialog Box on page 1-12 and Selection/Edit Dialog Boxes on page 2-15 in the ACL for Windows User Guide. [If] Defines a test that filters out all records that do not meet the test. See Common Parameters on page 1-11 and IF on page 1-9. 2-20 CLASSIFY

Commands Chapter 2 For more information: On building expressions, see Expression Builder on page 6-1 in the ACL for Windows User Guide. [More] See Choosing Parameters from a Dialog Box on page 1-13. : [Output] See [Output] on page 1-16. 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> For more information: For a description of other parameters specific to issuing the Classify command in command mode, see Common Parameters on page 1-11. 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. CLASSIFY 2-21

Chapter 2 Commands Note: The Classify command does not require the data to be sorted. The default view of the PRODSALE file appears as follows: 2-22 CLASSIFY

Commands Chapter 2 CLOSE The Close command closes an open input file, similar to clicking the (Close) button in the Overview window or clicking [None] in the Select Input file dialog box. : For more information: See Selection/Edit Dialog Boxes on page 2-15 in the ACL for Windows User Guide for details. This command can only be issued in Command mode. For more information: See Command Mode on page 8-38 in 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 have defined relationships in your ACL document, the Close command will close both the primary and any secondary files, in addition to the related files. If you are closing a primary or secondary input file, ACL removes all corresponding field definitions from the current environment. Any changes to record definitions are saved before closing. ACL automatically closes the input file before executing the Open and Quit commands. 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 document. For more information: For more information on using the Batch Recorder, see Creating a Batch on page 8-2 in the ACL for Windows User Guide. CLOSE 2-23

Chapter 2 Commands : Command Mode Syntax CLOSE CLOSE {PRIMARY SECONDARY LEARN} CLOSE file-name INDEX LOG PRIMARY SECONDARY LEARN Closes the current index Returns the log file to the default Closes the primary file. Closes the secondary file. Closes the currently open Learn file. Example To close an open accounts receivable primary file named AR without opening a different file, type the following into the Command Log text box: The status bar will now indicate that no input file is open. You could also enter: CLOSE PRIMARY 2-24 CLOSE

Commands Chapter 2 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. Click or select the Tools menu and choose Comment. 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 appropriate point in the results. : To use this command, type the comment into the text box and click [OK]. Command Mode Syntax COMMENT comment-line or COMMENT 2-25

Chapter 2 Commands COMMENT comment-line comment-line... comment-line Allows you to enter text into a log file, a batch or a group. When you include more than one comment-line, you must place a blank line after the last commentline to indicate that it is the last comment-line. If you do not leave a blank line, ACL will treat 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, type 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: 2-26 COMMENT

Commands Chapter 2 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. COMMENT 2-27

Chapter 2 Commands ; COUNT Click or select Analyze from the menu bar and choose 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. [If] Defines a test that filters out all records that do not meet the test. See Common Parameters on page 1-11 and IF on page 1-20. For information on building expressions, see Expression Builder on page 6-1 in the ACL for Windows User Guide. 2-28 COUNT

Commands Chapter 2 [More] See Choosing Parameters from a Dialog Box on page 1-13. : Command Mode Syntax COUNT <IF test> <WHILE test> <FIRST NEXT range> 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 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 procedures. COUNT 2-29

Chapter 2 Commands 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 2-65 for details. 2-30 COUNT

Commands Chapter 2 DEFINE FIELD : Use the Define Field command to create a field in ACL. This command can only be issued in Command mode. For more information: See Command Mode on page 8-38 in the ACL for Windows User Guide. You can define an additional field to add to your input file definition or define a computed field. Computed fields form part of the input file definition. Note: Fields may overlap and do not have to be next to each other in ACL. 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. When creating computed fields, you can only define simple computed fields in command mode. A simple computed field definition could be: 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. ACL does not provide prompting for defining fields in command mode; you must include the entire field definition in a single command line. For more information: To define a conditional computed field, use the techniques described in Working with Computed Fields on page 4-28 in the ACL for Windows User Guide. DEFINE FIELD 2-31

Chapter 2 Commands : Note: A more powerful and convenient way to define fields is with the Input File Definition window as described in Defining Data Fields on page 4-18 and Working with Computed Fields on page 4-28 in the ACL for Windows User Guide. Use these techniques whenever possible. Command Mode Syntax DEFINE FIELD field-name field-type startposition field-length <decimals> DEFINE FIELD field-name COMPUTED expression The first command syntax defines a field to add to your input file definition. The second command syntax defines a computed field. field-name field-type Can be from 1 to 31 alphanumeric characters long, including the underscore character (_), but must begin with an alphabetic character. Upper and lowercase characters are treated the same. 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. Identifies the appropriate field type. For more information: See Field Types on page 3-1 for details on the field types ACL can read. start-position field-length decimals Identifies the first byte position counting from 1 and going from left to right of the field being defined. Specifies the length in bytes of the field being defined. Applies only to numeric field types. Identifies the number of decimal places to the right of any decimal point. 2-32 DEFINE FIELD

Commands Chapter 2 Computed expression Identifies the field being defined as a computed field. Can be any valid ACL expression. For more information: See Examples of Expressions on page 6-7 in the ACL for Windows User Guide for details. Example To define an ASCII field, INVNUM, containing invoice numbers with a start position of byte 1 and a length of 6 bytes, use Define Field. Type the following into the Command Log text box: If this is the first field defined in a new input file definition, the Input File Definition window appears as follows: Note: Notice that defined positions (in bytes) appear shaded in the window. DEFINE FIELD 2-33

Chapter 2 Commands DEFINE RELATION ; Use Define Relation to process and analyze information in more than one file at a time. Most functions of the Join command can be done more quickly and easily using Define Relation. Click or select Data from the menu bar and choose Relations. Before you start to relate data files, you should think carefully about exactly what you want to do. The extra time you spend on planning will save you much time and effort later. You should be very clear about what files/fields you want to relate, why those files/fields must be related, and how the files/fields should be related. Overview A good approach is to first sketch out a diagram of how you want to relate the files and fields, such as the following: AR (parent file) Invoice No. Invoice Date Customer Number Contract Number Invoice Amount Customer (related file) Customer Number Name Address Credit Limit Contract (related file) Contract Number Contract Date Contract Type Sales Rep Number Sales Rep (related file) Sales Rep Number Name Address YTD Sales 2-34 DEFINE RELATION This diagram describes a possible set of relationships. Among other fields, the AR file contains a Customer Number field and a Contract Number field. You can use the Customer Number field to form a relationship with the Customer file. This means that you can access fields

Commands Chapter 2 from the Customer file such as the customer name, address, and credit limit that are related to each AR transaction. You can also use the Contract Number to access contract details for each AR transaction. One of the contract details is the Sales Rep number. You can use the Sales Rep number to access Sales Rep details from the Sales Rep file, such as the Sales Rep name and year-to-date sales. Once you have set up the relationships, you can access any related information from the Customer, Contract, or Sales Rep files as they are related to the AR file. How ACL Sets Data Relations Use Define Relation to set a relationship between two or more files in your ACL document. ACL relates files by using a character field or expression, in the parent file to relate to an index in a related file. To set a relationship, the two files in your ACL document must have a common field. For example, an AR file has accounts receivable information including a unique customer number, invoice number, date, contract number, and the invoice amount. A Customer file has fields for a unique customer number, customer name, address, and so on. You can relate these two files on the common field the customer number. Note: While the common fields do not need to have the same field name, they must contain the same data so that you can relate the two fields. After you set relations, you can add fields from the related file to the view of the parent file. In the new view, ACL displays the corresponding records from the related file based on the customer number. You can now simultaneously analyze data from both files. If there are duplicate records in the related file, ACL uses the first occurrence. If there is no matching record in the related file, ACL displays a blank for character and date fields, zero for numeric fields, and F for logical fields. You can set any number of relationships in your ACL document. ACL stores all relationships and related fields in your ACL document until you delete them. DEFINE RELATION 2-35

Chapter 2 Commands Related on Customer Number AR (parent file) Customer (related file) Result: the new view of the AR file shows fields from both files Note: You can relate multiple files to either a parent file or to a related file, as long as each pair of files shares a common field. In this way, you can relate files in a hierarchy of several layers. Prerequisites The related field in the parent file must be a character field or expression. Where necessary, use the Expression Builder to convert it to a character field. You can use the Expression Builder to combine fields or to convert fields into strings or substrings, and then use the fields to relate to another file. 2-36 DEFINE RELATION

Commands Chapter 2 For more information: See Expression Builder on page 6-1 in the ACL for Windows User Guide for details on using the Expression Builder. Note: Note: The related field in the parent file does not have to be indexed or sorted. The related file does not have to be sorted, but must be indexed on the common field used by both files. Indexes To see your files indexes, do one of the following: Note: Click or select Window from the menu bar and choose Open Overview. The Overview window lists all the indexes in your ACL document under the Indexes component. The indexes for each file are also listed under the Input File Definitions component, or Select File from the menu bar and choose Print Documentation. Check the All Index Definitions checkbox or All Input File Definitions checkbox, or Select Data from the menu bar and choose Relations. The Using Index list box shows the indexes for the file specified in the Related File dropdown. If an index file becomes outdated, ACL automatically recreates the index file using the same index file name. Setting Relations Click or select Data from the menu bar and choose Relations. ACL displays the Relations dialog box. DEFINE RELATION 2-37

Chapter 2 Commands related file key field from primary file index file Parent File [Related on] Required Related File Required The parent file is the currently open file. ACL displays the file name of the parent file. To change to a different parent file, close the Relations dialog box and open the primary file in your view. Then select Data from the menu bar and choose Relations. ACL sets all relations from the parent file to the related files. Allows you to select the field, or expression, to relate to the child file. You can select only one field for each relationship. Select a field from the list box. Allows you to select the child file. Related files must be indexed. This dropdown displays all the available files in your ACL document except the parent file and files already related. Select the related file from the dropdown. 2-38 DEFINE RELATION

Commands Chapter 2 Using Index Required Relationships [Delete last relationship] Allows you to select the index file to relate to the parent file. Select an index from the list box. Shows details of the relations for the open file. The format is: related file name related by field name using index index file name. Allows you to delete relations from the newest to the oldest relationship. Because newer relationships may depend on older ones, you cannot change the order of relationships. You can only delete relationships in reverse chronological order. Click this button to remove the last relationship. ACL asks if you want to delete the newest relationship. Click [Delete] or [Cancel]. Accessing Related Fields After setting relations, you can access fields from related files in any dialog box with an Available Fields list box. This includes the Add Columns dialog box, the Selected Fields dialog box and the Expression Builder. In any of these dialog boxes, click the From Input File dropdown to display all available related files. When you select a file, the Available Fields list box displays the fields from that file. DEFINE RELATION 2-39

Chapter 2 Commands : 2-40 DEFINE RELATION Field names from related files use the format IFDname.fieldname to indicate the source of the data. IFD refers to the input file definition. For example, customer.name shows that the field name came from the Input File Definition customer. Command Mode Syntax There are three Relation commands and one Relation keyword. DEFINE RELATION key-field-name WITH relatedfile-name INDEX index-name DELETE RELATION <OK> If you use the optional OK qualifier, then ACL deletes the latest relationship without confirmation. Otherwise ACL asks Are you sure you want to delete relation-file-name? Click [Yes] to delete the latest relationship. Relationships are always deleted in reverse chronological order from the newest to the oldest. Repeat this command to delete each relationship. For more information: See DELETE and DELETE HISTORY on page 2-41. DISPLAY RELATION ACL displays all the relationships for the current file in the format related-file-name related by key-field-name using index indexname. For example: "products" related by "order_id" using index "prodidx" In command mode only, you can use the Open command to open a related file and define a temporary relationship to that file. This relationship is temporary and is erased when you close any of the files. This is most useful in batch mode where you can use the Open command to open and define a relationship with one command. When you use the Open command to open and define a temporary relationship, the Display Relation command does not display the temporary relationship. OPEN related-file-name INDEX index-name <RELATION primary-file-related-field-name>

Commands Chapter 2 For more information: See RELATION on page 2-47 for details. Example This example relates the Customer file to the AR file using the AR file as the parent file and the Customer file as the related file. You must first index the related files. In the Overview window, double click the Customer file or drag the file to the application workspace to open it. 1. Select Data from the menu bar and choose Index. ACL displays the Index dialog box. 2. Index on the field NO which is the customer number field. Specify a file name in the To text box. Call the index Customer. Click [OK]. If you are working in command mode, type in the following: DEFINE RELATION NO WITH Customer INDEX Customer For more information: See Index on page 8-67 in the ACL for Windows User Guide for more details. DEFINE RELATION 2-41

Chapter 2 Commands You can now relate the two files. Open the AR file by double clicking its file name in the Overview window or by dragging it to the application workspace. Using the Open Command 1. Select Data from the menu bar and choose Relations. ACL displays the Relations dialog box showing AR as the parent file. 2. In the Related on box, click the NO field to select it as the field to relate. 3. Click the Related File dropdown and select the Customer file. When you select the Customer file, the Using Index box displays the index name for that file. 4. In the Using Index box, select the index Customer. 5. Click [Relate]. ACL adds an entry in the Relationships box showing how the files are related. 6. Click [Done] to close the Relations dialog box. 2-42 DEFINE RELATION

Commands Chapter 2 In the view of the AR file, you can now add as many fields as you need from the Customer file. Click the (Add columns) button to display the Add Columns dialog box. Then click the From Input File dropdown to display the related files. Select the Customer file to display its fields. Notice that the fields from related files are in the format filename.fieldname to show the source of the fields. Select the fields you want to add to the view and click [OK]. ACL adds the selected fields to the view of the AR file. You can now simultaneously analyze data from both files at the same time. Fields from primary file Fields from related file DEFINE RELATION 2-43

Chapter 2 Commands : DEFINE REPORT This command can only be issued in Command mode. For more information: See Command Mode on page 8-38 in the ACL for Windows User Guide. The quickest and easiest way to produce a new report and maintain an existing one is to work directly from a view. For more information: Creating a report from a view and all report formatting options are described in Producing Reports on page 5-19 in the ACL for Windows User Guide. : You can also use the Define Report command to: display a blank view to allow you to create a new report display a report view to allow you to modify an existing report The Define Report command is simply a different way of accessing the view on which a report is based. 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. 2-44 DEFINE REPORT

Commands Chapter 2 : DELETE and DELETE HISTORY This command can only be issued in Command mode. For more information: See Command Mode on page 8-38 in the ACL for Windows User Guide. 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. The specified item is removed from the current environment 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. Even if the Set Safety On option in Preferences is not turned on, you are still prompted for confirmation. Note: The functionality of the Delete command is available through Edit dialog boxes. Use Delete History to prevent the file history from becoming too large. You can issue the Delete History command in a batch, or from the Command Log window to delete the file histories of the currently open input file. Input file notes are always retained. In the rare case that commands such as Classify, Extract, Join, Merge, Sample, Sort, Stratify, or Summarize create a carry forward file that is used in the next cycle of processing, the file history of the carry forward file can become very large. As the file history grows, you may experience slow performance that could lead to premature termination of the batch. Note: The SET HISTORY command can be used to set the maximum number of histories to retain. DELETE and DELETE HISTORY 2-45

Chapter 2 Commands : Note: To save the file histories of an existing input file before deleting them, issue the following command on the Command Log window command line: 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 create a batch with the Create Batch from View option under the Tool menu. Command Mode Syntax DELETE {field-name variable-name file-name ALL} <OK> DELETE HISTORY <number-to-retain> DELETE RELATION <OK> ALL number-toretain OK Indicates that all variables in the current ACL environment are to be deleted. Fields are not affected. Indicates the number of histories to be retained. Indicates that the command is to be executed without confirmation. Default: Confirmation requested. 2-46 DELETE and DELETE HISTORY

Commands Chapter 2 Example 1 To delete an unwanted field (QTYOO) containing the quantity of inventory items on order, type the following into the Command Log text box: ACL displays a dialog box asking you to confirm that you want to delete the field. 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). DELETE and DELETE HISTORY 2-47

Chapter 2 Commands ; DIALOG The Dialog command displays a custom dialog box for user data entry. You create a Dialog command using the dialog builder, which is only available from the Edit Batch window. Although you may manually edit a Dialog command, this is not recommended, as the dialog builder includes full edit capabilities. Custom dialog boxes control how the batch is run by prompting the user for input and selections. The Accept command provides for simpler dialog boxes, however, the Dialog Builder is more powerful with more functionality. The Dialog Builder gives you a full range of control types, including radiobuttons and checkboxes. You can also specify the size and placement of all controls within the dialog. DIALOG BUILDER The batch Dialog Builder is an advanced feature for the experienced user. Before you start to build a batch or use the Dialog Builder, you should think carefully about what you want the batch to do. An excellent approach is to sketch out the flow of the batch before you start to build it. The extra time you spend on planning the batch will likely save you much time and effort. For example you may wish to have the answers to the following questions before you build a batch or use the Dialog Builder: 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? To make full use of the Dialog Builder s features, you should be familiar with all batch commands, macros, and variables of batches based on user input. 2-48 DIALOG

Commands Chapter 2 : For more information: See DO BATCH on page 2-48 and Batches on page 8-1 in the ACL for Windows User Guide, or Using Dialog Boxes in Batches on page 8-11 in the ACL for Windows User Guide. Command Mode Syntax Note: The syntax for the Dialog command is not described, as it is recommended that you use the Dialog Builder to create and edit the Dialog command. For more information: Please see Using Dialog Boxes in Batches on page 8-11 in the ACL for Windows User Guide. DIALOG 2-49

Chapter 2 Commands : DISPLAY This command can only be issued in Command mode. For more information: See Using Macros in Batches on page 8-27 in the ACL for Windows User Guide. : Use the Display command to show information about the current ACL environment. The information displayed depends on the keyword you specify. Command Mode Syntax DISPLAY <PRIMARY> DISPLAY SECONDARY DISPLAY DATE TIME DISPLAY VARIABLES DISPLAY HISTORY DISPLAY FREE SPACE DISPLAY VERSION DISPLAY OPEN DISPLAY RELATION PRIMARY, SECONDARY DATE TIME 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. Displays the current date and time as defined by your computer s operating system. Displays the current date and time as defined by your computer s operating system, and is a synonym for DATE. 2-50 DISPLAY

Commands Chapter 2 VARIABLES Note: HISTORY FREE SPACE VERSION OPEN RELATION 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. The default amount of space for variables is 60K. However, ACL will automatically increase the amount of space available for storing variables when necessary. Displays the file history, as described in FILE HISTORY on page 2-69. Displays the amount of memory (RAM) available for use. The amount displayed does not include RAM reserved for variables. Displays the amount of memory (RAM) available for use, and is a synonym for FREE. Displays the version of ACL that is currently running. Displays all the opens files of your current ACL document. Displays the related files in your input file definition. Example To display the input file definition for the primary file, INVENTORY, type the following into the Command Log text box: DISPLAY 2-51

Chapter 2 Commands ACL displays the result in the Command Log window: 2-52 DISPLAY

Commands Chapter 2 ; DO BATCH Note: Click or select Tools from the menu bar and choose 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. 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 8-1 in the ACL for Windows User Guide. DO BATCH 2-53

Chapter 2 Commands Do a Batch list box Required [If] Allows you to select the batch to be run. If no batches have been created, the list box is empty. Allows you to specify a condition that must be met in order for the batch to be executed. To specify the condition, either type it directly into the text box or click [If] to display the expression builder to help you build an expression. For more information: See Expression Builder on page 6-1 in the ACL for Windows User Guide for details. When an If test is specified, the test is evaluated immediately, based on the current values for the fields and variables defined. The values for the fields will normally be those for record 1, unless the previous command positioned the file elsewhere (for example, after using While, Next, or the Search command). If the test evaluates as true, the batch proceeds. Otherwise no action is taken, and the batch is not executed. 2-54 DO BATCH

Commands Chapter 2 : Note: The action of IF is very different than for a command that reads a data file. Command Mode Syntax DO <BATCH> batch-name <IF test WHILE test> WHILE Allows you to execute the same batch repeatedly, until the test is false. If the test is initially evaluated as false, the batch is not executed at all. A While test is particularly useful if you have a process you want to perform on repeated blocks in a file. There are no limits placed on the actions performed in a batch. 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. Example To run a batch, INVCOUNT_PREP, that provides a basic overview of inventory before attending an inventory count, use Do Batch. Select INVCOUNT_PREP from the Do a batch dialog box. DO BATCH 2-55

Chapter 2 Commands The results are displayed in the Command Log window. 2-56 DO BATCH

Commands Chapter 2 : DO REPORT This command can only be issued in Command mode. For more information: See Command Mode on page 8-38 in the ACL for Windows User Guide. 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 more information: For a more detailed discussion on ACL s reporting features, see Producing Reports on page 5-19 in 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, type 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. DO REPORT 2-57

Chapter 2 Commands : DUMP Note: Click or select Tools from the menu bar and choose 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. There is also a dialog box equivalent that may be accessed from the Tools menu. Command Mode Syntax 1. DUMP file-name <SKIP n> <COLUMNS c> <HORIZONTAL> 2. DUMP RECORD <COLUMNS c> <HORIZONTAL> TO <FILENAME> SKIP COLUMNS HORIZONTAL Allows you to bypass n bytes before the dump begins. Default: 0 Allows you to change 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. Default: 16 for vertical, 64 for horizontal Displays the data in an over and under format horizontally across the screen, rather than just side by side. Default: Vertical 2-58 DUMP

Commands Chapter 2 Action 1. Dump displays the file in blocks of 16 characters on the screen in hex, ASCII, and EBCDIC format. 2. Dump displays the contents of the current record in the primary file in hex, ASCII, and EBCDIC format. This format is only valid when a primary file is open. DUMP 2-59

Chapter 2 Commands ; DUPLICATES Click or select Analyze from the menu bar and choose 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 checkbox in the Sequence command dialog box, however selecting Duplicates causes ACL to check the Duplicates checkbox by default. For more information: See SEQUENCE on page 2-172 for details on the Sequence and Duplicates commands. Example See the example in Sequence on page 2-177. 2-60 DUPLICATES

Commands Chapter 2 ; ELSE Click in a batch window. To open a batch window: Double click the name of a batch in the Overview window and click [Edit], or Select Edit from the menu bar and choose Batches. In the Batches dialog box, select a batch or click [New]. 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 only used 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 will be processed if the test succeeds, and the commands between Else and End will be 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 will be executed for each record. For more information: See Command Groups on page 8-29 in the ACL for Windows User Guide. ELSE 2-61

Chapter 2 Commands : Command Mode Syntax ELSE <IF test> Example See GROUP on page 2-74. 2-62 ELSE

Commands Chapter 2 ; END Click in a batch window to insert the End command to close or finalize a Group or Loop command. To open a batch window: Double click the name of a batch in the Overview window and click [Edit], or Select Edit from the menu bar and choose Batches. In the Batches dialog box, select a batch or click [New]. End is only used 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 Command Groups on page 8-29 in the ACL for Windows User Guide. : Command Mode Syntax END Example See GROUP on page 2-74. END 2-63

Chapter 2 Commands ; EVALUATE Note: Click or select Sampling from the menu bar and choose Evaluate. Use the Evaluate command to determine the effect of errors detected in your sampling results. 1. You can use Evaluate to determine record (attribute) sampling errors. The result is expressed as a rate of error, not an amount of error. 2. You can also use Evaluate to determine monetary sampling errors. The result is expressed in most likely error amount and the upper error limit (UEL) for the specified confidence. The theory behind statistical sampling is complex and goes beyond the scope of this volume. If you re not familiar with the critical judgements required when performing statistical sampling, we recommend that you consult a statistics specialist before using the ACL Evaluate, Sample, and Size commands. Evaluating Monetary Sampling Errors Confidence Interval The level of confidence (entered as a percentage). The sampling interval used for the sample drawn. 2-64 EVALUATE

Commands Chapter 2 Errors For each error, specify the sample item amount followed by the amount of error. Separate the two amounts with a comma. [Output] See Common Parameters on page 1-11. How Evaluate Works The Evaluate command uses the sampling parameters and errors and calculates their effect on the upper error limit (UEL). For record (attribute) 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 dollar amount. This is the amount you are confident that 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: Upper Error Limit Frequency = UEL Cumulative Factor 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. EVALUATE 2-65

Chapter 2 Commands 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: 1. The basic precision for the sample is determined by multiplying the sampling interval by the Poisson UEL factor for the specified confidence (assuming no errors). 2. For each error entered, the percentage of tainting is determined by dividing the error amount by the item amount. 3. 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. 4. 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. 5. 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 number in the Poisson tables. This re-ordering 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. 2-66 EVALUATE

Commands Chapter 2 : Note: Various sample evaluation methodologies use adjustment values for understatement 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. 6. 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. 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 errors... EVALUATE 2-67

Chapter 2 Commands 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: The result is: You can be 95% confident that the actual error rate in the population does not exceed 6.47%. 2-68 EVALUATE

Commands Chapter 2 Example 2 To evaluate the upper error limit for a monetary sample with 90% confidence, given a sampling interval of $300,000 and the following three item amounts and errors: The 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. EVALUATE 2-69

Chapter 2 Commands 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 will also be reported and so there is no need for statistical projection. 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. 2-70 EVALUATE

Commands Chapter 2 ; EXPORT Click or select Data from the menu bar and choose Export. Use the Export command to create a file which can be used directly by other software programs for further processing. Export has a number of applications. You can: produce a mail merge document, then export to a word processor format to prepare confirmation letters export to a presentation graphics package to produce high quality presentation materials based on your data export specified fields to a software system that provides different reporting functionality than ACL Export also 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. : For more information: See also Exporting Files on page 5-45 in the ACL for Windows User Guide. Command Mode Syntax EXPORT <FIELDS> field-list TO create-file-name <IF test> <WHILE test> <FIRST NEXT range> <TRIM> {ASCII DBASE DELIMITED EXCEL LOTUS WORD WP WDPF6 CLIPBOARD} <APPEND> For a description of parameters specific to issuing this command in command mode, see Common Parameters on page 1-11. EXPORT 2-71

Chapter 2 Commands Example 1 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. You can then use Export to export the output from the Sample command in merge format to WordPerfect. Example 2 You may have information in a customer file that you need for address confirmations, but the information is not formatted as you d like: To get the format you want, you may have to export the file to WordPerfect. To do this, use the Export command. All fields except the credit limit field are exported. The credit limit field is not needed to produce the confirmations. 2-72 EXPORT

Commands Chapter 2 The new CUSMAST file is now ready to be imported and used in WordPerfect without extensive editing and formatting. EXPORT 2-73

Chapter 2 Commands ; EXTRACT Note: Click or select Data from the menu bar and choose 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 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). 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. 2-74 EXTRACT

Commands Chapter 2 Record Fields [Extract Fields] Required if Fields is selected Allows you to extract entire records from the input file. Allows you to extract selected fields from the input file. 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. For more information: See Choosing Fields from a Selected Fields Dialog Box on page 1-12 and Selection/Edit Dialog Boxes on page 2-15 in the ACL for Windows User Guide. Computed fields are converted to the appropriate field type in the created file: ACL, ASCII, Date, or Logical. [If] See IF on page 1-20. EXTRACT 2-75

Chapter 2 Commands [More] See Choosing Parameters from a Dialog Box on page 1-13. : Command Mode Syntax EXTRACT {RECORD <FIELDS> extract-fields} TO create-file-name <IF test> <WHILE test> <FIRST NEXT range> <EOF> <APPEND><OPEN> For more information: For a description of parameters specific to using this command in command mode, please see Common Parameters on page 1-11. 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, NEGVAL, for further investigation. 2-76 EXTRACT

Commands Chapter 2 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 INVTEXT. (Not all of the fields selected are visible in the sample list box.) EXTRACT 2-77

Chapter 2 Commands The extracted records appear in the Default View of the INVTEXT file: 2-78 EXTRACT

Commands Chapter 2 ; FILE HISTORY Click or select Tools from the menu bar and choose File History. This issues the DISPLAY HISTORY command. Please see DISPLAY for a description of the syntax. 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) To set the maximum number of history entries, use the Set History command. For more information: See SET HISTORY on page 2-184. 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 window. It is also recorded in the log file. If no history appears in the Command Log window, the file has no history. FILE HISTORY 2-79

Chapter 2 Commands : For a file to have a history, it must have been created by an ACL command. Command Mode Syntax DISPLAY HISTORY Example To display the file history for the file created in Example 1 of the Extract command, use File History. The file history shows the date and time the file NEGVAL was created, and that it was created by extracting all records from the inventory file that had a negative value or quantity on hand. 2-80 FILE HISTORY

Commands Chapter 2 : FIND This command can only be issued in Command mode although the SEARCH Option in the Analyze menu also provides access to FIND. For more information: See Command Mode on page 8-38 in the ACL for Windows User Guide. 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. For more information: See SEARCH on page 2-164 for details. : 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 FIND 2-81

Chapter 2 Commands charactersearch-key Indicates the value of the key to be found. The character-search-key must match the case of the value to be found, 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. Example To move to the first record containing LATEX in an inventory file that has been indexed by product description, use Find. Type 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. 2-82 FIND

Commands Chapter 2 ; GAPS Click or select Analyze from the menu bar and choose 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 checkbox in the Sequence command dialog box, however selecting Gaps causes ACL to check the Gaps checkbox 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. Example See the example in Sequence on page 2-177. For more information: See SEQUENCE on page 2-172. GAPS 2-83

Chapter 2 Commands ; GROUP Click in a batch window. Groups are only used in batches. As a result, the Group command is only available when a batch window is open. To open a batch window: Double click the name of a batch in the Overview window and click [Edit], or Select Edit from the menu bar and choose Batches. In the Batches dialog box, select a batch or click [New]. Use the Group command in a batch to execute a series of ACL commands with only one pass of the input file. The Group command significantly reduces processing time. It also enables you to program with ACL and to process special or complex input files. Using the Group command, you can create: simple groups that start with a Group command followed by a series of commands, each ending with an End command conditional groups that process commands based on whether a condition is true or false nested groups that contain other groups nested within each other Prerequisites You must have a batch open in order to use the Group, Else, and End commands. You cannot use Do commands in a Group. 2-84 GROUP

Commands Chapter 2 [If] See IF on page 1-20. For more information on building expressions, see Expression Builder on page 6-1 in the ACL for Windows User Guide. [More] See Choosing Parameters from a Dialog Box on page 1-13. How Groups Work For more information: For complete details on creating and running groups, see Command Groups on page 8-29 in the ACL for Windows User Guide. GROUP 2-85

Chapter 2 Commands : Note: Most ACL commands can be included within a group. Some commands (such as Index and Sort) cannot be included because of the amount of memory required to run them. Other commands (such as Do) cannot be included because they require immediate action. Command Mode Syntax GROUP <IF test> <WHILE test> <FIRST NEXT range> commands... <ELSE> <IF test> END commands... Example 1 By including commands in a group, you can issue different commands on a record quickly and efficiently in only a single pass through the file, as the following example illustrates: After running the batch, ACL displays the result in the Command Log window. 2-86 GROUP

Commands Chapter 2 GROUP 2-87

Chapter 2 Commands Example 2 You can also create a conditional group that lets you process commands based on whether a condition is true or false. The following group allows records that meet different criteria to be extracted to an appropriate data file: After running the batch containing the conditional group, ACL displays the result in the Command Log window. 2-88 GROUP

Commands Chapter 2 ; HELP Note: Select Help from the menu bar and choose Contents. To display Help for a particular ACL command or action, click [Help] in the corresponding dialog box, or press F1. Use the Help command for context-sensitive explanations of ACL operating features, commands, functions, and field types. If you need more help, select Help from the menu bar and choose Contacting ACL for information on how you can contact ACL Technical Support. Help information is not recorded in the log file. Displaying Context-Sensitive Help To display topics for which there is context-sensitive help, select Help from the menu bar and choose Contents or press F1. The ACL Help window appears showing a list of help subjects. In the window, you can get help by double clicking green colored text, or clicking one of the buttons. Navigating Help To navigate ACL s online help system, you can either click any green underlined text, or click one of the buttons in the Help window. [Contents] [Search] [Back] [History] Click to display a list of help subjects. Click to search for topics using speed search or to scroll through a list of topics. Click to go back to the previous help screen. Click to display a history of the topics you have viewed. HELP 2-89

Chapter 2 Commands Using speed search Use speed search to locate a specific topic. In the Help Topics list box, simply type the first word of the topic you re looking for. ACL looks for the first occurrence of the word you typed and displays the topic. To display help for that topic, select it by clicking [Display]. Search by scrolling If you are not sure which topics are available, you can search by scrolling. Scroll through and select topics displayed in the Help Topics dialog box. : For more information: On displaying context-sensitive help, using speed search, and searching by scrolling, see Need Help? on page 2-26 in the ACL for Windows User Guide. Command Mode Syntax HELP <command-name data-type-name function-name topic> 2-90 HELP

Commands Chapter 2 ; HISTOGRAM Click or select Analyze from the menu bar and choose Histogram. Use the Histogram command to produce a 3D vertical bar graph of the distribution of records over the values of a field or expression. You can also specify other types of graphs or send the result to a file or a printer. Histogram is also useful for gaining a general overview of the contents of an input file. Histogram works on unsorted data. For more information: For details on output options, see [Output] on page 1-16, Producing Other Output on page 5-33, and Graph Output Option on page 5-34 in the ACL for Windows User Guide. In addition to the graph, the results of the Histogram command are written to the Command Log in the horizontal bar graph format with a specified number of columns. An occurrence within a given range of field or expression values is represented by an asterisk (*). Each asterisk can represent a single, partial, or multiple number of occurrences, as required to fit the Histogram into the designated number of columns. ACL indicates the number of occurrences each asterisk represents. You may regenerate the graph at any time by double clicking the results in the Command Log window. Histogram offers the following options: Note: Histogram with a given number of intervals (default 10) over the values in the field or expression. The intervals are evenly spread over the range according to the interval specification (minimum to maximum). The same as above, except that you specify each interval range. This allows intervals of varying widths, although each interval must be adjacent to the preceding and following intervals. Histogram of the occurrences of different non-numeric fields or expression values. A histogram bar is displayed for each unique value of the field or expression (up to the maximum number of unique values found). The values are displayed in ascending sorted order. This command can be Autoexecuted. HISTOGRAM 2-91

Chapter 2 Commands For more information: For more information on the Autoexecute Commands preference, see Command Options on page 7-9 in the ACL for Windows User Guide. Prerequisites [Histogram On] Required Specifies the input file field or expression for which you want to develop a histogram. Character or numeric field types may be used. Select the field from the dropdown, or click [Histogram On] to display the Selected Fields dialog box. For more information: On the Selected Fields dialog box, see Choosing Fields from a Selected Fields Dialog Box on page 1-12 and Selection/ Edit Dialog Boxes on page 2-15 in the ACL for Windows User Guide. 2-92 HISTOGRAM

Commands Chapter 2 For more information: On building expressions, see Expression Builder on page 6-1 in the ACL for Windows User Guide. Minimum Required for numeric histograms For a numeric histogram, specifies the minimum value in the first interval. Any values which are less than this value are either excluded from the graph (if Suppress Others is selected in the [More] dialog box), or are included under the heading: < (Minimum value). Default: The minimum value is displayed in the key field if ACL knows the minimum value from a previously issued Profile or Statistics command. Otherwise, no default. Maximum Required for numeric histograms Intervals For a numeric histogram, specifies the maximum value in the last interval. Any values which are greater than this value are either excluded from the graph (if Suppress Others is selected in the [More] dialog box), or are included under the heading: > (Maximum value). Default: The maximum value is displayed in the key field if ACL knows the maximum value from a previously issued Profile or Statistics command. Otherwise, no default. For a numeric histogram, specifies the number of even intervals ACL produces over the specified value range (minimum to maximum). Default: 10. The default may be changed through a Command Options preference setting. For more information: Please see Intervals on page 7-11 in the ACL for Windows User Guide. HISTOGRAM 2-93

Chapter 2 Commands Free [If] [More] For a numeric histogram, 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 per line. The last number entered is interpreted as the end point of the final range. Defines a test that filters out all records that do not meet the test. See Common Parameters on page 1-11 and IF on page 1-20. For information on building expressions, see Expression Builder on page 6-1 in the ACL for Windows User Guide. See Choosing Parameters from a Dialog Box on page 1-13. [Output] See [Output] on page 1-16. Columns Specifies the number of columns (the maximum width including interval headings) of the resulting histogram. All interval counts are scaled to the space available. Default: 78. 2-94 HISTOGRAM

Commands Chapter 2 : 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> For more information: For a description of parameters specific to issuing this command in command mode, see Common Parameters on page 1-11. Example 1 To produce a histogram showing the distribution of customers among sales areas, use Histogram. Management can use this information to direct a marketing campaign. Auditors may find the information useful in gaining an understanding of their client s business. If your inventory is organized by product class, you can produce a histogram on the PRODCLS field. HISTOGRAM 2-95

Chapter 2 Commands The histogram graph appears in its own window. ACL produces character-based output for commands, as before. However, you can now create graphs of these commands by double clicking the text output in the command log. All commands that can create a graph display the line <<< Graphable Data >>> under the command in the Command Log window. To create a graph from the command line in the Command Log window, double click the results. 2-96 HISTOGRAM

Commands Chapter 2 indicates this command can be graphed Example 2 To produce a histogram on sales transaction amounts where you select the starting point of each interval and the end point of the last interval, use Histogram. If you are generally familiar with the distribution of values across the range in a population, you may want to adjust the intervals to better suit the distribution. Using even intervals does not always provide enough detailed information about the population. Select the following as your interval start values (and end value for the last interval): 0, 20, 50, 100, 200, 600, 1000, 5000, 10000, 40000. HISTOGRAM 2-97

Chapter 2 Commands The histogram appears in its own window. 2-98 HISTOGRAM

Commands Chapter 2 : : IF This command can only be issued in command mode and is only useful in batch mode. 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. Command Mode Syntax To perform a sample, but only if the variable count1 is greater than ten: IF test command Example IF Count1 > 10 SAMPLE Amount... Assume you had a previous Dialog command, with a checkbox 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 All IF 2-99

Chapter 2 Commands : 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. Use the Import command in a batch to import an ODBC file and then analyze the file just like any data file. 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. For more information: See PASSWORD on page 2-124 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. In menu mode, you can import an ODBC database by selecting the ODBC radiobutton in the Data Source dialog box. For more information: See Importing an ODBC File on page 3-4 in the ACL for Windows User Guide. 2-100 IMPORT

Commands Chapter 2 : Note: You only need to import an ODBC table once. After that, you can use the Refresh command to update the data in the ODBC table. See REFRESH on page 2-135 for details. 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...> IMPORT 2-101

Chapter 2 Commands ; INDEX Click or select Data from the menu bar and choose Index. Use Index as a prerequisite to accessing a file using Define Relation. 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. For more information: See also DEFINE RELATION on page 2-30 and Data Relations on page 8-60 in the ACL for Windows User Guide. Indexing versus Sorting The Index command is 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 a sorted file. The following table compares the benefits and drawbacks of the Sort and Index commands. Sorting versus Indexing Execution Speed slower faster Resulting File Size larger smaller Required Disk Space more less Subsequent Processing of an Entire File much faster much slower Subsequent Processing Searching for a Few Records much slower much faster Use the Index command as an alternative to the Sort command only where disk space is very limited or you want to quickly find records with a specific key value. 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. Some commands, such as the Define Relation command, require that you index the related files before defining relations. 2-102 INDEX

Commands Chapter 2 For more information: On moving directly to specified records in a file, see SEARCH on page 2-164. The Index command creates an index file which 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 under 1 second). 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. 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. 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. For more information: Before using index files, see Index on page 8-67 in the ACL for Windows User Guide for details on creating, activating, closing, and maintaining indexes. 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, but Find and Seek will only operate correctly if the first key fields are in ascending character order. Note: You will not need to use Index or Sort with Classify, Age, Histogram, and Stratify, because these commands do not require a sorted file. INDEX 2-103

Chapter 2 Commands Here are some tips for working with indexes: 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. 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. 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 also 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 will 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. 2-104 INDEX

Commands Chapter 2 Prerequisites [Index On] Required 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: On the Selected Fields dialog box, see Choosing Fields from a Selected Fields Dialog Box on page 1-12 and Selection/Edit Dialog Boxes on page 2-15 in the ACL for Windows User Guide. [If] [More] Defines a test that filters out all records that do not meet the test. See Common Parameters on page 1-11 and Common Parameters on page 1-11. For information on building expressions, see Expression Builder on page 6-1 in the ACL for Windows User Guide. See Choosing Parameters from a Dialog Box on page 1-13. INDEX 2-105

Chapter 2 Commands : Command Mode Syntax INDEX <ON> key-field <D>... TO create-file-name <IF test> <WHILE test> <FIRST NEXT range> <OPEN> Example To alphabetize a customer file for easy reference, use Index. Index on the customer name field to the index file, CUSNAME. Before indexing the customer file looks like this: 2-106 INDEX After indexing, the file appears like this:

Commands Chapter 2 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. INDEX 2-107

Chapter 2 Commands ; JOIN Note: Click or select Data from the menu bar and choose Join. Most of the functionality of Join is included in the Define Relation command. Define Relation is recommended for combining information from two files, although in some situations, Join may be more efficient. Use the Join command to combine fields from two sorted input files into a third file. Join is typically used to match data in a transaction file with records in a master file (such as matching invoice data in an accounts receivable file to a master customer file) or to compare the contents of two files. When you join a transaction file and a master, the transaction file is usually the primary file. The master file is usually the secondary file. When reading the following explanation of the various output options, you can interpret each occurrence of primary and secondary file accordingly. Note: Be sure to correctly identify your primary and secondary files. The results you obtain will differ if the files are reversed. The Join command has five output options. The output option you choose determines which records are included in the third (output) file. The following table illustrates which records are included in the output file for each option: Option Matched Primary Matched Secondary Unmatched Primary Unmatched Secondary Matched Records Y Y Matched Records -All Primary Y Y Y Matched Records -All Secondary Y Y Y 2-108 JOIN

Commands Chapter 2 (Continued) Option Matched Primary Matched Secondary Unmatched Primary Unmatched Secondary Matched Records -All Primary and -All Secondary Unmatched Records Y Y Y Y Y Matched Records: Creates an output file that includes the selected fields from the primary and secondary files for those records in the primary file for which a key field match is found in the secondary file. If there is more than one key field match in the secondary file, only information from the first matched record found is used. If no matching record in the secondary file is found, no output record is produced. Matched Records - All Primary: Creates an output file that includes the selected fields from the primary and secondary files for those records in the primary file for which a key field match is found in the secondary file. The file also includes all records from the primary file that do not have a match in the secondary file. Any non-matching records from the secondary file are ignored. Where there is no match for a record in the secondary file, the missing fields from the unmatched secondary records are filled with blanks or zeros. Matched Records - All Secondary: Creates an output file that includes the selected fields from the primary and secondary files for those records for which a key field match is found. The file also includes all records from the secondary file that do not have a match in the primary file. Any non-matching records from the primary file are ignored. Where there is no match for a record in the primary file, the missing fields from the unmatched primary records are filled with blanks or zeros. Matched Records - All Primary and All Secondary: Creates an output file that includes the selected fields from the primary and secondary files for those records for which a key field match is found. JOIN 2-109

Chapter 2 Commands Note: The file also includes all unmatched records from both the primary and secondary files. All records from both files are included in the output file. The fields for unmatched records from either file are filled with blanks or zeros. Unmatched Records: Creates an output file that includes the records from the primary file that do not have a matching record in the secondary file. This option does not include any secondary file fields because there is no secondary information if records do not have a match in the file. Only primary file information is output. If you want to identify transactions for which no master file records exist, specify the transaction file as the primary file. Alternatively, to identify master records without any matching transactions, specify the master file as the primary file. If any fields in the primary and secondary files have the same name, Join automatically assigns a new name for the joined field in the output file. For example, if both files contain a field named AMOUNT, Join tries AMOUNT2, AMOUNT3, and so on, until it finds a name that does not conflict with any field names in the output file. Prerequisites Both the primary and secondary files must be in the current document. You must sort the secondary file in ascending sequence on the key character fields before using the Join command. It is desirable (but not mandatory) to sort the primary file on the key field as well. You can check the Presort checkbox to presort the primary file on the key fields in the Join dialog box. You can also index the primary file instead of sorting it. The key fields must be character fields and their total length must be the same in both the primary and secondary files. Note: You can use Join with an unsorted primary file, but processing time will increase dramatically. If the primary file is partially sorted on the key field (for example, joining on an account code when the primary file is sorted by account code within each month), processing time increases, but not dramatically. 2-110 JOIN

Commands Chapter 2 Secondary File Required [Primary Keys] Required [Secondary Keys] Required Presort [Primary Fields] Required Allows you to select the secondary file to be joined with the primary file. Select the file from the dropdown. Specifies the primary input file character key fields or expressions to be joined. Select the key fields from the list box, or click [Primary Keys] to display the Selected Fields dialog box. Specifies the secondary input file character key fields or expressions to be joined. Select the key fields from the list box, or click [Secondary Keys] to display the Selected Fields dialog box. Check the Presort checkbox to sort the primary file on the primary keys before joining the files. Specifies the primary input file fields or expressions to be included in the joined output file. Select the fields from the list box or click [Primary Fields] to display the Selected Fields dialog box. Key fields are not automatically included and should be specified. JOIN 2-111

Chapter 2 Commands [Secondary Fields] Specifies the secondary input file fields to be included in the joined output file. Select the fields from the list box, or click [Secondary Fields] to display the Selected Fields dialog box. Key fields are not automatically included and should be specified. For more information: On the Selected Fields dialog box, see Choosing Fields from a Selected Fields Dialog Box on page 1-12 and Selection/Edit Dialog Boxes on page 2-15 in the ACL for Windows User Guide. Any character field or expression can be used so long as the total length of the primary and secondary key fields is identical. The secondary file must already be sorted on the key fields in ascending sequence. For more information: To convert numeric fields to character format, see STRING( ) on page 4-73. [If] See IF on page 1-20. See also Expression Builder on page 6-1 in the ACL for Windows User Guide. [More] See Common Parameters on page 1-11. 2-112 JOIN

Commands Chapter 2 Matched Records Matched Records All Primary Matched Records All Secondary Matched Records All Primary and All Secondary Unmatched Records Matched records from the primary file and matching records from the secondary file are included in the output file. Matched records from the primary and secondary files, and unmatched records from the primary file, are included in the output file. Matched records from the primary and secondary files, and unmatched records from the secondary file, are included in the output file. All records from both the primary and secondary files are included in the output file. Only unmatched records in the primary file are included in the output file. Default: Matched Records JOIN 2-113

Chapter 2 Commands : Command Mode Syntax Note: JOIN JOIN {PRIMARY BOTH} JOIN SECONDARY JOIN PRIMARY SECONDARY JOIN UNMATCHED You can add the following options to the syntax format, as appropriate: <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> You cannot use the presort keyword in a command group running in batch mode. Example 1 In this example, you join the matched records of two files using the All Primary option. To join fields from an accounts receivable file (the primary file) sorted by customer number and a customer master file (the secondary file) also sorted by customer number, use Join. The master file contains customer names, addresses and other descriptive information. Joining information from both these files makes preparing confirmation letters easier, and also allows for a more informative analysis of transactions. Join the primary file, ARSORT, with the secondary file, CUSTSORT, on the customer number key field. Name the joined file JNARCUS. 2-114 JOIN

Commands Chapter 2 Select the fields to be included in the joined file in the order you want them to appear in the joined file s view. From the ARSORT file, select the following fields in this order: customer number, invoice date, due date, reference number, transaction type, and transaction amount. Due to space limitations, you will not see all of the selected fields in the Primary Fields list box concurrently. From the CUSTSORT file, select the name and state fields. To maintain all of the records of the primary file in the new joined file, whether or not there is a key field match with the secondary file, click the [More] tab and turn on All Primary. The Default View of the joined JNARCUS file appears as follows: JOIN 2-115

Chapter 2 Commands The Name and State fields are placed on the far right side of the view. The joined file should have the same number of records as the primary file, because you selected All Primary. This would not necessarily be the case if you selected All Secondary or both All Primary and All Secondary. Example 2 To check for unmatched records using the same primary and secondary files, key field, and primary and secondary fields as Example 1, use Join. Any unmatched records could indicate an error in one of the files. This time, click the [More] tab, turn on Unmatched Records, and then name the new joined file NOMATCH. 2-116 JOIN

Commands Chapter 2 The Default View of the joined NOMATCH file appears as follows: 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. You will want to investigate why there is no match for this record number in the secondary file. JOIN 2-117

Chapter 2 Commands : LIST This command can only be issued in Command mode. For more information: See Command Groups on page 8-29 in the ACL for Windows User Guide. 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 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 parameters. 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. For more information: See Displaying a View on page 5-5 in the ACL for Windows User Guide for details. 2-118 LIST

Commands Chapter 2 : 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> FIELDS list-fields ALL Indicates that the fields following this keyword are to be included in the list on line one. Specifies the fields to be listed. Any field or expression may be used. Type 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. Indicates that all of the fields are to be included in the list. TO See Common Parameters on page 1-11. Default: Screen. LINE n Specifies additional output lines. n can be a value between 2 and 60. 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 information on the other lines. LIST 2-119

Chapter 2 Commands UNFORMATTED HEADER FOOTER SKIP n EOF 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. Specifies a header to be displayed centered at the top of each page. Specifies a footer to be displayed centered at the bottom of each page. 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). Causes the command to be executed one additional time after the end of the file has been reached. Specify EOF only if all fields are variables relating to earlier records. Note: When creating a multiline report, you may find using field modifiers such as Width and As, useful for aligning columns or adjusting headings. For more information: See Using Field Modifiers on page 8-44 in the ACL for Windows User Guide for details. 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 those records with a negative unit cost or quantity on hand. You can also add a descriptive header to the list. 2-120 LIST

Commands Chapter 2 Type 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 window. ACL informs you that only five records meet the test. These are unusual items and warrant further investigation. LIST 2-121

Chapter 2 Commands : LOCATE This command can only be issued in Command mode. For more information: See Command Mode on page 8-38 in the ACL for Windows User Guide. Use the Locate command to move to a specified record number or to the first record in a file meeting a specified condition. 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. 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 information: See SEARCH on page 2-164. Command Mode Syntax LOCATE <IF test> <WHILE test> <FIRST NEXT range> LOCATE RECORD n Record Specifies the record number n to be located. 2-122 LOCATE

Commands Chapter 2 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. Type the following into the Command Log text box: The Command Log window indicates the first record number that meets the condition: Record 75 appears first in your view. The next three records also describe plywood products: LOCATE 2-123

Chapter 2 Commands ; LOOP Note: Click in a batch window. Loop can only be used in a group and groups are only used in batches. As a result, the Loop command is only available for batches. Use the Loop command in a group to process a record more than once, or to process consecutive buckets in a file. The Loop command, like Group, terminates with an End command. 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. 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. For more information: See SET LOOP on page 2-185 for details. Prerequisites Like the Group, Else, and End commands, you must have a batch window open in order to use Loop. 2-124 LOOP

Commands Chapter 2 [While] Required To control looping you must include a While test in the Loop command. The process within the While loop executes until the test returns false. For more information: See Common Parameters on page 1-11 for details on using While. : Command Mode Syntax LOOP WHILE test commands... END Example To total 100 bucketed fields in a record, assuming each bucket is five bytes long, include the Loop command in a group: LOOP 2-125

Chapter 2 Commands ; MERGE Click or select Data from the menu bar and choose 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. For more information: To combine fields from a Master and Transaction file that have different structures, see JOIN on page 2-97. 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. For more information: See EXTRACT on page 2-65 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. 2-126 MERGE

Commands Chapter 2 Both the primary and secondary files must be sorted in ascending sequence on the character key fields. You can check the Presort checkbox in the Merge dialog box to sort the primary file. The primary file may 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. The total length of the character fields must be the same in both input files. Secondary File Required [Primary Keys] Required Presort [Secondary Keys] Required Allows you to select the secondary file to be merged with the primary file. Select the file from the dropdown. Specifies the primary input file character keys to be merged. Select the key fields from the list box, or click [Primary Keys] to display the Selected Fields dialog box. Check the Presort checkbox to sort the primary file on the primary keys before merging the files. Specifies the secondary input file character keys to be merged. Select the key fields from the list box, or click [Secondary Keys] to display the Selected Fields dialog box. MERGE 2-127

Chapter 2 Commands For more information: See STRING( ) on page 4-73 for details on converting numeric fields to character fields. For more information on the Selected Fields dialog box, see Choosing Fields from a Selected Fields Dialog Box on page 1-12 and Selection/Edit Dialog Boxes on page 2-15 in the ACL for Windows User Guide. [If] See IF on page 1-20. See also Expression Builder on page 6-1 in the ACL for Windows User Guide. [More] See Choosing Parameters from a Dialog Box on page 1-13. : Command Mode Syntax Note: MERGE ON key-field-list MERGE PKEY primary-key-fields SKEY secondarykey-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> 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. 2-128 MERGE

Commands Chapter 2 Example To merge the first and second quarter s general ledger files sorted on G/L account code, use Merge. It is convenient to have a year-to-date general ledger for the analysis of account transactions. 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. 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. MERGE 2-129

Chapter 2 Commands : OPEN This command can only be issued in Command mode. For more information: See Command Mode on page 8-38 in the ACL for Windows User Guide. : Note: Use the Open command to open a new input file. ACL assumes a file extension of.fil, if no other extension is specified. 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. 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. 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> 2-130 OPEN

Commands Chapter 2 input-file-name data-file-name Tape 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. 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. Indicates that an attached tape or cartridge drive is to be read. You cannot issue Open Tape as a secondary file. For more information: See Reading Data from Tape on page 7-4 for details on opening a file stored on a magnetic tape reel or cartridge. Format Bufferlength Specifies the input file definition (as displayed in the Overview window) to be associated with the data file you specify. 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. 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. OPEN 2-131

Chapter 2 Commands Key-expression This is a character type expression, based on already opened files, that will be used to locate related records in this file. You must specify a buffer length when opening a tape. If you omit the 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. The buffer length 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 will seldom need to change this parameter, because the default is sufficient to handle nearly 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. 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. 2-132 OPEN

Commands Chapter 2 Index Secondary Skip 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. 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. 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. Example 1 To open an accounts receivable input file, AR, use Open. Type the following into the Command Log text box: The status bar indicates that the AR file is open. OPEN 2-133

Chapter 2 Commands Example 2 To open the AR input file definition, but associate it with a new data file named CUTOFF.FIL: Example 3 To open a dbase file named TEST.DBF that you have not previously accessed: 2-134 OPEN

Commands Chapter 2 : PASSWORD This command can only be issued in Command mode. It is the preferred method for requesting user passwords in batches. 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. When the user types in 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 also SET ECHO on page 2-182. 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 PASSWORD 2-135

Chapter 2 Commands : PAUSE This command can only be issued in Command mode. For more information: See Command Mode on page 8-38 in the ACL for Windows User Guide. : Note: Use the Pause command to create a custom message such as an error message or input explanation. The message appears in a dialog box. 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. Command Mode Syntax PAUSE message <IF test> message IF Specify any valid character string. You can use up to 200 characters for the message. Specifies a test that is evaluated to determine whether to display the message. If no test is specified, or the test is true, the message is displayed. Processing stops until the user clicks [OK]. If the test is false, the message is not displayed, and processing continues. Example To display a message to the user in a batch, include the following Pause command: 2-136 PAUSE

Commands Chapter 2 ACL displays the prompt at the appropriate point when the batch is run: PAUSE 2-137

Chapter 2 Commands ; PROFILE Note: Click or select Analyze from the menu bar and choose 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. If you want an overview of a file prior to 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 window. To turn this option on, select Edit from the menu bar and choose Preferences. Click the [Input File Options] tab and turn on Automatically Profile on Open. 2-138 PROFILE

Commands Chapter 2 [Profile Fields] Required 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 Choosing Fields from a Selected Fields Dialog Box on page 1-12 and Selection/Edit Dialog Boxes on page 2-15 in the ACL for Windows User Guide. [If] See IF on page 1-20. See also Expression Builder on page 6-1 in the ACL for Windows User Guide. [More] See Choosing Parameters from a Dialog Box on page 1-13. PROFILE 2-139

Chapter 2 Commands : Command Mode Syntax PROFILE numeric-field-list <IF test> <WHILE test> <FIRST NEXT range> 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 window. 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 will now automatically supply $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. 2-140 PROFILE

Commands Chapter 2 As well, ACL will now automatically supply the minimum and maximum values for any Histogram and Stratify commands you perform on the VALUE field. PROFILE 2-141

Chapter 2 Commands : QUIT This command can only be issued in Command mode. For more information: See Command Mode on page 8-38 in the ACL for Windows User Guide. Use the Quit command to end an ACL session. All open files are saved and closed prior to 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 where 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. : For more information: See To Exit ACL on page 2-30 in the ACL for Windows User Guide for details. Command Mode Syntax QUIT 2-142 QUIT

Commands Chapter 2 ; RANDOM Click or select Tools from the menu bar and choose 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 will be greater than or equal to the minimum value and less than the maximum value you specify. No random number will be 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. Number Required Specifies the number of random numbers to be generated. Type in a number. RANDOM 2-143

Chapter 2 Commands Seed Minimum Required Maximum Required Columns Unique Sorted 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. 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. 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. Specifies the number of columns to be used to display the numbers. Type in a number or use the arrows to increase or decrease the number. Default: 6. 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. Where 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. Causes the output list of numbers to be displayed in ascending sort order. Default: Not sorted. 2-144 RANDOM

Commands Chapter 2 : Command Mode Syntax RANDOM NUMBER=n <SEED seed-value> MINIMUM min MAXIMUM max <UNIQUE> <COLUMNS columns-in-output> <SORTED> <TO file-name PRINT> <APPEND> Example To generate 10 unique random numbers between 1 and 1000 sorted in ascending order, in 2 columns, use Random. RANDOM 2-145

Chapter 2 Commands The ten numbers appear in the Command Log window. 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. 2-146 RANDOM

Commands Chapter 2 : REFRESH Use this command to refresh the data in an ODBC database table that you have imported. You can use the Refresh command in a batch to update your ODBC files before performing other commands in your batch. Use the Refresh command in a batch to update an ODBC file and then analyze the file just like any data file. 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. For more information: See PASSWORD on page 2-124 for details. ; In menu mode, you can refresh an ODBC database by clicking the (Refresh from source file) button in the [Input File Options] tab of the Input File Definition window. ACL asks if you want to refresh the data from its source. Click [Yes] to update the ODBC table to the current data from the source table. : Note: For more information: See Updating an ODBC File on page 3-9 in the ACL for Windows User Guide. You need to import an ODBC table first. After you have imported an ODBC database, you can use the Refresh command to refresh the database so that you are working with current data. See IMPORT on page 2-90 for details. Command Mode Syntax REFRESH input-file-definition-name <PASSWORD n> The input-file-definition-name is the location of the source file. When you refresh a file, the data in the file will be overwritten with the new data without prompting. This is similar to the Import command and the input-file-definition-name must be from a source supported by the Import command. REFRESH 2-147

Chapter 2 Commands Note: The Refresh command replaces only the data in the file. Field definitions remain unchanged. If the parameters of the Import command have changed, you will have to re-import the file. 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 2-148 REFRESH

Commands Chapter 2 : RENAME This command can only be issued in Command mode. For more information: See Command Mode on page 8-38 in the ACL for Windows User Guide. Use the Rename command to change the name of a field, file, or object in the document. You can quickly rename any of the items that make up an ACL document (for example, an input file or a batch) by selecting the name of the item in the Overview window and clicking. To use the Rename command to rename any of the items that make up an ACL document, 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. For more information: You can also rename fields using the Input File Definition window as described in Maintaining Fields on page 4-34 in 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 2-15 in 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. RENAME 2-149

Chapter 2 Commands : Command Mode Syntax RENAME <FIELD> {old-field-name old-variablename} RENAME {BATCH FORMAT INDEX REPORT WORKSPACE} old-item-name RENAME <DATA FILE LOG TEXT old-file-name> <AS TO> new-name <OK> FIELD BATCH,FORMAT, INDEX, REPORT, WORKSPACE FILE DATA, LOG, TEXT AS TO OK Allows you to rename a field. Specifies the type of the item to be renamed. Specifies that the name following is a file name. Specifies the type of file to be renamed. Implies an appropriate file extension (for example, DATA.FIL, LOG.LOG, TEXT.TXT). Allows you to designate a new name. Indicates that the renaming process can proceed without confirmation. Example 1 Where 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 INVOICE to INVNUM, use Rename. Type the following into the Command Log text box: 2-150 RENAME

Commands Chapter 2 You are asked if you are sure that you want to rename the field. Click [OK] to rename the field. The Input File Definition window now shows the field as renamed. The new name INVNUM appears in place of the INVOICE field. Example 2 To rename a June AR batch without prompting. RENAME 2-151

Chapter 2 Commands ; REPORT Note: Click or select Data from the menu bar and choose 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. 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. For more information: Creating a report is covered in detail in Producing Reports on page 5-19 in the ACL for Windows User Guide. We recommend that you read the contents of this section before you use the Report command. 2-152 REPORT

Commands Chapter 2 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. Note: You can specify different font styles for your report. The header, footer, column titles, data, and the totals can each have a different font style. ACL displays the column titles and data in the font you select in the view. To change the font, click the (Change font) button in the View window. ACL displays the Select View Fonts dialog box. You can only use the fonts installed in your computer. Click the [Header], [Titles], [Data], [Totals], or [Footer] button to display the Font dialog box where you can change the font for each area of your report. REPORT 2-153

Chapter 2 Commands ACL uses the fonts you select for the titles and data both in the View window and your report. The header, totals, and footer are printed in your report. Note: ACL does not display the header and footer in the font style you have selected in the Report dialog box. The font style will only appear when you print your report. 2-154 REPORT

Commands Chapter 2 [Output] [Preview] Your output to the printer, screen or file remains selected until you change it. If you select output to a file, you can specify either an ASCII or HTML Text File. Default: Print 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. [If] See IF on page 1-20. See also Expression Builder on page 6-1 in the ACL for Windows User Guide. 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. For more information: See Producing Reports on page 5-19 in the ACL for Windows User Guide for details. REPORT 2-155

Chapter 2 Commands 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. 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. For more information: See Suppress Blank Detail Lines on page 5-25 in the ACL for Windows User Guide for details. 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 dropdown. These options do not apply to a summarized report. Default: Single Spaced. To make your reports clearer and easier to read, you can suppress duplicate break fields that are repeated on every detail line. You can also suppress totals for numeric fields that do not require totals and suppress numeric fields that contain zeros. Suppress Duplicates, Suppress Totals, and Blank if zero are available from the Modify Column dialog box. In the View, click the (Modify column) button or double click the column heading to display the Modify Column dialog box. 2-156 REPORT

Commands Chapter 2 Suppress Duplicates If your report contains break fields that are repeated on every detail line, you may want to suppress the duplicates for break fields. You can only suppress duplicates for break fields. You must first designate which fields are break fields and then check the Suppress Duplicates checkbox in the Modify Column dialog box. For more information: See Suppress Duplicates on page 5-20 in the ACL for Windows User Guide for details on how to define break fields and suppress duplicates in your report. In command mode, the modifier for suppress duplicates is NODUPS. Suppress Totals If your report contains numeric fields, you may want to suppress the totals for some fields that do not require totals. There are two places where you can suppress totals. You can suppress totals in the Input File Definition dialog box or in the Modify Column dialog box. REPORT 2-157

Chapter 2 Commands Note: If you check the Suppress Totals checkbox in the Input File Definition dialog box, you cannot override it in the Modify Column dialog box. If you sometimes require totals for a field, check the Suppress Totals in the Modify Column dialog box. For more information: For details on suppress totals in the Input File Definition dialog box, see Formatting Data Fields on page 4-23 in the ACL for Windows User Guide. : Blank if Zero If your report contains numeric fields where most of the data is zero, blanking out the fields that contain zeros makes the exceptions stand out. Blank if zero affects both the view and the printed report. In command mode, the modifier for blank if zero is NOZEROS. Command Mode Syntax REPORT <ON> key-field <NODUPS> <PAGE>... {FIELDS ACCUMULATE} otherfields<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> 2-158 REPORT

Commands Chapter 2 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. Numeric fields are always totalled unless you specify the SUPPRESS field modifier. Zeros are displayed unless you specify the NOZEROS field modifier. For more information: See Using Field Modifiers on page 8-44 in the ACL for Windows User Guide for details on modifiers you can use to change how information is output. EOF Causes an extra record to be output after the end of the file is reached. EOF is only appropriate if the contents of the fields to be included in the report are variable or static. Example 1 In this example, you prepare a report. After you ve 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 dropdown. REPORT 2-159

Chapter 2 Commands Example 2 When you re satisfied with all print options and report specifications, click [OK] to display the Print dialog box where you can choose the pages to print, recheck your print options, and click [Print] to print the report. 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. 2-160 REPORT

Commands Chapter 2 For more information: Please see Constructing Multiline Views on page 5-17 in the ACL for Windows User Guide for details. REPORT 2-161

Chapter 2 Commands ; SAMPLE Note: Click or select Sampling from the menu bar and choose Sample. Use the Sample command to create record or monetary unit samples (also known as MUS) from a population within an input file. The Sample command supports a wide range of sampling activities. You can create MUS and record samples in combination with a number of sampling parameters and useful options to suit your specific needs. 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. ACL Sampling Methods Sample offers the following sampling types and their related parameters: MUS and Record Sampling: random sampling interval sampling fixed interval selection after random start cell sampling (random selection within each interval) Additional Options: conditional sampling with If, While, Next, First clauses no repeats top stratum cutoff automatic or manual seed (for repeatability) MUS only: subsampling 2-162 SAMPLE

Commands Chapter 2 Choosing a Sampling Approach 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 how sampling bias and selection method impact the results of each ACL sampling option. 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 MUS 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 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. An MUS 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. SAMPLE 2-163

Chapter 2 Commands Cutoff There is a third category of bias where you include or exclude entire classes of transactions (or records) on some basis. This is done using the Cutoff option or by specifying a condition. You can use Cutoff to specifically include all transactions over a certain dollar amount. You can also specify a condition for a wide range of tests; for example, excluding items in product class 05 or including only amounts over $10,000 for the month of April. Selection Method When you select a sample type, you are determining the specific method to be used to draw the sample. The Sample command supports three basic methods. You can use any number of other methods via programmed logic in a command group. For more information: See Command Groups on page 8-29 in the ACL for Windows User Guide for details on programming ACL by using groups. Fixed Interval Sampling Cell Sampling Note: 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 611 th item and every 900 th item thereafter. Because an item is usually either a record or a dollar, the 611 th item could be record 611 or the 611 th dollar in the population. 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, any of which might be selected. A million dollar item contains 1,000,000 individual dollars, any of which might be selected, and the corresponding record drawn. 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. In a cell sample (also referred to as a random interval 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. 2-164 SAMPLE

Commands Chapter 2 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. Note: When you apply interval sampling (fixed or cell) to monetary unit sampling, ACL samples on the absolute value of the amount field, as credits and negative items may be included in the population being sampled. Monetary unit sampling is typically used for substantive overstatement tests. A firm may choose to ignore negative items, because they cannot result in an overstatement. If you do not want to examine negative items, you can include a field-name>0 condition as part of the Sample command. 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 checkbox, 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. 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, select the Record radiobutton. In the Sample Parameters area, select the Random radiobutton and enter the (oversample) Size, Seed, and Population. In the To text box, enter the output file name. Click the [More] tab. SAMPLE 2-165

Chapter 2 Commands In the Output area, select the Fields radiobutton and select the fields you want in your output file. The Report Selection Order checkbox is only available if your output choice is Fields. To get the selection order number of the sampled items, check the Report Selection Order checkbox. Click [OK]. 2-166 SAMPLE The view of your output file contains an ORDER field as the last column on the right. This column contains the order number 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.

Commands Chapter 2 In the above example, record 4 is the first item selected and record 1 is the second item selected, and so on. Note: It is important that any samples produced may be reproduced if required. For this reason, both cell and random sampling will 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) will 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: On how sampling works in ACL, see Sampling in ACL on page 8-1. SAMPLE 2-167

Chapter 2 Commands Prerequisites [Sample On] Required Specifies the field or expression for monetary unit sampling (MUS). Select the field from the dropdown, or click [Sample On] to display the Selected Fields dialog box. For more information: On the Selected Fields dialog box, see Choosing Fields from a Selected Fields Dialog Box on page 1-12 and Selection/Edit Dialog Boxes on page 2-15 in the ACL for Windows User Guide. See Expression Builder on page 6-1 in the ACL for Windows User Guide. MUS Record Fixed Interval Cell Random Selects monetary unit sampling as the sample type. Selects Record sampling as the sample type. Selects Fixed Interval as the sampling method. For details, see the above discussion. Selects Cell as the sampling method. For details, see the above discussion. Selects Random as the sampling method. For details, see the above discussion. 2-168 SAMPLE

Commands Chapter 2 ACL offers different sampling parameters depending on whether you choose Fixed Interval, Cell, or Random sampling. Interval Required for Interval Sampling Start Required for Fixed Interval Sampling Cutoff Seed Required for Cell and Random Sampling Size Required for Random Sampling Population Required for Random Sampling Specifies the interval value for Fixed Interval and Cell sampling. For details, see the above discussion. Specifies the first record or monetary unit chosen in a Fixed Interval sample. For details, see the above discussion. Specifies an amount for Fixed Interval and Cell sampling above which an item is considered top stratum, and is automatically displayed and included in the sample. For details, see the above discussion. Default: Interval size. For Cell and Random samples, specifies the seed value for the random number generator. For details, see the above discussion. For Random sampling, specifies the number of items to be selected. For details, see the above discussion. 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 window that the supplied population total differs from the actual total. SAMPLE 2-169

Chapter 2 Commands Default for MUS sampling: The absolute value of the field if the Profile command has been previously issued. Otherwise, there is no default. Default for Record sampling: Record count for the file. [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. For more information: See SIZE on page 2-187 for details on using the Size command. [More] See also Common Parameters on page 1-11 and the More options specific to Sampling described below. 2-170 SAMPLE

Commands Chapter 2 Fields [Extract Fields] Required if Fields is selected Allows you to select specific fields to be included in the output file by activating the Extract Fields list box. 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 radiobutton, then select the fields from the list box or click [Extract Fields] to display the Selected Fields dialog box. For more information: See Choosing Fields from a Selected Fields Dialog Box on page 1-12 and Selection/Edit Dialog Boxes on page 2-15 in the ACL for Windows User Guide. See also Expression Builder on page 6-1 in the ACL for Windows User Guide. Record Subsample No Repeats Instructs ACL to include the entire record in the sampled output file. 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 where subsampling is required (for example, where 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 auditing procedures on this population. This is only available if you choose to output fields. Default: No subsample. 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. Default: Repeats. SAMPLE 2-171

Chapter 2 Commands Report Selection Order Append To Existing File Causes the selection order to be output as a field. See the section on Random Sampling above. Bypasses the dialog box that asks if you want to overwrite or append to an existing output file. Be sure the two file structures are identical before using this option. ACL appends your output to the existing file regardless of the file structure of the two files. : 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 formats, as appropriate: INTERVAL = interval-value FIXED = startvalue INTERVAL = interval-value RANDOM = randomseed RANDOM = random-seed POPULATION = population-size {NUMBER SIZE} = samplesize {<FIELDS> extract-fields RECORD} <ORDER> <IF test> <WHILE test> <FIRST NEXT range> <TO create-file-name PRINT> <HEADER heading> <FOOTER footer> For more information: For a description of parameters specific to issuing this command in command mode, see Common Parameters on page 1-11. 2-172 SAMPLE

Commands Chapter 2 Example 1 In this example, you create a Fixed Interval Monetary Unit Sample (MUS). Much of an auditor s work is performed on samples from a larger population. Use the Sample command to derive an MUS sample from an inventory value field where: 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 INVMUS You can test the sampled records for inventory obsolescence, proper recording of cost vs. market value, accuracy of extensions, or any other test relevant to an inventory account. SAMPLE 2-173

Chapter 2 Commands The INVMUS 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 window shows summary information on the sampling results. The sample size is 24, with zero 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 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. 2-174 SAMPLE

Commands Chapter 2 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, ARSAMP. The file ARSAMP appears as follows: Use the scroll bar to view the entire file. The Command Log window shows summary information on the sampling results. SAMPLE 2-175

Chapter 2 Commands 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. 2-176 SAMPLE

Commands Chapter 2 : SAVE This command can only be issued in Command mode. For more information: See Command Mode on page 8-38 in the ACL for Windows User Guide. Use the Save command to store field definitions from the current input file in a workspace file. 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 document, ACL asks you if you want to replace it. : For more information: 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 8-92 in the ACL for Windows User Guide. Command Mode Syntax SAVE WORKSPACE workspace-name workspace-fields WORKSPACE Indicates that you want to save a workspace file. Example To save computed fields GRMargin and PercMarg in a workspace named INVMARG that calculates the unit margin and percent unit margin for inventory items, use Save as described below. SAVE 2-177

Chapter 2 Commands You could 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 identically named in all files to which the workspace is applied. Type the following into the Command Log text box: The workspace is now ready to be activated by issuing the Activate command. For more information: See ACTIVATE on page 2-5 for details. 2-178 SAVE

Commands Chapter 2 ; SEARCH Note: Click or select Analyze from the menu bar and choose 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, where that value is a character string the first record in an indexed file that either meets or exceeds a specified key value where that value is a character-type expression which may include references 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. 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. For more information: See INDEX on page 2-91 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. SEARCH 2-179

Chapter 2 Commands 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 type it directly into the text box, or click [Expr] to display the expression builder to help you build an expression. For more information: See Expression Builder on page 6-1 in the ACL for Windows User Guide for details. Find Literal 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 will also be sorted in descending quantity order. 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. 2-180 SEARCH

Commands Chapter 2 To specify a character string to be found, type the string in the text box. The character string cannot contain leading blanks and must not be surrounded by quotes. It can be 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. Seek Expression Prerequisite: See the Find Literal prerequisite above. 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 type 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. [Expr] Required Allows you to enter a record number or expression. To enter an expression, either type it directly into the text box, or select [Expr] to display the expression builder to help you build an expression. For more information: See Expression Builder on page 6-1 in the ACL for Windows User Guide for details. : Command Mode Syntax for Locate Record and Locate If, see LOCATE on page 2-111 for Find Literal, see FIND on page 2-71 for Seek Expression, see SEEK on page 2-170 SEARCH 2-181

Chapter 2 Commands Example 1 To find record number 478 in an accounts receivable file use Search with the Locate Record option. The Command Log window 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. 2-182 SEARCH

Commands Chapter 2 Example 2 To scan a customer master file for a record where the customer s name is Syscom Gas, use the Search command s Locate If option. When there is more than one occurrence of Syscom Gas in the file, ACL positions the file at the first occurrence. The Command Log window indicates that the condition has been met by record 47, and ACL positions the file at that record in the view. SEARCH 2-183

Chapter 2 Commands 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 residency. 2-184 SEARCH 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 type NY in the text box select Locate If in the Search dialog box, and type STATE= NY in the text box

Commands Chapter 2 : SEEK This command can only be issued in Command mode. For more information: See Command Mode on page 8-38 in the ACL for Windows User Guide. Use the Seek command to move directly to the first record in an indexed file containing a specified character search key. 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 2-164. Prerequisites The input file must be indexed on a character field in ascending order. SEEK 2-185

Chapter 2 Commands : Command Mode Syntax SEEK character-expression characterexpression 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. 2-186 SEEK

Commands Chapter 2 ; SEQUENCE Note: Click or select Analyze from the menu bar and choose 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 checkboxes 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. The Sequence command, as mentioned, always tests for data sorting errors. 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. For more information: This command can be Autoexecuted. For more information on the Autoexecute Commands preference, see Command Options on page 7-9 in the ACL for Windows User Guide. Prerequisites If you want to do gaps or duplicates testing, the file should be sorted first. To do this you can either check the Presort checkbox or use the Sort or Index command. SEQUENCE 2-187

Chapter 2 Commands [Sequence On] Required [List Fields] 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. 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 box, 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. 2-188 SEQUENCE

Commands Chapter 2 For more information: See Choosing Fields from a Selected Fields Dialog Box on page 1-12 and Selection/Edit Dialog Boxes on page 2-15 in the ACL for Windows User Guide. For more information on building expressions, see Expression Builder on page 6-1 in the ACL for Windows User Guide. Duplicates Indicates that you want to test for duplicates (or triplicates, and so on) in the key field records. For more information: Also see ACTIVATE on page 2-5. 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. For more information: Also see GAPS on page 2-73. List Gap Ranges List Missing Items 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. 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. SEQUENCE 2-189

Chapter 2 Commands 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 will almost always be reported. 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. More Options Parameters and other options for this command are available through the [More] tab: 2-190 SEQUENCE

Commands Chapter 2 All, First, Next, [While] Error Limit Allows you to add parameters to this command. See Common Parameters on page 1-11 for details. 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. For more information: See Command Options on page 7-9 in the ACL for Windows User Guide for details. : 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> SEQUENCE 2-191

Chapter 2 Commands Note: You cannot use the presort keyword in a command group running in batch mode. For more information: For a description of parameters specific to issuing this command in command mode, see Common Parameters on page 1-11. Example 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. ACL displays the result in the Command Log window. 2-192 SEQUENCE 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 17. If the same example is performed using the List Missing Items option, and an Items Limit of 6, the Sequence dialog box appears as follows:

Commands Chapter 2 ACL displays the result in the Command Log window. 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. SEQUENCE 2-193

Chapter 2 Commands Notice also that the first example reported 17 errors while the second reported 18. The reason for this is that invoices 13030 and 13031 are both missing. This counted as one range in the first example, but two items in the second. For more information: See DUPLICATES on page 2-53 and GAPS on page 2-73 for further examples. 2-194 SEQUENCE

Commands Chapter 2 SET Note: Most variations on the Set command are accessible by selecting Edit from the menu bar, choosing Preferences, then clicking the appropriate tab in the Preferences dialog box. The following Set options are only available in command mode. They are described separately in this section. Echo Filter History Index Learn Loop Log Password Set ACL Preferences For more information: The following Set commands are more fully discussed in Setting Preferences on page 7-1 in the ACL for Windows User Guide. Use Set to change the status of system conditions which determine how ACL operates. The wide range of Set options allows you to customize ACL to your needs and environment. Many of the options are available by selecting Edit from the menu bar, then choosing Preferences and clicking the appropriate tab to set your own default preferences. SET 2-195

Chapter 2 Commands Set Option in Command Mode SET BEEP 0-255 SET CENTURY 0-99 SET CLEAN ON OFF SET DATE 1 2 string SET DESIGNATION SET EXACT ON OFF SET FORMAT ON OFF SET MARGIN {LEFT RIGHT TOP BOTTOM} <TO> n Equivalent Preference Interface Options See Beep(s) Upon Task Completion on page 7-4 in the ACL for Windows User Guide Date Options See Start of Century on page 7-13 in the ACL for Windows User Guide View Options See Display Invalid Data as Blanks on page 7-8 in the ACL for Windows User Guide Date Options See Default Date Format on page 7-11 in the ACL for Windows User Guide View Options See Global Page Title on page 7-9 in the ACL for Windows User Guide Input File Options See Exact Character Comparisons on page 7-5 in the ACL for Windows User Guide Input File Options See Display Format on Open on page 7-6 in the ACL for Windows User Guide Print Options See Margins on page 7-18 in the ACL for Windows User Guide 2-196 SET

Commands Chapter 2 Set Option in Command Mode SET MONTHS <TO> Jan,Feb,Mar,Apr,May,Jun, Jul,Aug,Sep,Oct,Nov,Dec SET ORDER <TO> string SET OVERFLOW ON OFF SET PERIODS <TO> period1,period2... SET READAHEAD <TO> buffer-size SET SAFETY ON OFF SET TEST ON OFF SET VERIFY ON OFF BLANK SET WIDTH <TO> n Equivalent Preference Date Options See Abbreviations for Month Names on page 7-14 in the ACL for Windows User Guide Input File Options See Sort Order on page 7-6 in the ACL for Windows User Guide Numeric Options See Stop on Numeric Overflow on page 7-15 in the ACL for Windows User Guide Date Options See Periods on page 7-13 in the ACL for Windows User Guide Input File Options See Buffer Size (k) on page 7-6 in the ACL for Windows User Guide Interface Options See Set Safety On on page 7-4 in the ACL for Windows User Guide Command Options See Show Group Tests in Log on page 7-10 in the ACL for Windows User Guide Numeric Options See Verify Data on page 7-15 in the ACL for Windows User Guide Numeric Options See Expression Field Width on page 7-16 in the ACL for Windows User Guide SET 2-197

Chapter 2 Commands The following Set options are only available in command mode. They are usually used in batches to determine how ACL operates. 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. 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 wish 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. : Default: On Command Mode Syntax SET ECHO {ON NONE} 2-198 SET

Commands Chapter 2 Example To turn off command logging while you repeat a series of commands for 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 2-199

Chapter 2 Commands 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. For more information: See FILE HISTORY on page 2-69 for details. : Default: 20 Command Mode Syntax SET INDEX SET HISTORY <TO> 0-100 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 Index on page 8-67 in 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. For more information: See Creating a Batch on page 8-2 in the ACL for Windows User Guide for details. 2-200 SET Default: Off.

Commands Chapter 2 Example To turn on the batch recorder and save the commands in file ARTEST: SET LEARN TO ARTEST 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 document to another log file. The default log has the same name as your document name with a.log extension. You can specify a different log file and 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 SET 2-201

Chapter 2 Commands Example 2 To switch back to using the original command log file: SET LOG TO NONE SET PASSWORD Sets the password to access files that are protected by passwords. Note: Caution: Before using this command, please see PASSWORD on page 2-124 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 2-202 SET

Commands Chapter 2 ; SIZE Note: Click or select Sampling from the menu bar and choose Size. Use Size to determine the appropriate sample sizes for record and monetary unit samples (MUS). 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 which contain the reported sample size and interval, respectively. Use these variables to create batches that automatically supply parameters to a subsequent Sample command. Where errors and taintings are found, use the Evaluate command to determine their impact. SIZE 2-203

Chapter 2 Commands Sample Sizes For very small populations the SIZE command may return a sample size greater than the population. This relates to the fact that we use the Poisson distribution for calculating the sample size, rather than the more correct Binomial distribution. There are two main problems with using the Binomial distribution. The first is that it requires you know the population before you can generate a sample size, and the second is that the calculations involved and the evaluation of sample errors detected is much more complex. For these reasons, together with the fact that such very small populations are fairly uncommon, the Poisson distribution is more widely used for calculating required sample sizes. The Poisson distribution always generates a conservative sample size, and is much easier to work with (you can even look up values in published tables to check the calculations). When very small populations are encountered, the big firms typically over-test on a manual basis. For typical population size (say 1,000 or more) the two distributions will generate exactly the same sample size, but as the population gets smaller, the difference between the two increases. This is due to the fact the Poisson is population independent (it will generate the same sample size, regardless of the population). So, obviously, as the population gets very small the fixed sample size might actually exceed the population. The Binomial flattens out to the same value as the population size increases, but for very small populations will adjust the size downwards. An example of a fixed sample size is a blood sugar test. It only takes one drop of blood, whether you weigh 100 or 1,000 pounds (that is, regardless of the amount of blood you have). This is a familiar example of why sample sizes do not need to increase with population. We don t arbitrarily limit the sample size to the population because even when it is not greater, for very small populations we always sample too much (given a sample size is 60, if the population is 50, there is obviously a problem, but if the population is 61 we are still looking at too may items). 2-204 SIZE

Commands Chapter 2 Determining Monetary Unit Sample (MUS) Size Monetary Confidence Population Materiality Expected Total Errors 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. Specify the reliability you d 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. Specify the absolute value of the field being sampled. Specify the amount of money considered significant. This is the maximum amount of error you re willing to accept in the population without detection. Specify the total dollar amount of errors expected in the population. This increases the sample size to allow for the expected errors. SIZE 2-205

Chapter 2 Commands [Calculate] Output Allows you 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. Allows you to send output to the screen or to a text file. Determining Record Sample Size Record Confidence Population Upper Error Limit 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. Specify the reliability you d 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. Specify the record count. Specify the error rate you want to prove is not exceeded in the population. 2-206 SIZE

Commands Chapter 2 Expected Error Rate [Calculate] [Output] Specify the percentage error rate expected in the population. This is the maximum amount of error you re willing to accept in the population without detection. Allows you to display the calculated results after entering the Size parameter values. Sample size, interval, and number of tolerable errors are displayed in the Results area of the dialog box. Allows you to send output to the screen or to a text file. : 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> SIZE 2-207

Chapter 2 Commands 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. 2-208 SIZE

Commands Chapter 2 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): 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. SIZE 2-209

Chapter 2 Commands 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. 2-210 SIZE

Commands Chapter 2 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 where 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 where 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. SIZE 2-211

Chapter 2 Commands Note: Given a single error in the population where a $100 item was recorded at $80 (20% tainting), the sample is probably insufficient to prove your hypothesis. Because the error was found in one item, you can assume with certainty that the sample is insufficient. 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. 2-212 SIZE

Commands Chapter 2 ; Sorting versus Indexing SORT Click or select Data from the menu bar and choose 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. 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 Entire File much faster much slower Subsequent Processing Searching for a Few Records much slower much faster To use the Find Literal, Data Relations, 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 to a maximum key length of 255. 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. SORT 2-213

Chapter 2 Commands Logical fields are sorted on 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 unpredictable results. Including the optional If, While, First, and Next parameters causes a subset of the current input file to be sorted into the output file. The Sort command is a stable sort ; records with the same key value retain the same relative position in the output file. 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. Prerequisites As a general rule, free disk space at least 2.5 times the size of the file to be sorted should be available. 2-214 SORT

Commands Chapter 2 [Sort On] Required Specifies the input file key fields or expressions to be used for sorting. Select the fields from the list box, or click [Sort On] to display the Selected Fields dialog box where you can also choose to sort in ascending or descending order. For more information: On the Selected Fields dialog box, see Choosing Fields from a Selected Fields Dialog Box on page 1-12 and Selection/Edit Dialog Boxes on page 2-15 in the ACL for Windows User Guide. For more information on building expressions, see Expression Builder on page 6-1 in the ACL for Windows User Guide. [If], [To] [More] See Common Parameters on page 1-11 for details. See Choosing Parameters from a Dialog Box on page 1-13. : Command Mode Syntax SORT ON key-field <D>... TO create-file-name <IF test> <WHILE test> <FIRST NEXT range> <APPEND> <OPEN> For more information: For a description of parameters specific to issuing this command in command mode, see Common Parameters on page 1-11. SORT 2-215

Chapter 2 Commands Example In this example, you Sort an inventory file on a key field. Before sorting, an inventory file appears as follows: To create an inventory file named SORTPRODCLS sorted in ascending order (the default sort order) by product class (the second column in the view): 2-216 SORT

Commands Chapter 2 The sorted inventory file appears as follows: SORT 2-217

Chapter 2 Commands STATISTICS ; Use the Statistics command to calculate descriptive statistics on numeric fields in the current input file. Click or select Analyze from the menu bar and choose Statistics. 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 the range (the difference between the minimum and maximum values) the standard deviation of the fields the highest field values the lowest field values As well as displaying the statistical information above, ACL stores a number of values in special variables. For more information: See Variables Created by ACL Commands on page 8-88 in 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 7-9 in the ACL for Windows User Guide. 2-218 STATISTICS

Commands Chapter 2 [Statistics On] Required Specifies the 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: On the Selected Fields dialog box, see Choosing Fields from a Selected Fields Dialog Box on page 1-12 of this manual and Selection/Edit Dialog Boxes on page 2-15 in the ACL for Windows User Guide. Std. Deviation Turn this option on to calculate the standard deviation of the fields specified, in addition to the other statistics. STATISTICS 2-219

Chapter 2 Commands [If] Defines a test that filters out all records that do not meet the test. For more information: See Common Parameters on page 1-11 and IF on page 1-20. For information on building expressions, see Expression Builder on page 6-1 in the ACL for Windows User Guide. [More] For more information on [More] see Choosing Parameters from a Dialog Box on page 1-13. [Output] For more information see [Output] on page 1-16. # of High/Low Specifies the number of high and low values to retain during processing. Default: 5 [While] For more information see Common Parameters on page 1-11. 2-220 STATISTICS

Commands Chapter 2 : Command Mode Syntax STATISTICS <numeric-field-list ALL> <STD> <NUMBER n> <TO file-name PRINT> <IF test> <WHILE test><first NEXT range> <APPEND> 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. Auditors 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. STATISTICS 2-221

Chapter 2 Commands ACL displays the result in the Command Log window. 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. 2-222 STATISTICS

Commands Chapter 2. Double click a variable to display its value in the expression builder. You can also use the Display command in command mode to display the variables created by this command. To do this, type the following into the Command Log text box: ACL displays the result in the Command Log window. For more information: For details, see Working with Functions on page 6-28 in the ACL for Windows User Guide. STATISTICS 2-223

Chapter 2 Commands 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. Click or select Analyze from the menu bar and choose Stratify. 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. Alternatively, you can specify the start points for the intervals freely, allowing for unevenly sized intervals. The results of this command can be sent to a graph. Click the [Output] tab and select the Graph radiobutton to create a graph of your results. For more information: See HISTOGRAM on page 2-81 for details. This command can be Autoexecuted. For more information on the Autoexecute Commands preference, see Command Options on page 7-9 in the ACL for Windows User Guide. 2-224 STRATIFY

Commands Chapter 2 [Stratify On] Required [Accumulate Fields] Specifies the numeric field or expression to be stratified. Select the field from the list box or click [Stratify On] to display the Selected Fields dialog box. Specifies the numeric fields or expressions for which ACL supplies totals by stratum. Select the fields from the list box or click [Accumulate Fields] to display the Selected Fields dialog box. Percentages of the total are displayed for only the first field you select. For more information: On the Selected Fields dialog box, see Choosing Fields from a Selected Fields Dialog Box on page 1-12 and Selection/Edit Dialog Boxes on page 2-15 in the ACL for Windows User Guide. Minimum Required (see Default) Maximum Required (see Default) Specifies the minimum value in the first interval of the stratification. Any values which are less than this value are excluded or, if Suppress Others in the [More] tab is not checked, are included under the heading: < (Minimum value). Default: Minimum value in the stratified field if ACL knows the minimum value from a previously issued Profile or Statistics command. Otherwise, no default. Specifies the maximum value in the last interval of the stratification. Any values which are greater than this value are excluded or, if Suppress Others in the [More] tab is not checked, are included under the heading: > (Maximum value). Default: The maximum value in the stratified field if ACL knows the maximum value from a previous Profile or Statistics command; or the highest value specified as a free interval if Free Intervals is chosen. Otherwise, no default. STRATIFY 2-225

Chapter 2 Commands Intervals Specifies the number of even intervals ACL produces over the range (Minimum to Maximum). Default: 10. The default may be changed through the Command Options preference. For more information: See Command Options on page 7-9 in the ACL for Windows User Guide for details. Free Allows you to specify the start point of each interval and the end point of the last range. Enter the start point of each range in the text box, one per line. [If] Defines a test that filters out all records that do not meet the test. See Common Parameters on page 1-11 and IF on page 1-20. 2-226 STRATIFY

Commands Chapter 2 For more information: For information on building expressions, see Expression Builder on page 6-1 in the ACL for Windows User Guide. [More] See Choosing Parameters from a Dialog Box on page 1-13. [Output] See [Output] on page 1-16. [Break] Allows you to produce a new stratification each time a change in the specified break fields occur. You must specify a character field. The file should be sorted on this field. If you want to break on more than one field, separate the fields with a + sign. To select the fields, either type them directly into the text box or click [Break] to use the Selected Fields dialog box. For more information: Please see STRING( ) on page 4-73 for details on converting a numeric field to character format. : 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> STRATIFY 2-227

Chapter 2 Commands You can add the following options to each syntax format: <TO create-file-name PRINT> <IF test> <WHILE test> <FIRST NEXT range> <ACCUMULATE numeric-field-list> <SUPPRESS> <HEADER heading> <FOOTER footer> <KEY break-field <+...>> <APPEND> <OPEN> For a description of parameters specific to issuing this command in command mode, see Common Parameters on page 1-11. Example 1 In this example, you produce even interval stratifications. To determine the distribution of balances across an accounts receivable file, use Stratify. The result reveals whether accounts receivable are comprised of a few large or several smaller value items. Auditors can tailor their audit approach accordingly and management can respond with appropriate collection procedures. From an accounts receivable file summarized on customer number, stratify based on the transaction amount field. Accumulate this field as well. Accept the defaults for the Minimum and Maximum range values (assuming you have previously issued a Profile or Statistics command). Accept 10 as the number of intervals. 2-228 STRATIFY

Commands Chapter 2 Notice that a COUNT field appears in the Accumulate Fields list box. ACL automatically generates this field when the Summarize command is issued. ACL displays the result in the Command Log window. The results indicate that 54.20% of customers, comprising 16.73% of the total balance of accounts receivable, owe less than $881.34 each. Although these balances are significant, from the management s and auditor s STRATIFY 2-229

Chapter 2 Commands perspective, it may be more important to verify whether the balances in the last three strata are collectible. There are only a few customers included in these strata, so verification should be relatively simple. Example 2 Do this example to produce free interval stratifications. Based on the results in Example 1, you may want to produce a free interval stratification with more detail on the values falling into the first stratum. Specify 0, 500, 1000, 3000, 5000, and 7500 as your interval start points, and 10,000 as the final end point. 2-230 STRATIFY

Commands Chapter 2 The results appear in the Command Log window. The results indicate that most of the balances from the first stratum in Example 1 fall into the $0 to $3,000 range. STRATIFY 2-231

Chapter 2 Commands 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. Click or select Data from the menu bar and choose Summarize. 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 checkbox. For small or medium-sized unsorted files, Classify is an effective command for summarizing data. For more information: See CLASSIFY on page 2-17. 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 summarized 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. 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 checkbox. 2-232 SUMMARIZE

Commands Chapter 2 [Summarize On] Required [Accumulate Fields] Required [Other Fields] 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. 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. 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. SUMMARIZE 2-233

Chapter 2 Commands For more information: For more information on the Selected Fields dialog box, see Choosing Fields from a Selected Fields Dialog Box on page 1-12 and Selection/Edit Dialog Boxes on page 2-15 in the ACL for Windows User Guide. Fields already selected from the Summarize On and Accumulate Fields list boxes need not be selected here again. [If] Defines a test that filters out all records that do not meet the test. For more information: See Common Parameters on page 1-11 and IF on page 1-20. For information on building expressions, see Expression Builder on page 6-1 in the ACL for Windows User Guide. [More] See Choosing Parameters from a Dialog Box on page 1-13. : [Output] See [Output] on page 1-16. Command Mode Syntax SUMMARIZE ON key-fields ACCUMULATE summarizefields <OTHER> other-fields <TO create-file-name> <IF test> <WHILE test> <FIRST NEXT range> <PRESORT> <APPEND> <OPEN> 2-234 SUMMARIZE

Commands Chapter 2 Note: You cannot use the presort keyword in a command group running in batch mode. Example You summarize on two fields in this example. To summarize inventory by location, and within each location by product class, use Summarize. Auditors 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 checkbox. Click the [Output] tab and send the output to a file named SUMM SORT LOC. SUMMARIZE 2-235

Chapter 2 Commands The Default View for SUMM SORT LOC appears as follows: 2-236 SUMMARIZE

Commands Chapter 2 TOP : Use the Top command to move to the first record in the current input file. This command can only be issued in Command mode. For more information: See Command Mode on page 8-38 in 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 TOP 2-237

Chapter 2 Commands TOTAL ; Use the Total command to total numeric fields or expressions in the current input file. Click or select Analyze from the menu bar and choose Total. 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. For more information: See Variables Created by ACL Commands on page 8-88 in 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 7-9 in the ACL for Windows User Guide for details. 2-238 TOTAL

Commands Chapter 2 [Total Fields] Required 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 Choosing Fields from a Selected Fields Dialog Box on page 1-12 and Selection/Edit Dialog Boxes on page 2-15 in the ACL for Windows User Guide. [If] [More] Defines a test that filters out all records that do not meet the test. See Common Parameters on page 1-11 and IF on page 1-20. For information on building expressions, see Expression Builder on page 6-1 in the ACL for Windows User Guide. See Choosing Parameters from a Dialog Box on page 1-13. : Command Mode Syntax TOTAL numeric-field-list <IF test> <WHILE test> <FIRST NEXT range> TOTAL 2-239

Chapter 2 Commands 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 window. Example 2 This example totals records that meet a specified condition. To total a market value field and a recorded value field for a given product class, use Total. Often a class of products declines in market value due to economic or technological 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. 2-240 TOTAL

Commands Chapter 2 Select the market value and recorded 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 window. The market value (MKTVAL) is greater than the recorded 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. TOTAL 2-241

Chapter 2 Commands VERIFY ; Use the Verify command to check for data validity errors in the current input file. Click or select Analyze from the menu bar and choose Verify. 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 7-7 in 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. For more information: See VERIFY( ) on page 4-81 for details. 2-242 VERIFY

Commands Chapter 2 This command can be Autoexecuted. For more information: On the Autoexecute Commands preference, see Command Options on page 7-9 in the ACL for Windows User Guide. [Verify Fields] Required 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 expressions and binary fields, are by definition always valid. For more information: On the Selected Fields dialog box, see Choosing Fields from a Selected Fields Dialog Box on page 1-12 and Selection/ Edit Dialog Boxes on page 2-15 in the ACL for Windows User Guide. VERIFY 2-243

Chapter 2 Commands [If] Defines a test that filters out all records that do not meet the test. See Common Parameters on page 1-11 and IF on page 1-20. For information on building expressions, see Expression Builder on page 6-1 in the ACL for Windows User Guide. [More] See Choosing Parameters from a Dialog Box on page 1-13. [Output] See [Output] on page 1-16. 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. 2-244 VERIFY

Commands Chapter 2 : Command Mode Syntax VERIFY field-list <IF test> <WHILE test> <FIRST NEXT range> <ERRORLIMIT n> <TO create-file-name PRINT> Example This example verifies all fields in the file. 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. VERIFY 2-245

Chapter 2 Commands ACL displays the result in the Command Log window. 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. For more information: See DUMP on page 2-52 for details. 2-246 VERIFY

Field Types Chapter 3 ACL can read almost all data files without converting or reformatting the data. Because ACL contains a description of most data types (called field types in ACL), you can accurately define any data file. If the explicitly defined field types do not represent the data encountered, you can use computed fields and functions to access special data structures. Field type names vary with the programming languages and conventions used by hardware manufacturers. The following table of common synonyms identifies field types in different contexts: External 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 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) 3-1

Chapter 3 Field Types In addition to the external data types listed in the above table, ACL supports special field types found in specific applications. For example, Vaxfloat and Unisys packed fields, as well as numeric field types found only in the ACCPAC accounting system. ACL also has its own field type for storing the results of computed fields and the values of variables in output data files. 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 Interchange (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 more information: For a description of the other major form of character data, see EBCDIC on page 3-6. 3-2 ACCPAC

Field Types Chapter 3 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. For more information: See FLOAT on page 3-6 for a description of the 8087 Institute of Electrical and Electronic Engineers (IEEE) format. 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 (leftmost) and the least significant byte last, as is the norm for mainframe data. This field type is not appropriate 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. CUSTOM 3-3

Chapter 3 Field Types 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 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: XA4 C$ XA5 C, 5 C. 3-4 CUSTOM

Field Types Chapter 3 DATE Reads date information stored as characters. ACL correctly interprets date information stored in almost any format through the use of a Date format, which can contain any of the following: DD for a day (1-31) DDD for a Julian day (1-366) MM for a month (1-12) MMM for a month name (Jan-Dec) YY for a short year format (96) YYYY for a long year format (1996) ACL assumes that any other characters are punctuation characters that must exist in the date file in the same relative field position. For more information: On date format, see Formatting Data Fields on page 4-23 in the ACL for Windows User Guide. If you use only two digits to specify a year, the DATE default assumes the year falls between 1900 and 1999. However, you can change the default in your Preferences so that DATE reads the digits differently. For more information: For details on changing your Date Options see Date Options on page 7-11 in the ACL for Windows User Guide. Depending on how the date January 17, 1996 (for example) is stored in your data file, you should use the following format: Stored Date Format You Should Use 960117 YYMMDD 01171996 MMDDYYYY 17JAN1996 DDMMMYYYY 01/17/96 MM/DD/YY DATE 3-5

Chapter 3 Field Types Stored Date Format You Should Use 96017 YYDDD January 17, 1996 MMM DD, YYYY Note: For dates stored in numeric format (for example, 011293 or 3651994), define the field using the appropriate numeric type and check the Date checkbox in the Input File Definition window. EBCDIC Reads data encoded according to the Extended Binary Coded Decimal Interchange Code (EBCDIC). Note: 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 3-2 for a description of the other major form of character data. FLOAT Reads data encoded according to the IEEE standard for double precision floating point numbers, such as data produced with the 8087 coprocessor 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 (leftmost) and the most significant byte rightmost. The length of the field type is 4 or 8 bytes. HALFBYTE Reads halfbyte aligned PACKED data, which is often found in Unisys/ Burroughs environments. Signed numbers must follow the Unisys/ Burroughs convention. 3-6 EBCDIC

Field Types Chapter 3 IBMFLOAT 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 type 5 in the Start text box and select HALFBYTE from the Field Type dropdown 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. Reads IBM floating point data. The IBMFLOAT field type is uncommon, found mainly in mainframe scientific applications. IBMFLOAT fields can be either 4 or 8 bytes long. 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 nonzero (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. LOGICAL 3-7

Chapter 3 Field Types 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 3-3. 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 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. 3-8 MICRO If the specified decimal places differs 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.

Field Types Chapter 3 PACKED Reads the PACKED DECIMAL field type generated by mainframes. PACKED refers to the mainframe PACKED DECIMAL field type that has two decimal 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 HEX digit representing the decimal 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. The number of decimal places is the specified number and cannot exceed the number of digits implied by the length. The PACKED 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, ACL can supply a version that strictly follows the IBM specification. For more information: For Unisys PACKED data, see UNISYS on page 3-10. PCASCII Reads data encoded according to the American Standard Code for Information Interchange. 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 in a DOS application, and 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. PCASCII 3-9

Chapter 3 Field Types 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. 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 parentheses 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 leftmost 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. 3-10 PRINT

Field Types Chapter 3 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 3-6. UNSIGNED VAXFLOAT ZONED Reads unsigned PACKED mainframe data. UNSIGNED refers to an unsigned PACKED field type for mainframe data, storing two decimal digits per byte. 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 HEX digit representing the decimal digit of that position in the number. The length of this field type is a maximum of 11 bytes (in other words, 22 decimal digits). The number of decimal places is the specified number and cannot exceed the maximum number of digits possible in the field. 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. 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. ZONED 3-11

Working with Functions Chapter 4 Functions are a convenient way to perform standard computational tasks. 1. For example, You may have a customer name field that was stored in all upper case, you might want to reformat it into proper case for inclusion in a confirmation letter. To do this, you could create a computed field whose value was: PROPER(NAME). This would turn JOHN SMITH into John Smith. You could then export this new field instead of the original field. You may need to know the age of each transaction for the calculation of daily interest. You could include AGE(INV_DATE) in your calculation. This would return how old each transaction is in days, correctly accounting for month and year ends, as well as leap years. To count all the records that have New York anywhere in the record, you can build a filter test FIND( New York ), and use it with the Count command. 2. The most common uses for functions are to perform an operation to create a new computed field, and to create a test for filtering records. 3. Since each function returns a result, you can combine functions. For example, the ROOT() function returns the square root of a number, but this is undefined for negative numbers which is the usual representation of accounting credits. The ABS() function will give you the absolute value of a number, which is always positive. You can therefore combine these two functions to get an appropriate square root as follows: ROOT(ABS(AMOUNT),2) If you have an address field that is 20 bytes long with the entry: 123 Somewhere Street, you can use the Include function to create a field with only the number: INCLUDE( Address, 0123456789 ) 4-1

Chapter 4 Working with Functions The result would be 123. If you use this expression as a field, the new field is still 20 characters long. If you want to create a smaller field of, for example, five bytes, you need to use the Substring function: SUB(INCLUDE( Address, 0123456789 ),,5) For more information: For more details on how ACL evaluates expressions, see Fixed Point Arithmetic on page 6-9 of the ACL for Windows User Guide. For an example of how to use a typical ACL function, see Example of working with functions on page 4-9. Financial Functions When working with financial functions, you should be aware that as with all financial calculations, there are factors that may have a significant impact on your calculations: Any function that returns an amount will do so to two decimal places. For example, 1250.00. Any function that returns an interest rate will do so to eight decimal places. For example, 0.01676584 or 1.676584%. How ACL Financial Functions Calculate Interest Rates 4-2 Financial Functions Financial functions are very sensitive to changes in the interest rate. When doing financial functions, it is very common for the interest rates to be divided by constants such as 12 or 365, to create monthly or daily interest rates, for example, 0.08/365 to get the daily interest factor based on 8% per annum. The normal ACL rules for division would result in significant rounding errors in most situations. For example, 0.08/365 will result in an interest rate of 0.00, instead of the actual rate of 0.000219178. For this reason, the normal division rules are suspended when evaluating interest rate parameters. When the interest rate parameter in a financial function is the division of two quantities, (for example:.08/365) then the two quantities are evaluated separately. They are then divided, maintaining the full precision of the result. Each of the two sides will still be evaluated using the standard ACL rules for rounding, so in the case of very complex

Working with Functions Chapter 4 calculations, this solution may still not provide total protection from rounding errors. Note: When the interest rate is neither a specific rate, nor the division of two simple quantities, (for example: 08 1/365) then a warning message is included in the log (and displayed in an alert dialog, if not in batch mode) warning that rounding may have affected the interest rate calculation. When this occurs, you should ensure that the result returned has not been rounded excessively. When the interest rate is calculated in a computed field, ACL cannot determine whether the rate has been rounded, so you must ensure that the result is correct. Note: When obviously invalid function parameters are used in a financial function, such as negative periods, the function handles the invalid parameter in one of the following ways: if the Stop on Numeric Overflow preference is turned on, ACL stops processing if the Stop on Numeric Overflow preference is turned off, the function returns a value of -1 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 choose to view all the functions in the function list box, or just a subset by clicking the Functions dropdown and choosing a category from the list. Bit/Character Functions ASCII( ) BIT( ) BYTE( ) CHR( ) Returns the ASCII decimal value of the first character of an expression. Returns an string of 0s and 1s representing a specified byte position in the current record. Returns the byte at a specified position in the current record. Returns the character corresponding to the ASCII decimal value specified. Summary of Functions 4-3

Chapter 4 Working with Functions DIGIT( ) HEXadecimal ( ) MASK( ) SHIFT( ) Returns the value of a packed digit from a byte at a specified record position. Returns a string of hexadecimal values representing the contents of a field. Extracts individual bits from the first byte of a character expression. Shifts the first character of an expression left or right by a specified number of bits. Conversion Functions DECimals( ) EBCDIC( ) PACKed( ) STRING( ) UNSIGNed( ) VALUE( ) ZONED( ) Returns a numeric expression with a specified number of decimal places. Converts a string into EBCDIC characters. Creates PACKED fields for data translation applications, as well as for compressing numeric data on a PC. Converts a numeric expression into a string of characters. Converts numeric data into an UNSIGNED data type of a specified length. Converts a character expression into the numeric equivalent. Converts a data string into a ZONED data format. Date and Time Functions AGE( ) CTOD( ) Returns the age (in days) of a date compared to a specified cutoff date or the current system date. Converts a character or numeric expression into a valid date expression for purposes of comparison with date field values. 4-4 Summary of Functions

Working with Functions Chapter 4 DATE( ) DOW( ) TIME( ) Converts a date expression, the current system date, or a date field value into a character string readable as a date. Returns the day of the week for any date. Returns the time from the system clock. Logical Functions FIND( ) MATCH( ) SOUNDSlike( ) TEST( ) VERIFY( ) Searches for a string inside a field or the entire record. Eliminates the need for repetitive expressions in conditions or tests. Indicates whether two strings sound phonetically alike. Compares a string of characters at a specified byte position to another character string. Determines whether a field contains valid data. Mathematical Functions ABSolute( ) EXPonent( ) INTeger( ) LOGarithm( ) MAXimum( ) MINimum( ) MODulo( ) RANDom( ) Returns the absolute value of an expression. Returns the exponential value (base 10) of a numeric expression. Returns the integer value of a numeric expression. Returns the logarithm (base 10) of a numeric expression. Returns the greater of two numeric parameters. Returns the lesser of two numeric parameters. Returns the remainder of a division calculation. Returns a random number between zero and the value of a numeric expression. Summary of Functions 4-5

Chapter 4 Working with Functions ROOT( ) ROUND( ) Returns the square root of a numeric expression. Returns a rounded number from a numeric expression. Financial Functions EFFECTIVE( ) FVANNUITY( ) FVLUMPSUM( ) NOMINAL( ) NPER( ) PMT( ) PVANNUITY( ) PVLUMPSUM( ) RATE( ) Returns the effective annual interest rate on a loan. Returns the future value of a series of payments. Returns the future value of a lump sum. Returns the annual nominal interest rate. Returns the periods required to pay off a loan. Returns the periodic payment required to pay off a loan. Returns the present value of a series of payments. Returns the present value of a lump sum due in a number of periods. Returns the interest rate per period. Miscellaneous Functions FILESIZE( ) FTYPE( ) OFFSET( ) RECLEN( ) RECNO( ) Returns the size of a specified file in bytes. Returns the field type of a specified field. Adjusts the starting position of a field in the current record. Returns the length of the current record. Returns the current logical record number. 4-6 Summary of Functions

Working with Functions Chapter 4 String Access Functions AT( ) CLEAN( ) EXCLude( ) INCLude( ) LENgth( ) LOWER( ) LTRIM( ) PROPER( ) REMOVE( ) SOUNDex( ) SUBstring( ) TRIM( ) UPPER( ) Returns the location in which a specified occurrence of a character string starts within another character string. Discovers any invalid characters in a string and replaces them and all subsequent characters with blanks. Compares two strings and returns a string containing only those characters not common to both. Compares two strings and returns a string containing only those characters common to both. Returns the length of the string parameter as a number. Converts all alphabetic characters of an expression to lowercase. Removes blanks from the beginning of a string. Converts alphabetic characters in a string to uppercase and lowercase, in a manner appropriate for proper names. Removes unwanted characters from an expression. 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. Returns a substring of a character expression. Removes blanks from the end of a string. Converts all alphabetic characters of an expression to uppercase. Summary of Functions 4-7

Chapter 4 Working with Functions Function Syntax Conventions ACL functions use the following syntax conventions: UPPER CASE Indicates the normal abbreviation for the function name. For example, SUBstring( ) means that the SUBSTRING( ) function is normally abbreviated to SUB( ) <> Optional... And so on Separates alternatives N (or N1 or Numeric expression* N2) D C E F Date expression** Character expression*** Any appropriate expression Any appropriate field # Numeric constant arg Argument *Numeric constants can contain no other punctuation than a leading minus sign, digits, and a decimal point. **Date constants must be enclosed in reverse single quotes (the ` character under the ~ on most North American keyboards): `971231` ***Character constants must be enclosed in matching double or single quotes. Numeric constants are exactly that, constant. If you use a variable for a function parameter that requires a constant, it will use that value of the variable at that time, and the expression value will not change if this value subsequently changes. 4-8 Function Syntax Conventions

Working with Functions Chapter 4 Example of working with functions All ACL functions work similarly. For example: To check whether the Address field has the character string New York in it, you would use the FIND( ) function. The function format is FIND(C,<field>) where C is the character string you want to find and field is the field in which you want to search. If you want to look through the whole record, omit the field parameter. Click (Edit view filter) in the View window. In the Expression Builder type FIND( New York,ADDRESS) in the Expression text box and click [OK]. Find function Records that have New York in the Address field are displayed and records that do not have New York in the Address field are filtered out. For more information: See Functions on page 4-10 for more information and examples of using ACL functions. Function Syntax Conventions 4-9

Chapter 4 Working with Functions Functions Functions are a convenient shorthand for performing standard computational tasks. While the tasks are standard, it would generally be very difficult to perform the tasks without functions. Note: Where a function name is more than four characters long, you only need to type the first four letters of the name. For more information: For an introduction and summary of ACL functions, see Working with Functions on page 4-1. 4-10 Function Syntax Conventions

Working with Functions Chapter 4 ABS( ) ABS( ) returns the absolute value of an 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) ABS( ) 4-11

Chapter 4 Working with Functions 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. If the second parameter is omitted, the age is taken relative to the current system date. This allows age calculations relative to fiscal year ends or other cutoff dates. Regardless of the format in which a date field may be stored, when using constants, the constant must be either: a character string or expression of the form `YYMMDD` or `YYYYMMDD`, or a date constant of the form `YYMMDD` or `YYYYMMDD`, or a valid ACL date expression Dates older than the cutoff date return a positive value, and dates occurring before the cutoff date return a negative value. 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 4-12 AGE( )

Working with Functions Chapter 4 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. 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 (string). 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 ASCII( ) 4-13

Chapter 4 Working with Functions AT( ) AT( ) searches for an occurrence of a character string within a character field. You must specify the occurrence number and the two strings. 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. The AT( ) function returns the relative starting position of the character string being sought in the character field. A value of zero is returned if the string is not found. 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( ) looks for strings inside other strings and takes three arguments: N, C1 and C2, where N is the number of times the string C1 must appear in the string C2. The value returned is a location within the searched string, C2. The meaning of AT( ) can be interpreted as at what position is the N th occurrence of the string C1 in the string C2. If C1 is found N times in C2, AT( ) returns the position of the first character of the N th 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 also FIND( ) on page 4-33. Examples 4-14 AT( ) AT(1, ABC, ABCDEFG ) = 1 AT(2, ABC, ABCDEFGABCDEFG ) = 8 AT(2, A, ABCDEFGH ) = 0 AT(3, ABC, ABCDEFGABCDEFG ) = 0

Working with Functions Chapter 4 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 records in a file in which the name is Doe, specify: AT( ) 4-15

Chapter 4 Working with Functions Or if the data is mixed case, specify: 4-16 AT( )

Working with Functions Chapter 4 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 4-19. Function Format BIT(N) BIT( ) converts the byte at location N in the current record into an eightcharacter 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 8th byte contains 1 b9 = 01000001 if the 9th byte contains A b17 = 01100001 if the 17th byte contains a BIT( ) 4-17

Chapter 4 Working with Functions 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, SUB( ) is used to look at the third bit. 4-18 BIT( )

Working with Functions Chapter 4 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. Examples Given a record containing: 10072DOE JOHN 123188......1......2......3......4... BYTE(4) = 7 BYTE(25) = H BYTE(30) = BYTE( ) 4-19

Chapter 4 Working with Functions CHR( ) CHR( ) returns the character corresponding to the ASCII decimal value you specify. It allows you to specify characters that are unprintable, and therefore cannot be placed in quotes. The CHR( ) function is the inverse of the ASCII( ) function. Function Format CHR(N) CHR( ) takes a numeric expression N and returns the single character that corresponds to the value representing each ASCII character. N should be less than 256. Note: The character of value zero is used as a string delimiter by ACL and produces unpredictable results if used. Examples CHR(65) = A CHR(49) = 1 CHR(97) = a If you want to extract the FIRSTNAME field and the LASTNAME field, separated by a tab character (decimal value=9), specify: extract fields condition extracted file name 4-20 CHR( )

Working with Functions Chapter 4 CLEAN( ) CLEAN( ) looks 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 looks 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 checkbox. 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 CLEAN( ) 4-21

Chapter 4 Working with Functions 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. For more information: This usage has largely been replaced by the use of date constants. For more information, see Working with Dates on page 6-12 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. 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. Punctuation 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 back quotes). 4-22 CTOD( )

Working with Functions Chapter 4 Examples Assume you have an accounts receivable transaction file which 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 of MM/DD/YY: CTOD( 951220 ) = 12/20/95 CTOD( DEC2095, MMMDDYY ) = 12/20/95 CTOD( ) 4-23

Chapter 4 Working with Functions 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. 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: For more information on the Set Date command, see SET on page 2-195. 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 4-24 DATE( )

Working with Functions Chapter 4 DEC( ) DEC( ) allows you to specify the number of decimal places for a supplied 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: DEC( ) 4-25

Chapter 4 Working with Functions DIGIT( ) DIGIT( ) returns the value of packed digits from a byte at a position in the record you specify. Use DIGIT( ) when you require access to individual half bytes, such as Burroughs, UNISYS, and NCR applications that use half-byte aligned packed fields. DIGIT( ) can also be used to access non-numeric data, such as PACKED SIGN data or hex values. Function Format DIGIT(N,1 2) The DIGIT( ) function separates individual halves of a byte, which are often PACKED digits. The function returns the value of either the upper (left) or lower (right) half of a particular byte as a number between 0 and 15. The first parameter N specifies a byte position in the record, in the same manner as BYTE( ). Give the second parameter, position, a value of either 1 or 2. If the value is 1, ACL returns the upper (left) half of the byte. If the value is 2, ACL returns the lower (right) half. Examples Given a field starting in byte location 10, PACKED, with two decimals, containing 00 12 34 5C (which is the value 123.45): DIGIT(12,1) = 3 DIGIT(12,2) = 4 DIGIT(13,2) = 12 (which is a hex C) For more information: On working with UNISYS data, see UNISYS on page 3-10. 4-26 DIGIT( )

Working with Functions Chapter 4 DOW( ) DOW( ) returns the day of the week. The day of the week ranges from 1 for Sunday to 7 for Saturday. Function Format DOW(D) The DOW( ) function takes a date D and returns the corresponding day of the week for that date. Examples You can display the day of the week in its name form (such as Sunday, Monday and so on) by creating a computed day of the week like in the following CDOW field: CDOW COMPUTED Sunday IF DOW(DATE) =1 Monday IF DOW(DATE) =2... Friday IF DOW(DATE) =6 Saturday IF DOW(DATE)=7 Bad Day DOW( ) 4-27

Chapter 4 Working with Functions EBCDIC( ) Converts a string to EBCDIC characters. Use EBCDIC( ) to create files for uploading to mainframes or for other data translation applications. Function Format EBCDIC(C) EBCDIC( ) converts the value of string C to EBCDIC. Example To create a field containing the EBCDIC value of the NAME field for uploading to a mainframe, specify: EBCDIC(NAME) 4-28 EBCDIC( )

Working with Functions Chapter 4 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 notes on page 4-3. Function Format EFFective(i,n) i is the nominal annual interest rate. n is the number of compounding periods per year. n 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%. 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%. Note: All amounts are expected to be positive. When calculating the result of this function, if obviously incorrect parameters are entered, EFFECTIVE( ) either returns a value of -1 if the Overflow preference is off, or stops processing with an overflow error if the Overflow preference is on. Examples of obviously incorrect parameters include cases where the periods or the annual interest rate are negative. EFFECTIVE( ) 4-29

Chapter 4 Working with Functions 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. For more information: See also Working with Functions on page 4-1. 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, /# ) 4-30 EXCLUDE( )

Working with Functions Chapter 4 EXP( ) 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 of a number is defined as ten raised to the N th power. Therefore, the exponential of 3 is 1000. The inverse of an exponential is its logarithm. 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: Note: EXP(LOG(X,6)/3,2) You can determine the N th root by dividing the log of the value by N and taking the exponential of the result. EXP( ) 4-31

Chapter 4 Working with Functions 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 so as 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 document, 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 list by double clicking on that item in the list. The selected function is inserted in the Expression window. 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 window use the Calculate command. calculate FILESIZE( DEMO.FIL ) 4-32 FILESIZE( )

Working with Functions Chapter 4 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 upper and lower case), as well as ASCII and EBCDIC characters. FIND( ) returns True if the string is found and False otherwise. Function Format FIND(C,<field>) FIND( ) looks for the string C in the field field. If field is omitted, then FIND( ) looks 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 the (Edit view filter) button in the View window. ACL displays the Edit view filter dialog box. FIND( ) 4-33

Chapter 4 Working with Functions 2. Type FIND( New York,ADDRESS) in the Expression text box: Find function If you think you may use this filter again, type 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, False 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 will look 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, type FIND( New York ) in the quick filter text box. 2. Click the (Set Filter) button. ACL searches the input file and identifies those records that have New York anywhere in the record. 4-34 FIND( )

Working with Functions Chapter 4 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 f 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). 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 field AMOUNT for totalling purposes, you would want to ensure that there was actually an AMOUNT field and that it is numeric before starting the standard application. FTYPE( ) 4-35

Chapter 4 Working with Functions The following batch only executes if AMOUNT is a numeric field: 4-36 FTYPE( )

Working with Functions Chapter 4 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 of payments 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 notes on page 4-3. Function Format FVAnnuity(i,n,amount) i is the interest rate per period. n 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. The result is returned to two decimal places. FVANNUITY() assumes a present value (PV) of zero and calculates the result based on payments at the end of the period. Note: All amounts are expected to be positive. When calculating the result of this function, if obviously incorrect parameters are entered, FVANNUITY( ) either returns a value of -1 if the Overflow preference is off, or stops processing with an overflow error if the Overflow preference is on. Examples of obviously incorrect parameters include: the payment or amount is zero the payment is less than the required interest the sign of the amount and the payment differ FVANNUITY( ) 4-37

Chapter 4 Working with Functions 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 $2,000 per month for three years into an account earning 7% per annum compounded monthly, specify: FVA(.07/12,36,2000) = 79,860.20 4-38 FVANNUITY( )

Working with Functions Chapter 4 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 notes on page 4-3. Function Format FVLumpsum(i,n,amount) i is the interest rate per period. n 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. Example Let s say you can earn 1% per month in the bank compounded monthly. If you deposit $1,000, to calculate how much you would have accumulated after 12 months, specify: FVLUMPSUM(.01,12,1000) = 1126.83 Note: All amounts are expected to be positive. When calculating the result of this function, if obviously incorrect parameters are entered, FVLUMPSUM( ) either returns a value of -1 if the Overflow preference is off, or stops processing with an overflow error if the Overflow preference is on. Examples of obviously incorrect parameters include when the amount is zero. FVLUMPSUM( ) 4-39

Chapter 4 Working with Functions HEX( ) HEX( ) returns a hexadecimal string that is equivalent to an expression or field value 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) 4-40 HEX( )

Working with Functions Chapter 4 INCLUDE( ) INCLUDE( ) returns a variable length string and includes only specified characters in the result. INCLUDE( ) is the opposite of the EXCLUDE( ) function. 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 ) INCLUDE( ) 4-41

Chapter 4 Working with Functions INT( ) 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. Function Format INTeger(N) The INT( ) function returns the integer value of the numeric expression or field value N. Note: Note: By definition, numbers following a decimal are truncated. 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) 4-42 INT( )

Working with Functions Chapter 4 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 4-77. 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)) LENGTH( ) 4-43

Chapter 4 Working with Functions LOG( ) 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 ten needed to generate that number. Therefore, the logarithm of 1000 is 3. The inverse of a logarithm is its exponential. 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: Note: EXP(LOG(X,6)3,2) You determine the N th root by dividing the log of the value by N and taking the exponential of the result. 4-44 LOG( )

Working with Functions Chapter 4 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 lower case 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 4-59, which converts alphabetic characters to uppercase and lowercase; and UPPER( ) on page 4-79, 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) LOWER( ) 4-45

Chapter 4 Working with Functions 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. Function Format LTRIM(C) The string C is copied to the result and any leading blanks are omitted. For more information: See also TRIM( ) on page 4-77. Examples LTRIM(" AB C ") ="AB C " LTRIM("ABC") ="ABC" LTRIM(" A ") ="A " 4-46 LTRIM( )

Working with Functions Chapter 4 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. Example MASK( A,CHR(15)) = CHR(1) (where A = 65 = 11000001, 15 = 00001111, A AND 15 = 00000001) MASK( ) 4-47

Chapter 4 Working with Functions MATCH( ) MATCH( ) compares an expression or field value of any type to a series of specified expressions or field values to determine if 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(arg,...) MATCH( ) returns a true or false value, depending on whether the first argument is equal to any of the subsequent arguments. Any number of arguments may be included, each being a constant, field value or expression. The arguments can be of any type (character, numeric or logical), as long as all the arguments to the function 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) = TRUE because 7 is included in 1, 3, 5, 7, 9 MATCH(7,2,4,6,8,10) = FALSE because 7 is not included in 2, 4, 6, 8, 10 MATCH('BILL','JOHN','ANDY') = FALSE 4-48 MATCH( )

Working with Functions Chapter 4 If locations 101, 102, and 122 represent your research division, to create a RESEARCH filter that excludes all other departments, specify: To extract all records for the research division, specify: extract records condition extracted file name MATCH( ) 4-49

Chapter 4 Working with Functions MAXIMUM( ) MAXIMUM( ) returns the greater of two numbers. MAX( ) is the opposite of the MIN( ) function. 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 1 dollar, MAX( ) returns 1. Otherwise, MAX( ) returns the calculated interest amount. 4-50 MAXIMUM( )

Working with Functions Chapter 4 MINIMUM( ) MINIMUM( ) returns the lesser of two specified numbers. MIN( ) is the opposite of the MAX( ) 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) MINIMUM( ) 4-51

Chapter 4 Working with Functions 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) 4-52 MOD( )

Working with Functions Chapter 4 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 information: See notes on page 4-3. Function Format NOMinal(i,n) i is the effective annual interest rate. n is the number of compounding periods per year. n is truncated to an integer. This function is the opposite of EFFECTIVE( ). The result will be returned to eight decimal places, that is, 0.12345678 or 12.345678%. 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%. For more information: See also EFFECTIVE( ) on page 4-29. Note: All amounts are expected to be positive. When calculating the result of this function, if obviously incorrect parameters are entered, NOMINAL( ) either returns a value of -1 if the Overflow preference is off, or stops processing with an overflow error if the Overflow preference is on. NOMINAL( ) 4-53

Chapter 4 Working with Functions Examples of obviously incorrect parameters include: the payment or amount is zero the payment is less than the required interest the sign of the amount and the payment differ 4-54 NOMINAL( )

Working with Functions Chapter 4 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 notes on page 4-3. Function Format Note: NPER(i,pmt,amount) i is the interest rate per period. pmt 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. All amounts are expected to be positive. When calculating the number of periods, if obviously incorrect parameters are entered, NPER( ) either returns a value of -1 if the Overflow preference is off, or stops processing with an overflow error if the Overflow preference is on. Examples of obviously incorrect parameters include: Example the payment or amount is zero the payment made in each period is less than the interest payable for that period the sign of the amount and the payment differ The result is returned to two decimal places. For example, 8.33 periods would indicate that the balance outstanding after eight periods is approximately one third of a payment. 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. NPER( ) 4-55

Chapter 4 Working with Functions OFFSET( ) OFFSET( ) adjusts the starting position of a field in the current record. Use OFFSET( ) with OCCURS clauses in COBOL to access any item in the array. 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(E,N) The OFFSET( ) function offsets the starting position of a field by N, where N is any valid positive numeric expression. If E contains an expression, all fields defining that expression (including fields used by an IF test in the definition of a conditional field) are offset by N. OFFSET( ) does this by temporarily changing the defined starting position of every field referred to by E, evaluating E based on the new position and returning the result. 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 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 ve 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) 4-56 OFFSET( )

Working with Functions Chapter 4 PACKED( ) PACKED( ) converts a number to a PACKED field type of a specified length. Use PACKED( ) for uploading to mainframe and data translation applications, as well as compressing numeric data on a PC. For more information: See UNSIGNED( ) on page 4-78 for an alternate method of compressing numeric data for upload. 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) PACKED(7.5,3) PACKED(-12.456,6) PACKED(-12.456,2) = 00075C (hex) = 00075C (hex) = 00000012456D (hex) = 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) PACKED( ) 4-57

Chapter 4 Working with Functions 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 more information: See notes on page 4-3. Function Format PMT(i,n,amount) i is the interest rate per period. n 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. Note: All amounts are expected to be positive. When calculating the result of this function, if obviously incorrect parameters are entered, PMT( ) either returns a value of -1 if the Overflow preference is off, or stops processing with an overflow error if the Overflow preference is on. Examples of obviously incorrect parameters include: the payment or amount is zero the payment is less than the required interest the sign of the amount and the payment differ Example 4-58 PMT( ) 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

Working with Functions Chapter 4 PROPER( ) PROPER( ) converts alphabetic characters in a string or field to mixed case, as appropriate 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. For more information: See also UPPER( ) on page 4-79 and LOWER( ) on page 4-45, which convert alphabetic characters to uppercase and lowercase, respectively. 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 PROPER( ) 4-59

Chapter 4 Working with Functions PVANNUITY( ) PVANNUITY( ) calculates the present value of a stream 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 notes on page 4-3. Function Format PVAnnuity(i,n,amount) i is the interest rate per period. n 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 (FV) of zero and calculates the result based on payments at the end of the period. Note: All amounts are expected to be positive. When calculating the result of this function, if obviously incorrect parameters are entered, PVANNUITY( ) either returns a value of -1 if the Overflow preference is off, or stops processing with an overflow error if the Overflow preference is on. Examples of obviously incorrect parameters include when the amount is zero. Example At an interest rate of 8% per annum, to calculate the value of receiving $500 a month for the next twenty years, specify: PVA(0.08/12,12*20,500) = 59,777.15 4-60 PVANNUITY( )

Working with Functions Chapter 4 PVLUMPSUM( ) PVLUMPSUM( ) calculates the present value of a lump sum 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 someone money at a future date, the present value is the amount you need to put in the bank now, with compound interest, so the debt will be covered when it is due. For more information: See notes on page 4-3. Function Format PVLumpsum(i,n,amount) i is the interest rate per period. n 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. Example Assuming an interest rate of 11% per annum, compounded monthly, what is the present value of $10,000 due in three years is: Note: PVLUMPSUM(.11/12,3*12,10000) = 7,200.05 All amounts are expected to be positive. When calculating the result of this function, if obviously incorrect parameters are entered, PVLUMPSUM( ) either returns a value of -1 if the Overflow preference is off, or stops processing with an overflow error if the Overflow preference is on. Examples of obviously incorrect parameters include: the payment or amount is zero the payment is less than the required interest the sign of the amount and the payment differ PVLUMPSUM( ) 4-61

Chapter 4 Working with Functions RAND( ) or RND( ) RND( ) or RAND( ) 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) RND( ) or RAND( ) 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 RND( ) or RAND( ) 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 RND(1000.00) = 278.61 RAND(10000) = 3781 4-62 RAND( ) or RND( )

Working with Functions Chapter 4 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 notes on page 4-3. Function Format RATE(n,pmt,amount) n is the total number of periods. pmt 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. Note: All amounts are expected to be positive. When calculating the rate and number of periods, if obviously incorrect parameters are entered RATE( ) either returns a value of -1 if the Overflow preference is off, or stops processing with an overflow error if the Overflow preference is on. Examples of obviously incorrect parameters include: the payment or amount is zero the number of periods is less than 1 the total payments are less then 10% of the amount the sign of the amount and the payment differ The result is returned to eight decimal places, that is, 0.12345678 or 12.345678%. Example To calculate the rate implied in a four year, $8,000 loan with monthly payments of $200, specify: RATE( ) 4-63

Chapter 4 Working with Functions 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). 4-64 RATE( )

Working with Functions Chapter 4 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 4-66. 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: extract records condition extracted file name RECLEN( ) 4-65

Chapter 4 Working with Functions 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. Example For record 99: RECNO() = 99 4-66 RECNO( )

Working with Functions Chapter 4 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 information 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. 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, which all 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 4-41 and EXCLUDE( ) on page 4-30. Examples REMOVE( ABC 123 XX4, ABC123 ) = ABC123 REMOVE( ABC 123 XX4, ABCX123 ) = ABC123XX REMOVE( ABC 123 XX4, 1234567890 )= 1234 To create a field for sorting or matching that contains only the numbers from a product number field, specify: REMOVE(PRODNO, 123456789 ) REMOVE( ) 4-67

Chapter 4 Working with Functions 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 more information: For performing other root functions (such as cube root), see LOG( ) on page 4-44. Examples ROOT(100,2) = 10.00 ROOT(1000,4) = 31.6228 4-68 ROOT( )

Working with Functions Chapter 4 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.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) ROUND( ) 4-69

Chapter 4 Working with Functions 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). 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 4-70 SHIFT( )

Working with Functions Chapter 4 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 duplicate entries or if spelling is inconsistent. For more information: For an alternate method of phonetically comparing strings, see SOUNDSLIKE( ) on page 4-72. Function Format SOUNDEX(C) 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. Examples SOUNDEX( Aluminum Door ) = A455 SOUNDEX( Radial Arm Saw ) = R346 SOUNDEX( Radial Arm Bench ) = R346 SOUNDEX( ) 4-71

Chapter 4 Working with Functions SOUNDSLIKE( ) SOUNDSLIKE( ) returns True or False to indicate whether two strings sound phonetically alike. Use SOUNDSLIKE( ) to identify items that sound similar for the purpose of matching. Function Format SOUNDSLIKE(C1,C2) SOUNDSLIKE( ) returns True if the soundex of C1 is equal to the soundex of C2. Otherwise, it returns False. Both C1 and C2 must be character expressions. This function is case-insensitive, so SMITH is equivalent to smith. Examples SOUNDSLIKE( Brady Greg, Bridie George )=T SOUNDSLIKE( Drany Greg, Bridie George )=F To create a filter that identifies all names that sound like Smith, specify: SOUNDSLIKE(NAME, Smith ) 4-72 SOUNDSLIKE( )

Working with Functions Chapter 4 STRING( ) STRING( ) converts a numeric expression 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 more information: For details on formatting, refer to Formatting Numeric Fields on page 4-25 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) STRING( ) 4-73

Chapter 4 Working with Functions SUBSTRING( ) SUBSTRING( ) returns a substring of a character expression or field value. Use SUBSTRING( ) to isolate a portion of a character expression or field value. Function Format SUBstring(C,N1,N2) SUB( ) returns a substring of the character expression or field value C. The result is N2 characters long starting at position N1 in C. Examples SUB( ABCDEF,2,3)= BCD To extract the year out of a character field containing a date of the form MM/DD/YYYY, specify: SUB(DATE,7,4) 4-74 SUBSTRING( )

Working with Functions Chapter 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 line containing: Dept Name: Marketing... 5 10 TEST(5,'Dept') = T TEST(6,'Dept') = F (Dept starts in position 5, not 6) TEST(5,'DEPT') = F (the case is incorrect) To create a filter identifying page headings, specify: TEST(1, Page: ) TEST( ) 4-75

Chapter 4 Working with Functions TIME( ) TIME( ) returns the system clock time. Use TIME( ) to determine the current time or the duration of specific tasks. Function Format TIME() TIME( ) returns the time 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. Examples 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. 4-76 TIME( )

Working with Functions Chapter 4 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. Function Format TRIM(C) The string C is copied to the result and any trailing blanks are omitted. For more information: See Working with Functions on page 4-1. Examples TRIM(" AB C ") =" AB C" TRIM("ABC") ="ABC" TRIM(" A ") =" A" Given the two fields FIRSTNAME and LASTNAME, to create a NAME field of the form LASTNAME, FIRSTNAME, specify: TRIM(LASTNAME) +, + TRIM(FIRSTNAME) TRIM( ) 4-77

Chapter 4 Working with Functions UNSIGNED( ) UNSIGNED( ) converts a number to an UNSIGNED data type of a specified length. Use UNSIGNED( ) for uploading and data translation applications, as well as compressing numeric data on a PC. For more information: For an alternate method of compressing numeric data for upload, see PACKED( ) on page 4-57. 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: Note: UNS(-12.456,6) = 000000012456 (hex) 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) 4-78 UNSIGNED( )

Working with Functions Chapter 4 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. For more information: See also PROPER( ) on page 4-59, which converts alphabetic characters to upper and lower case; and LOWER( ) on page 4-45, which converts alphabetic characters to lowercase. Examples UPPER( ABC ) = ABC UPPER( abc 123 DEF ) = ABC 123 DEF UPPER( AbCd 12 ) = ABCD 12 If capitalization is of concern, you can identify all customers named Smith by specifying: UPPER(NAME) = SMITH UPPER( ) 4-79

Chapter 4 Working with Functions VALUE( ) VALUE( ) converts a character expression or field into the numeric equivalent. Use VALUE( ) if you need to convert a character expression or field value to numeric format for use in ACL commands. Function Format VALue(C,#) Where # is a numeric constant representing decimal places that cannot change from record to record. VALUE( ) returns the numeric equivalent of a character expression or field value C with # 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 (punctuation, leading or trailing signs, parentheses, and so on) as input. VALUE( ) is the opposite of STRING( ). Examples VALUE( 123.4-,3) = -123.40 VALUE( $123,456,0) = 123456 VALUE( 77.45CR,2) = -77.45 VALUE( (123,456.78),0) = -123457 4-80 VALUE( )

Working with Functions Chapter 4 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 page 2-242 of this manual and Verify Data on page 7-15 in 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. Examples 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 VERIFY( ) 4-81

Chapter 4 Working with Functions 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) which require ZONED data files as input. Function Format ZONED(N,#) ZONED( ) converts a numeric expression or field value N to a character string in ASCII ZONED data format of # characters long. This data format does not include an explicit decimal point, but has leading zeroes on the left. If the amount is negative, the rightmost character is either a } for zero or a letter between J and R for other digits. Note: If N has more than # digits, ZONED( ) returns only the rightmost # digits and truncates the leading digits without notification. Example ZONED(-6448.95,11) = 0000064489N 4-82 ZONED( )

Using ACL Utilities Chapter 5 ACL for Windows lets you use IBM COBOL, SAP and AS/400 files, ACL for DOS format files, batches, and reports. However, you must first convert the files in one of two ways: Note: use the ACL Conversion Utility to batch convert many files at once use the Import from DOS option in ACL for Windows to convert and import only those ACL for DOS files you require This chapter explains how to convert and use IBM COBOL, AS/400, and ACL for DOS files using the ACL Conversion Utility. ACL for Windows Version 6 is 32-bit based, and supports file names longer than eight characters. This chapter also summarizes the changes between ACL for DOS and ACL for Windows files, and gives you details on the incompatibilities between the two versions. Converting from DOS For more information: See also (Import from DOS file) button on page 5-3 in the ACL for Windows User Guide. The Convert from DOS option in the ACL Conversion Utility transforms all the ACL for DOS format, batch, workspace, and report files in a directory and includes them in a single ACL for Windows document. It is a good idea to review the directories containing your ACL for DOS files before you convert them. You might want to reorganize the files to include only related applications in the converted document. 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. 5-1

Chapter 5 Using ACL Utilities 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 DOS files, do the following: 1. In the ACL program group, double click the ACL Conversion Utility program icon. ACL displays the ACL Conversion Utility window. 2. Select Convert from the menu bar and choose DOS to Windows. ACL displays a message informing you that your ACL for DOS files will be converted and placed in an ACL for Windows document. Click [OK]. 3. ACL displays a dialog box with options for locating the directory which contains the files you want to convert. select directory of DOS files name the document 4. In the File name text box, type a name for the document 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. 5-2

Using ACL Utilities Chapter 5 When the scanning is complete, ACL displays the Convert dialog box with all items preselected. Select only those items you want to add to your new document and click [OK]. format files to be converted to input file definitions batches to be 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. 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 reports to be converted to views 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 valid. 5-3

Chapter 5 Using ACL Utilities 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). File Name Format Path When the utility is finished, it prints the cross-reference tables that it has built. The first table displays the data files and formats used. The utility then prints all of the data files that it found used in the batch files. Report Format This table lists the report files and formats used. 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. 5-4

Using ACL Utilities Chapter 5 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 document. 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 document. 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 programs you may have open and try doing the conversion again. Error writing to compound document Indicates that the utility is unable to write to the document it is creating. This should only happen if you run out of disk space. Free up disk space and try doing the conversion again. Using Converted DOS 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 document with the converted files. 2. Select Window from the menu bar and choose Open Overview. 5-5

Chapter 5 Using ACL Utilities ACL displays the Overview window, which shows the batches, input file definitions (formats), views (reports), and workspaces included in your document. click to collapse click to expand Batches Format Files Note: To expand the list of batches, input file definitions, views, and workspaces in your document, 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. Converted batch files appear in the Overview window s list of batches. 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. 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. Converted format files become input file definitions and are stored as part of the document. ACL does not store data files as part of the document. Rather, when you open an input file definition, ACL automatically links you to the appropriate data file. 5-6

Using ACL Utilities Chapter 5 For more information: On the relationship between data files and input file definitions, see Defining Data on page 3-10 in 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 document as views. The Overview window displays all converted reports (views) under the icon labeled All 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 associate. 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. 3. Delete the old report with the unknown input file. What s Different? Documents The most fundamental change is the introduction of a document. ACL for DOS stores each format, batch, and report in a separate file on your hard drive, using a standard extension to identify the type of file. ACL for Windows links and stores the files for a particular application as part of a single file, called a document. 5-7

Chapter 5 Using ACL Utilities For more information: On documents, see ACL Documents on page 3-1 in the ACL for Windows User Guide. Input Files Format files are roughly equivalent to input file definitions, which contain the field definitions. Input file definitions are used to link data files to documents. When you open an input file definition, ACL automatically links you to the appropriate data file. For more information: On input files, see Defining Data Files on page 4-4 in the ACL for Windows User Guide and Defining Data on page 3-10 in the ACL for Windows User Guide. Views Views display the data file in a spreadsheet format. Each column represents a field that has been defined in the input file, and each row is a record. For more information: On views, see Creating a View on page 5-5 in the ACL for Windows User Guide. Reports Reports are formatted views. In a What you see is what you get (WYSIWYG) manner, you can click and drag columns to rearrange them and change their width. As well, you can add and delete columns, and format them in a number of ways. For more information: For more information on reports, see Producing Reports on page 5-19 in the ACL for Windows User Guide. Preference File Log Files The CONFIG.ACL file has been replaced by the ACLWIN6.PRF file. To edit this file and establish default conditions, select Edit from the menu bar and choose Preferences. The log file is automatically opened as soon as you open a document and remains open for the entire session. You can view, add comments to, print, and clear the log. You can also specify a different log file for your ACL document. You can log different activities in different log files. 5-8

Using ACL Utilities Chapter 5 For more information: For more information, see SET LOG on page 2-201. Note: You can turn off command logging with the Set Echo command so that passwords sent by batches are not recorded in the command log. For more information: For more information, see SET ECHO on page 2-198. Converting COBOL Files The ACL Conversion Utility converts a file specification from an IBM mainframe COBOL program into an ACL input file definition. Not only are the field names retained and field types automatically determined, but such features as OCCURS, REDEFINES, and level 88 logical fields are correctly interpreted. The utility reads a COBOL record layout from a source file or a COBOL copybook and produces an input file definition. If the input is a source file, all layouts are processed. To convert COBOL copybooks to input file definitions usable in ACL, do the following: 1. In the ACL program group, double click the ACL Conversion Utility program icon. ACL displays the ACL Conversion Utility window. 2. Select Convert from the menu bar and choose IBM COBOL to Windows. ACL displays a message informing you that your COBOL copybook will be converted and placed in an ACL for Windows document. Click [OK]. 5-9

Chapter 5 Using ACL Utilities ACL displays the IBM COBOL Conversion dialog box. click to locate files to convert click to specify document COBOL file to be converted click to denote IBM variable length files 3. Click [Convert] to display a dialog box with options for locating the COBOL copybook you want to convert. After locating the copybook, click [OK]. The file and its directory path appears in the Convert text box. 4. Click [Save As] to display a dialog box with options for locating or creating an ACL document in which you want to include the converted input file definitions. After specifying the document, click [OK]. The file and its directory path appears in the Save As text box. 5. In the Input File Definition text box, type a name for the input file definition to be generated. It s best to use the same name as the COBOL file. 6. If the IBM COBOL file you want to convert is a variable length file, check the IBM Variable Length checkbox. The utility automatically makes the appropriate adjustments to the format, including setting the record length as VARIABLE and starting the data fields at byte 5. For more information: On IBM variable length files, see Using Variable Length Files (IBM) on page 6-6. 7. Click [OK]. The utility automatically converts the COBOL copybook and looks for invalid data types, missing field lengths, and missing field names. These problems do not usually occur unless the COBOL source file is corrupted. If the source file is corrupt, the utility assigns an incorrect record length in the resulting input file definition and ACL is unable to read the file correctly. 8. The converted input file definition is added to the document. 5-10

Using ACL Utilities Chapter 5 If the input file definition already exists, you are prompted to give the input file definition a new name. The input file definition created supplies the correct field types for almost all COBOL constructs and data definitions, including COMP-1 and COMP-3 data types, and REDEFINES, OCCURS, and LEVEL 88 logical fields. As well, each ACL input file definition uses the same field name as in the COBOL specification, however, field names longer than 22 characters are truncated from the beginning of the name. Note: For OCCURS, only the first element of the array is defined. Other elements of the arrays can be accessed using the OFFSET( ) function or a text editor to copy the definitions for the other elements. If you use a text editor, be sure to give the other array elements unique names. OCCURS can be nested, so assign new field names carefully. As an example of using the OFFSET( ) function for an OCCURS, the COBOL definition: 10 CODE PIC X(5) OCCURS 10 TIMES. would be converted to the ACL definition: CODE EBCDIC 1 5 where CODE is the field name, EBCDIC is the field type, 1 is the relative byte position of the start of the field, and 5 is the length of the field. To access the first element of the array, simply refer to the CODE field. To access the second element of the array, use OFFSET(CODE,5). The third element is OFFSET(CODE,10), and so on. Level 88 logical fields are defined in ACL as computed fields with a logical result and can be used the same way they are in COBOL. Using Converted COBOL Files All the converted files appear in the Overview window. To display the Overview window, do the following: 1. Start ACL for Windows and open the document with the converted/ imported files. 2. Select Window from the menu bar and choose Open Overview to display the Overview window. 5-11

Chapter 5 Using ACL Utilities 3. Click beside Input File Definitions to display the input file definitions (COBOL formats) included in the document. 4. Double click one of the input file definitions to open it. If the COBOL data file is located in the same directory as the ACL document, a default view of the input file is displayed. Otherwise, ACL displays a dialog box with options for locating the COBOL data file. Converting AS/400 Files An FDF file is automatically created by PC Support (a DOS application) when you use it to download files from the AS/400. The ACL Conversion Utility takes the FDF and creates an ACL input file definition. To convert FDF source files to input file definitions usable in ACL, do the following: 1. In the ACL program group, double click the ACL Conversion Utility program icon. ACL displays the ACL Conversion Utility window. 2. Select Convert from the menu bar and choose AS/400 FDF to Windows. ACL displays a message informing you that your AS/400 FDF files will be converted and placed in an ACL for Windows document. Click [OK]. ACL displays the AS/400 Conversion dialog box. click to locate file to convert click to specify document FDF source file to be converted 3. Click [Convert] to display a dialog box with options for locating the AS/400 FDF source files you want to convert. 5-12

Using ACL Utilities Chapter 5 Field Width Considerations Click [OK]. The file and its directory path appear in the Convert text box. 4. Click [Save As] to display a dialog box with options for locating or creating an ACL document in which you want to include the converted input file definitions. Click [OK]. The file and its directory path appear in the Save As text box. 5. In the Input File Definition text box, type in a name for the input file definition to be generated. It s best to use the same name as the FDF source file. 6. Click [OK]. The utility automatically converts the FDF file to an ACL input file definition and adds it to the document. If the input file definition already exists, you are prompted to give the converted input file definition a new name. If the utility encounters a problem in the field definitions, it displays the error message Invalid field definition encountered, format may not work properly. The utility is looking for invalid data types, missing fields lengths, and missing field names. These problems do not usually occur unless the FDF source file is corrupted. If the source file is corrupt, ACL assigns an incorrect record length in the resulting input file definition and is unable to read the file correctly. The conversion utility ensures that the field width for Zoned and Packed fields is within the size ACL supports. In the unlikely event that the field width is larger, ACL creates a separate field (field_ EXCESS) for the high order bytes and adjusts the field definition to the maximum allowable by ACL. ACL tells you to test the excess field to ensure that it is always 0. If the excess amount is non-zero, your results will not be correct. For example, assume that the OPDIV field was defined in the FDF file as Zoned (type 5) with a length of 26 digits. Because the maximum length support by ACL is 22, the first 4 bytes are put into a separate field. ACL displays the message: Field OPDIV exceeds maximum numeric length, starting position adjusted. To ensure correct results ensure the OPDIV_EXCESS is 0 for the entire file. 5-13

Chapter 5 Using ACL Utilities The field definitions below are created in the input file definition: OPDIV_EXCESS: OPDIV: a Numeric field type with a start position of 3, a length of 4, and 0 decimal places. a Zoned field with a start position of 7, a length of 22, and 2 decimal places. Using Converted AS/400 Files All the converted files appear in the Overview window. To display the Overview window and open one of the converted input files, you can follow the same method as that outlined in Using Converted COBOL Files on page 5-11. Converting SAP Files When you use the ACL Conversion Utility to convert SAP files, the Utility program creates an ACL document and an input file definition for the SAP file. You can then access the converted file directly from the Overview window, as with any other ACL file. To convert SAP files, do the following: 1. In the ACL program group, double click the ACL Conversion Utility program icon. 2. ACL displays the ACL Conversion Utility window. 3. Select Convert from the menu bar and choose SAP AIS to Windows. ACL displays in the Convert Information message box. Click [OK]. ACL displays the SAP AIS Conversion dialog box. Click [Convert]. 5-14

Using ACL Utilities Chapter 5 4. ACL displays the Select File to convert dialog box. Select the SAP file you want to convert and click [Open]. ACL returns to the SAP AIS Conversion dialog box showing the file name you selected. 5. In the SAP AIS Conversion dialog box, click [Save As] and specify the name under which you want to save the converted file. Click [Save] to return to the SAP AIS Conversion dialog box. 6. In the SAP AIS Conversion dialog box, type a name for the input file definition in the Input File Definition text box. Click [OK] to start the conversion. The ACL document, as well as the converted SAP file, is created in the selected directory. ACL displays the ACL Conversion Utility window showing the result of the conversion. 7. When you are done, select Convert from the menu bar and choose Exit. 5-15

Chapter 5 Using ACL Utilities Using Converted SAP Files All the converted files appear in the Overview window. To display the Overview window and open one of the converted input files, you can follow the same method as that outlined in Using Converted COBOL Files on page 5-11. 5-16

Obtaining Data to Analyze Chapter 6 Data files from any source, including personal, mini or mainframe computers can be analyzed with ACL. The data does not have to be converted into special codes or formats. ACL does not alter the contents of the data file, but rather works with the layout of the file, called an input file definition. For more information: On how to create and use an input file definition, see Working with Documents on page 4-1 in the ACL for Windows User Guide. This chapter describes how you can obtain and prepare data files, and how to handle different types of files. File Preparation Guidelines Regardless of how you obtain data, the following guidelines apply: Request your data as a flat, sequential file. ACL works best with a flat file. In most flat files, the record length is fixed. With fixed length files, each record has a fixed number of fields and each field is a constant length. Usually, there is only one type of record in the file. A single record type, fixed length file is preferable for processing, however it is not essential. ACL can also process multiple record type files and almost any type of variable length file, as well. If your data is in a relational database, you should convert it to a flat file before you download your data or copy it to tape. If you have an information systems department, ask them to assist you. You can also use ODBC and/or Set Relation to read relational database. Alternatively, rather than flattening the database, you might want to generate a report from the data and use ACL to analyze the report spool file. 6-1

Chapter 6 Obtaining Data to Analyze Do not translate your data to ASCII. ACL works best and fastest with raw data that has not been translated to ASCII. ACL is compatible with all major mainframe and minicomputer data types, and reads EBCDIC directly, as easily as it handles ASCII. Because ASCII translation is often a routine part of file preparation, you need to make your request very specific. Even though ACL reads ASCII files, fields often get damaged in the translation process. You can save a lot of time and trouble by working with raw data. Request a copy, not a backup, of the original tape file when you create a tape. Typically, a backup file has a section of header information, followed by blocks of data interspersed with smaller blocks of control information. Unfortunately, the blocks of data usually ignore logical record boundaries and, therefore, make the file unusable for ACL input. The only way you can use a backup file is to first restore the data to a regular file, and then make a copy of the file to use with ACL. Request a file description or file layout. The more details you have about the file, including its contents and organization, the better. Details make it simpler to define the data. Obtaining Data from a Personal Computer Data stored on a personal computer can be obtained very easily by one of the following methods: Transfer data files to the personal computer on which ACL is installed. If the data files are relatively small, it is easy to copy them on floppy disks. Even if the files are large, you can use various backup technologies to transfer the files. Install ACL on the personal computer in which the data files are located. Use this method if your data files are extremely large. Obtaining Data from a Mainframe or Minicomputer You can use one of the methods below to obtain data stored on a mainframe or minicomputer: Download data onto a personal computer s hard disk. 6-2

Obtaining Data to Analyze Chapter 6 The personal computer must be linked to the mainframe or minicomputer, either using a 3270 connection (for example) or directly through a LAN gateway. Read the data from tape. ACL can read data from almost all types of tape, including 1 2 inch 9-track tapes, IBM 3480 cartridges, 8mm tape, and 4mm DAT. You must attach the appropriate tape drive to your personal computer to use this method. Consider the use of ACL for MVS to do all your processing directly on your IBM mainframe computer. Downloading Data The most common means of gaining access to data from a mainframe or minicomputer is via downloading or terminal emulation. In most cases, the personal computer emulates a terminal on the mainframe or minicomputer. You require software to download data to the personal computer from the mainframe or minicomputer. You often need special hardware in the personal computer so that it can emulate a terminal. The most common devices are an IRMA (or compatible card) that provides 3270 terminal access to an IBM mainframe, and a network adapter, which allows you to directly access the mainframe. Note: When you download data, it is important that you do not translate the data as it is downloaded. Most downloading software automatically translates the data to ASCII unless otherwise instructed. Unfortunately, this translation can corrupt nonprintable fields. Because ACL is compatible with all major data types, do not translate to ASCII on download. Leave the data in its original form. You should also remember to leave enough space on your personal computer s hard disk to store the file being downloaded. In some cases, you will need to leave a significant amount of space. The time required to transfer the data via downloading varies considerably depending on your transfer method. Data transfer speeds range between 6K to 10,00K per minute for 3270 emulation, and up to 1 MB per second for a LAN-based connection. 6-3

Chapter 6 Obtaining Data to Analyze Reading Data from Tape A fast way to access data generated on mainframe or minicomputers is via magnetic tape. You require a tape reader that is compatible with your personal computer and a controller card supported by ACL. You do not require downloading software or large amounts of disk space to store the data (which remains on tape). Data access speeds typically range between 5 and 30 megabytes per minute. For more information: On using tape, see Working With Tape on page 7-1. Identifying Data File Structures and Record Types ACL handles the following types of files: fixed length CR/LF CR files LF files delimited variable length (IBM) proprietary variable length database report multiple record type Using Fixed Length Files This is the most common file structure. Fixed length files contain records of a determinate length. Generally, there is only one type of record with fields in a fixed position. ACL analyzes fixed length files automatically, and provides the record length and character set. 6-4

Obtaining Data to Analyze Chapter 6 Using CR/LF Files ACL automatically detects the carriage return (CR) and line feed (LF) characters that indicate the end of a record in CR/LF files. The Hex value for a carriage return and line feed combination is 0D0A, which is the standard means of separating line files on IBM-compatible personal computers. These files are usually plain ASCII text, containing printable information such as reports or text. You can remove trailing blanks to save space. The result is a file in which each record (line) length is different, depending on the number of blanks you remove. ACL detects CR/LF files and automatically provides the correct record length and character set. Using CR Files CR files are unique computer files that have a carriage return (CR) to mark the end of each record. ACL treats these files the same as CR/LF files. This is the standard means of separating line files on Macintoshcompatible computers. Using LF Files LF files are unique computer files that have a line feed (LF) to mark the end of each record. ACL automatically detects and treats these files the same as CR/LF files. Using Delimited Files Many data files contain fields that do not have a fixed position in a record. Instead, each field is separated from the others by a field separator character. These files are called delimited files. 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) separate each record in the file. When ACL detects a delimited file, it prompts you to convert it. Click [OK] to have ACL produce a fixed length file with all fields defined. ACL names the fields FIELD_1, FIELD_2, and so on. You should change the default names to more meaningful names. 6-5

Chapter 6 Obtaining Data to Analyze If a data file uses non standard delimiters, ACL may not be able to detect the file as a delimited file. In this case, click the (Convert delimited file) button in the Input File Definition window to display the Custom Delimit dialog box where you can specify non-standard delimiters. This allows you to analyze and use virtually any delimited file no matter what characters are used as delimiters. Using Variable Length Files (IBM) To save space, many IBM mainframe computers use variable length records to store numerous record types in one file. Each record type can have a different length, and each record can have its own length. ACL automatically detects and deals with IBM variable length files to ensure correct record processing. For more information: See Variable Length Records on page 8-78 in the ACL for Windows User Guide for further details on how to work with this type of file. Using Proprietary Variable Length Files These files are flat files that do not conform to one of the fixed or variable length conventions described previously. For more information: See Variable Length Records on page 8-78 in the ACL for Windows User Guide for further details on how to work with this type of file. 6-6

Obtaining Data to Analyze Chapter 6 Using Databases Most relational databases have complex internal structures that make them difficult to access or analyze. For personal computer-based relational databases, you can probably export to a DBF (dbase) file. xbase Files Note: ACL automatically detects and analyzes dbase files from a personal computer (typically those with a DBF extension), and creates a format for them. This is also true for dbase files created by xbase (dbase compatible) products, such as FoxPro, Visual FoxPro, and Clipper. ACL reads dbase data files, but does not read any other files associated with them, such as index or memo files. When you open a dbase file, ACL displays the message: File is likely a dbase File. Create fields now? Click [OK] and ACL informs you that Field definitions have been created automatically. Simply check that the field definitions are correct, and you re set to begin processing the file. Most dbase field types (including those recently added by Visual FoxPro) are supported by ACL, which automatically generates a field of the appropriate type. These include: dbase field type Character Numeric Date Logical Float Currency Integer Double ACL field type ASCII NUMERIC DATE LOGICAL NUMERIC MICRO MICRO FLOAT Visual FoxPro NULL-valued fields are treated as blanks or zeroes by ACL, as appropriate. 6-7

Chapter 6 Obtaining Data to Analyze The field types not supported by ACL include Memo and General fields, as well as DateTime fields. However, you can access the information in DateTime fields if you need to. Because the DateTime field is always eight bytes long, there will be a corresponding gap of this size in the field definition. Internally, this field type is made up of two, four-byte MICRO fields; the first of which is the date, and the second of which is the time. To define a DateTime field in the Data Fields window, start by defining the two, four-byte portions as separate MICRO fields with zero decimals, and name them DATE and TIME. The date portion is actually stored as a number of days. This date format differs from ACL's date format by exactly 2,415,020 days. Therefore, to treat the date properly in ACL, you need to create an expression of the form: `000101`+DATE-2415020 and give it a name for future reference. The time portion is stored as thousandths of a second since midnight. You can determine the hour of the day to two decimal places by dividing the contents of the TIME field by 3,600,000.00 (for example, 7.50 is 7:30 AM, and 14.97 is almost 3 PM). To determine exact hours, minutes, and seconds, do the following: Mainframe Databases KRXUV# #,17+7,0(2693333313333, PLQXWHV# #,17+02'+7,0(/6933333,293333, VHFRQGV# #,17+02'+7,0(/93333,24333, DB2, IMS, and IDMS are examples of popular mainframe databases. You can work with these databases by using one of the following methods: Obtain or write software that provides an appropriate flat file copy or export capability. You can use IMS to produce a more usable file. For DB2 or IMS, consider acquiring ACL for MVS to process data directly on the mainframe. Access output report files in electronic form. Using Report Files 6-8 Almost all computer software generates detailed transaction reports. ACL can read information stored as a printed report. This application is useful when you want to access data stored in a complex database format rather than a flat file. This technique opens up almost any data for independent analysis using ACL.

Obtaining Data to Analyze Chapter 6 The first step in processing a report as data is to capture the information in a disk file. In most minicomputer and mainframe environments this is straightforward because files are typically spooled before printing. You do not have to print the file; just copy the spool file before it is deleted. You usually end up with a fixed length file that has a record length of 133, which is easy to process in ACL. In a non-mainframe environment, it can be slightly more difficult to capture data. If you are in a LAN environment, you can use the LAN spooler in the same way as a mainframe spooler. In a stand-alone environment, you can use a number of public domain, shareware, and inexpensive utilities to save printer text to a disk file. You usually get a variable length CR/LF file, which ACL is able to read. When you process a report file as data, treat it as a special case of a multiple record type file. For more information: See Processing Report Files on page 8-81 in the ACL for Windows User Guide for full details on how to read Report Files. Using Multiple Record Type Files In practice, many files have more than one record type. These multiple record type files can have a record length that is fixed or variable. For more information: See Multiple Record Type Files on page 8-72 in the ACL for Windows User Guide for full details on how to work with this type of file. 6-9

Working With Tape Chapter 7 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, 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 chapter includes: Note: an overview of the components that make up a tape drive system step-by-step instructions you can follow to read data from tape a description of the organization of data on tape If you used ACL for DOS 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, read Tape Drive System Components on page 7-2 to find the best options available 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. 7-1

Chapter 7 Working With Tape 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. The Tape Drive ACL can read data directly from almost all tape formats, including: Note: 1 2" 9-track tapes IBM 3480 cartridges 8 mm tapes 4 mm DAT tapes If you need to read data from 1 4" tapes, contact ACL Technical Support for assistance. Your tape drive must conform to the SCSI (Small Computer System Interface, pronounced scuzzy ) standard to be compatible with ACL. The speed at which you can access data on tape depends on the speed of your tape drive. 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. The 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. 7-2 For 16-bit only, ACL requires a DOS Advanced SCSI Protocol Interface (ASPI) device driver (for example, ASPI4DOS.SYS). ACL does not support WINASPI as a device driver. 32-bit works with WINASPI.

Working With Tape Chapter 7 The 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 whose manufacturer 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. The Connecting Cable The cable connects the tape drive to the computer. To use ACL with tape, you must use a SCSI-compatible cable. 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 your video card) 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. 7-3

Chapter 7 Working With Tape If you have checked these four problem areas and are still having trouble reading tape with ACL, contact ACL Technical Support. Reading Data from Tape 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 (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 labeled or unlabeled. 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. For more information: For details on how data may be organized on tape, see How Data is Organized on Tape on page 7-11. Positioning Tape Before you can access a file on tape, you must position the tape at the start of the file. A re-wound tape is already correctly positioned for reading the first file because ACL automatically accesses the first file on labeled or unlabeled tapes. If you want to access a file other than the first file on the tape, you must know whether you are working with a labeled or unlabeled 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 window. 7-4

Working With Tape Chapter 7 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, type TAPE SKIP 4 in the text box of the Command Log window. To position a labeled tape, specify the number of file marks to skip over in the file you want to access. For more information: On calculating the number of file marks to skip, see How Data is Organized on Tape on page 7-11. Rewinding Tape : 3. If you are not sure whether your tape is positioned at the beginning of the file you want to access, specify Tape SKIP -10 in the text box of the Command Log window. 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. n can be positive (to move forward on the tape) or negative (to move backward). For more information: For more information on using the Command Log window to enter commands, see Command Mode on page 8-38 in the ACL for Windows User Guide. Accelerating Tape Rewind If you are working with a very large data file, you can use the Set Accelerate command 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, type SET ACCELERATE 0 in the text box of the Command Log window. If 7-5

Chapter 7 Working With Tape : the first file you want to read is on a labeled tape, you can skip the tape label by typing SET ACCELERATE 1. 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, type: 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] and 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 appropriate, from the Media Type dropdown 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 the Link Data File function to link an input file definition to a data file on tape. 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. For more information: Follow the instructions in Working with Documents on page 4-1 in the ACL for Windows User Guide to open an existing input file definition for use with data files on tape. 7-6

Working With Tape Chapter 7 Creating an Input File There are two parts to creating a new input file definition for a file on tape: 1. ACL analyzes the file s contents and determines the basic file characteristics. 2. You define the data fields. Selecting a Data File on Tape 1. Open a document, if you have not already done so. 2. Either: Click Input File Definitions in the Overview window and click, or Select Data from the menu bar and choose Select. ACL displays a list of the input file definitions and various other options. Click [New]. ACL displays the Data Source dialog box for you to select Disk, Tape, or ODBC as your data source. 3. Select the Tape radiobutton and click [OK]. ACL displays the Input File Definition window. media type dropdown 4. Select the appropriate media option from the Media Type dropdown. Choose: Tape - One Reel, if the data you want to access is stored on a single tape 7-7

Chapter 7 Working With Tape Note: Tape - Multi Reel, if the data is stored on more than one tape, or if you want to access more than one data set on a single tape using the same input file definition ACL displays the message Are you sure you want to select tape? 5. Click [Yes] to access the tape. ACL opens the tape and automatically displays the first block of data to assist in data definition. If there is no tape drive connected to your computer, or no tape in the drive, ACL displays the message No tape device is responding, tape may not be selected. Make sure you properly connected your tape drive and that there is a tape in the drive. Click [OK] when you are ready, and repeat steps 4 and 5. The Record Length is displayed as one in the Input File Definition window, and the data appears in a single column, because you have not yet analyzed the data. analyze file 6. Click (Analyze file) to analyze the data on tape, just as you do with data on disk. Note: Analysis is automatic with disk-based files, but you must manually analyze files on tape. 7-8

Working With Tape Chapter 7 ACL displays the result of the analysis. 7. To define the data fields, click in the data and follow the detailed steps in Formatting Data Fields on page 4-23 in the ACL for Windows User Guide. Reading Multi-Reel Tapes A file that spans more than one reel of tape or cartridge is called multireel. A file on one reel or cartridge that spans several data sets that have the same field format is also considered to be multi-reel. In this section data set refers to a set of contiguous data. 1. Open a document, if you have not already done so. 2. Either: Click Input File Definitions in the Overview window and click, or Select Data from the menu bar and choose Select. ACL displays a list of the input file definitions and various other options. Click [New]. ACL displays the Locate Data File dialog box with options for identifying the data file and its location. 7-9

Chapter 7 Working With Tape 3. Click [Cancel], because the data file you want to access is not located on your hard disk. 4. Choose Tape - Multi-Reel from the Media Type dropdown. 5. Click to analyze the data, and then click in the data area to define the data fields. Work with the multi-reel tape as you would a single tape reel or cartridge. 6. When you reach the end of each data set, ACL displays the message Is there another Tape volume to process? Click [Yes] to move on to the next reel or cartridge, if there is more data to process. ACL prompts you with the message Please mount next tape and select the number of tape marks to skip. If the next data set you want to read is on a different reel or cartridge, mount the next tape. Either: click [Zero], if the data is on an unlabeled tape, because the tape is already correctly positioned click [One], if the data is on a labeled tape in order to skip the tape label and position the tape at the first file If the next data set you want to read follows the current one on the same tape, leave the tape in the drive and select the number of file marks to skip. Either: click [One] if the data is on an unlabeled tape in order to advance to the next file click [Three] if the data is on a labeled tape in order to skip the two tape labels and advance to the beginning of the next file 7. When you finish reading the last tape or file, ACL displays the message Is there another Tape volume to process? Click [No] in the dialog box. 8. ACL prompts you with the message Please re-mount the first tape and select the number of tape marks to skip. Remount the first tape you accessed, make sure your tape drive is ready, and: click [Zero], if you are working with an unlabeled tape click [One], if the tape is labeled You can continue processing or close the file as you would for a single reel tape. 7-10

Working With Tape Chapter 7 For more information: On skipping tape marks, see How Data is Organized on Tape on page 7-11. Processing a File on Tape When you have accessed a file on tape, you can use almost all ACL commands and functions to process the file in exactly the same manner as with disk-based files. In fact, for most ACL operations, you would not even be aware you were reading tape. The few minor differences are: 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 you process multi-reel tapes, you can only view the first reel you cannot output to tape Closing a File on Tape When you finish working with a file on tape, close it in exactly the same manner as any other file: Note: In the Overview window, click the currently open input file definition or view and click, or In the Command Log window, issue the Close command, or Select Data from the menu bar and choose Select. In the Select Input File Definition dialog box, click [None] and then [Done]. You should always close the file on tape before you close your document or exit from ACL because ACL will attempt to access the last input file in use at the start of your next session. How Data is Organized on Tape 7-11

Chapter 7 Working With 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 labeled or unlabeled. 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(n-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 13 in the Command Log window. 7-12

Sampling in ACL Chapter 8 This chapter covers the different sampling methods available in ACL. It describes the sampling bases you can use to draw a sample, and the characteristics of each of the sampling methods provided by the ACL Sample command. The Sampling Base The sampling base is the unit used to draw the sample. ACL can use one of two sampling bases: Monetary Unit Record Monetary Unit Base A Monetary Unit base uses the absolute value of a field in the record to determine which records are to be selected. When using a Monetary Unit base, the likelihood that a given record will be selected is directly proportional to the size of the item, unless that item is affected by top stratum cutoff. For more information: See Top Stratum Cutoff on page 8-5. Use a Monetary Unit sampling base when you want to express a dollar confidence relating to the given population (for example, that total errors do not exceed $1,000,000). With a Monetary Unit sampling base, the data is treated as a stream of dollars (actually expressed in cents). Each dollar has an equal chance of selection, and when a dollar is selected, the item containing the dollar is output. The population is the absolute value of all the dollars in the file. The interval you specify is the number of dollars between each selection. Given this sampling base, a $1,000 item is 1,000 times more likely to be selected than a $1 item, since a $1,000 item contains 1,000 times as many 8-1

Chapter 8 Sampling in ACL dollars, each of which is equally liable to be selected. This selection method biases the sample towards larger dollar items. Record Sampling A Record base treats each record equally, using a nominal value of 1. This results in a sample which is not biased by being based on the values in a record, so each record has an equal chance of being selected. Use a Record sampling base when you want to express confidence as a percentage relating to the given population (for example, that the error rate does not exceed 3%). With a Record sampling base, the data is treated as a stream of records with each record having an equal chance of selection. The population is the number of records in the file. Given this sampling base, a $1,000 item and a $1 item have an equal chance of being selected, since each item is only one record and each record has an equal chance of selection. Sampling Methods ACL uses one of three different methods for selecting the items in the sample: Fixed Interval Random Interval (or Cell Method) Random You can also use the ACL Sample command to select only a subset of the population to be sampled. For more information: See Conditional Sampling on page 8-7. Note: In the following discussion, the term item refers to either a dollar or record as appropriate for the sampling base selected. 8-2

Sampling in ACL Chapter 8 Fixed Interval Sampling Fixed Interval Sampling is generally the preferred sampling method because it produces the most consistent results. In Fixed Interval Sampling, you specify a selection interval ( i ) and one random number ( r ). The random number must be greater than zero and less than or equal to the selection interval. The data is treated as a stream, and the r th item is the first item to be selected. Thereafter, every i th item is selected. For example, if the selection interval is 1,100 and the random start is 723, item 723 is selected, followed by 1,823, 2,923, 4,023, and so on. With top stratum cutoff (applicable only to Monetary Unit samples), an item greater than the cutoff is automatically selected, without affecting the sampling process. For more information: See Top Stratum Cutoff on page 8-5. When you use Fixed Interval Sampling, you must watch for patterns in the data. Since a fixed interval is used for sample selection, a decidedly non-representative sample can be drawn if the data has a pattern that coincides with the interval you specify. For example, if you re sampling expenses with an interval of $1,000,000, and the monthly expenses being tested are also about $1,000,000, you may also select the same small expense category for every selection, since this category appears at million dollar intervals in the file. (Note that this situation is very uncommon in practice). Note: If you intend to use ACL s Evaluate command to determine the effect of errors in a Monetary Unit sample, you must use Fixed Interval Sampling to get correct results. Random Interval (Cell) Sampling Like Fixed Interval Sampling, Random Interval Sampling is an interval selection method. In Random Interval Sampling, you specify an interval ( i ) and a random seed. Because it is used by ACL only to initiate a series of pseudo-random numbers, the random seed may be any value. When you use Random Interval Sampling, ACL generates one random number for each selection. The data is treated as a stream and broken down into groups of i items. For each group of items, a random number greater than zero and less than or equal to the interval size is generated. This item 8-3

Chapter 8 Sampling in ACL is then selected, and the process is repeated for the next group of items. For example, if the interval is 1,100 and the random seed is 349870322, item 429 may be selected from the first group of 1,100 items, item 1,844 may be selected from the second group, and so on. The main advantage of Random Interval Sampling is that it automatically avoids problems relating to patterns in the data. A disadvantage is that the entries selected in Random Interval Sampling may not be as consistent as Fixed Interval Sampling for Monetary Unit examples. The lack of consistency results from the fact that the dividing point between each group will typically be spanned by an item, which would therefore appear in two different groups for sampling purposes. One implication of this is that the same entry may be selected twice. As well, large items (less than the top stratum cutoff) have a slightly reduced chance of being selected. As an example, consider a worst case scenario in which you have an interval of 100 and a $99 item that exactly straddles the border between two groups. Depending on the random numbers chosen, the $99 item may not be selected in either of the two groups. In fact, there is about a 25% chance the item will not be chosen at all. Normally, the item will not be missed if it falls mostly into one group. The example here shows you one of the possible implications of random interval sampling. Random Sampling Random Sampling is the least preferred sampling method. In Random Sampling, you specify the population size ( p ), the number of items to select ( n ), and a random seed. ACL uses the random seed to initialize a random number generator. It then produces n numbers between zero and p, and sorts the numbers in ascending order. ACL will not generate the same random number twice. If more than one random number of the same value is generated, they are discarded and replaced by new ones. Remember that for Monetary Unit samples, the item selected is actually a cent and not a dollar, so it is quite unlikely that any numbers in a Monetary Unit sample will be discarded. The implication of this is that Record Sampling will never select the same record twice, but Monetary Unit Sampling may select the same record more than once. 8-4 Once the list of selections has been established, ACL selects those specific items. For example, if the population is 1,000, the sample size is 5, and the random seed is 9084633983, ACL might generate the numbers 244, 261, 339, 874, and 985. These specific items would then be selected.

Sampling in ACL Chapter 8 If you use Random Sampling, you should know that, while each item has an equal chance of selection, there is no guarantee that the results will be evenly distributed. In the example above, there is a gap between 339 and 874 of more than 500 items from which no selections were made. An equivalent Fixed Interval sample would have ensured that no gap exceeded 200. There is also no top stratum cutoff in Random Sampling. If our example were a Monetary Unit sample, it would be possible for one item representing over half the file to not be selected at all if it fell in the gap noted above. Because, in Monetary Unit samples, there is no way to prevent selection numbers that are close (as opposed to the same ), the same entry may be selected more than once, or even many times. The result of these implications is that Random Sampling is generally the least suitable sampling method, but it is available if you need to use it. Top Stratum Cutoff Top stratum cutoff relates only to Monetary Unit samples that use one of the two Interval sampling methods. When a Monetary Unit Interval sample is selected, ACL automatically (before sampling) stratifies the population into a top stratum and a bottom stratum, based on the absolute value of the field. Items equal to or exceeding the cutoff value are automatically selected and not subject to the sampling algorithm. The effect is as if the data were separated into two files; one file for each stratum. Items in the top stratum are selected immediately. The selection process is then applied only to the bottom stratum as if the larger amounts were not in the file. By default, the cutoff for a Monetary Unit Interval sample is the size of the interval. This means that, rather than merely having a high chance of selection (which in most cases equals 1), the item is guaranteed to be selected. If this is not what you want, you can enter a value in the Cutoff text box of the Sample dialog box to separate the top and bottom strata. To remove top stratum cutoff, simply specify an arbitrarily large cutoff value so that none of the items in the population will fall into the top stratum. For example, if you were sampling with an interval of $1,000,000, all items with an absolute value equal to or greater than $1,000,000 would be in the top stratum and automatically selected. If, in the Sample dialog box, you entered 833333 ($500,000) in the Cutoff text box, an item with a value of $500,000 would fall in the top stratum and be automatically selected, even 8-5

Chapter 8 Sampling in ACL though its chance of selection would have only been 50% using the sampling algorithm. Similarly, if you specified 43333333 ($10,000,000) in the Cutoff text box, an item with a value of $5,000,000 would fall in the bottom stratum and have a proportionate chance of selection. While the probabilities may never exceed 1 because this item s value is 5 times the interval, its chance of selection would nominally be 5, indicating that it will likely be selected 5 times. Note: Modifications to the top stratum cutoff should only be made by specialists experienced in the technical theories relating to statistical sampling. Replacement and Noreplacement Because ACL never selects the same record twice in Record Sampling, Replacement, and Noreplacement are only relevant in Monetary Unit Sampling. For Monetary Unit samples, ACL always samples with Replacement. This means that ACL automatically places records back in the stream to be sampled again (for example, when another dollar in the same amount is selected). You cannot cancel Replacement. Depending on the sampling method chosen, the same record may be selected more than once. If one of the entries was selected more than once, a sample of 20 items may actually represent a smaller number of records. Note that this is generally only significant when a relatively large proportion of the population is included in the sample. Depending on your application, Replacement may or may not be of concern to you. You have two options: If Replacement is of concern, click the [More] tab in the Sample dialog box and check the No Repeats checkbox. Specifying No Repeats does not actually sample without replacement, but rather causes the extra printing of the same record to be suppressed. In other words, your sample size is fulfilled, but only unique records appear in the output sample file. If this method yields a result that has less samples than you desired, your best approach is to oversample by selecting a few extra items to compensate for the duplicates which are likely to be encountered. 8-6

Sampling in ACL Chapter 8 Note: Oversampling is only likely to be an issue when you perform a Random Monetary Unit sample. If Replacement is not of concern, do not check the No Repeats checkbox. Your sample size will be fulfilled, but you may have duplicate items in your output sample file. A fixed interval sample with the default top stratum cutoff will never select the same item twice as a result of the sampling method used. Subsampling In some cases, one record in the file actually represents a number of separate transactions, such as the posting totals from an accounts payable subsystem. In this situation, you may want to test only one of the constituent parts. If this is what you require, click the [More] tab in the Sample dialog box and check the Subsample checkbox. Specifying Subsample causes ACL to display the actual dollar (cent) selected along with the other information. For example, if the selected amount was $12,455, the actual dollar selected might be the 4,620th dollar of this amount. Specifying Subsample causes the $4,620 to be output as well, so that additional sampling can be performed. Conditional Sampling ACL also has the ability to subject only a portion of the population to selection. There are two common situations where you may want to do this conditional sampling: You may want to limit the scope of the selections. For example, you may have a file that relates to an entire entity, but only want to examine one portion of it, such as Department 13. In this case, you can add the condition IF DEPT= 13 to the sample to limit the scope of the selection. You may also want to ignore certain types of transactions, such as postings from AP. In this case, you could specify a test, such as IF SOURCE<> AP. You may want to exclude items with specific values from being selected, such as credit amounts. Many sampling approaches recognize that Monetary Unit Sampling can only test for 8-7

Chapter 8 Sampling in ACL Note: overstatement, and so exclude items that reduce the value being tested. In this case, you could specify a test, such as IF AMOUNT>0. When you use a condition to restrict the items to be sampled, you effectively reduce the size of the population. A sampling method that relies on the size of the population must be adjusted accordingly. Examples of Sampling <----Dollar Unit------> <--------Record--------> Fixed Cell Random Fixed Cell Random Interval 10 10 N/A 5 5 N/A Start 4 2 Random seed 1234 1234 1234 1234 # of sel. N/A N/A 10 N/A N/A 3 Pop. 100 100 100 16 16 16 Line# $ Accum. 1 5 5 x 5 x 5 x 5 1 x 1 1 2 3 8 3 3 3 x 1 1 x 1 3 6 14 x 6 2 x 6 1 1 1 4 4 2 16 2 2 x 2 1 1 1 5-4 20 4 x 4 4 1 1 x 1 6 1 21 1 1 1 1 1 1 7 12 33 t t 12 x 1 1 1 8 7 40 x 7 7 x 7 1 1 1 9 4 44 4 x 2 x 4 1 x 1 1 x 2 10 2 46 x 2 2 2 1 1 1 11 1 47 1 1 1 1 1 1 12 4 51 4 4 4 x 1 x 1 1 13 33 84 t t xxx33 1 1 1 14 6 90 x 6 x 15 x 6 1 1 x 1 15 9 99 x 9 54 x 9 1 1 1 16 1 100 1 1 1 1 x 1 1 --- $100 absolute value 16 items Where: x represents a selection t represents a top stratum item, also selected the first two numeric columns represent the amount of each line in the file and the accumulated dollar total to that point for each of the selection types, the amount subjected to sampling is shown in the column 8-8

Sampling in ACL Chapter 8 for the cell method samples, the amounts included in each group are shown in alternating bold text arbitrary random numbers have been chosen for random selections Monetary Unit Samples Fixed Interval Cell Method (Random Interval) Random Since the starting value is 4 with an interval of 10, the 4th, 14th, 24th, and so on dollars are selected. Line 1 includes the 4th dollar, and so is selected. The 14th dollar is included in line 3, where the accumulated total has reached 14 (5+3+6). The third selection is from line 8 because the total is 28 (5+3+6+2+4+1+7). Note that line 7 is not included in the sample because it is top stratum and, therefore, automatically reported. The interval is 10, so the dollars in the file are broken into groups of $10. The first group contains the $5 from line 1, the $3 from line 2, and $2 of the $6 from line 3. Assume that one of the first $5 is chosen. The second group contains the $4 remainder of line 3, the $2 from line 4, and the $4 from line 5. Again, we re assuming that one of the last $4 in that group was chosen. Notice that on line 9, the $4 item is selected twice because a portion of the item falls into each group. Also notice that the $9 item in line 15 is not selected even though it is quite large. This is because the amount is spread across two groups, and neither portion is selected. We ve assumed that the 10 random values between 1 and 100 are: 4, 13, 15, 37, 42, 56, 59, 80, 89, and 93. The $12 item on line 7 is not selected, even though it was considered top stratum by the previous 2 samples. The $33 item is selected 3 times because of the range of dollars it covers. Record Samples Because Record Sampling treats each record equally, the amount to be sampled is 1 for all samples. Also, larger items are no more likely to be selected than smaller ones. Fixed Interval Line 2 is selected because the random start is 2. Because the interval is 5, every 5th record thereafter is selected (in this case, records 7 and 12). 8-9

Chapter 8 Sampling in ACL Cell Method (Random Interval) Random Notice that the records are grouped into sets of 5 records. We ve assumed that the following records were chosen: The 1st record in the 1st group. The 4th record in the 2nd group. The 2nd record in the 3rd group. The 1st record in the 4th group. This method has generated one more selection than in the Fixed Interval method, due to the chance selection of the first record in the last group. We ve assumed that the three random values (between 1 and 16) were 2, 5, and 14. 8-10

Glossary Chapter 9 This section contains an alphabetical list of ACL terms and their meanings. More information 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. 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 9-6. Age The number of days between two specified dates. You can calculate the age of a transaction 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 9-11. 9-1

Chapter 9 Glossary 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 9-5. 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 document. 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. 9-2

Glossary Chapter 9 Character A letter, digit, or other symbol used as part of the representation of data. 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 document until you close the document. The information in the log is cumulative. You can view, add comments to, print, or clear the log. 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 9-13. Condition A test that returns a true or false value. Conditional Field A field whose value is not always available. Usually associated with multiple record type files. Constants Any date, numeric, string, or logical value that does not change as ACL processes a record. 9-3

Chapter 9 Glossary 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 Macintoshcompatible 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 document, but rather is linked to the document by way of the input file definition. ACL does not alter the data file in any way. Data Types See Field Types on page 9-7. 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 document is opened. 9-4

Glossary Chapter 9 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. Document 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 document, but is linked to the document by way of the input file definition. The document file name uses the extension.acl. Temporary documents use the extension.acl. See also Input File Definition on page 9-10. 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 9-2. 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. 9-5

Chapter 9 Glossary 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 consequently as part of the document. Ad hoc, unnamed expressions can only be used for a single calculation and are not saved as part of the input file definition. See also Computed Field on page 9-3, Extract on page 9-6, Filter on page 9-7, Global Filter on page 9-8, and Local Filter on page 9-11. 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 9-14. 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. 9-6

Glossary Chapter 9 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 9-8. 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 9-8 and Local Filter on page 9-11. 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 9-15. 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. 9-7

Chapter 9 Glossary 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 9-7. 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. See also File History on page 9-7. 9-8

Glossary Chapter 9 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 9-15. 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 9-4 and Input File Definition on page 9-10. 9-9

Chapter 9 Glossary Input File Definition Describes the structure, contents, and layout of a data file and links the data file to the document. 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 9-2. 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 fields 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 9-10. 9-10

Glossary Chapter 9 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 9-7 and Global Filter on page 9-8. 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 document 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. 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 9-1. 9-11

Chapter 9 Glossary 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 9-8. 9-12

Glossary Chapter 9 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 9-15. Operators Mathematical symbols used in building expressions. The operators in ACL include: () - ^ * / + < > = >= <= <> NOT AND & OR See also Expression on page 9-6. 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 9-3. 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 9-15. Random Seed The starting value for random record sampling. See also Record Sampling on page 9-14. 9-13

Chapter 9 Glossary 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. See also Field on page 9-6. 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. 9-14

Glossary Chapter 9 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 operations. See also Primary File on page 9-13. 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. 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. 9-15

Chapter 9 Glossary 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 document. 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 9-3. 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 9-15. White Space The white area surrounding text. ACL uses the available white space in a report to ensure that your data is fully displayed. 9-16

Glossary Chapter 9 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. 9-17

IIndex A ABS( )ýý4-11 Absolute valueýý4-11 Accept commandýý2-1ñý2-48 ACCPAC field typeýý3-2 ACL field typeýý3-2 ACL for DOS, converting fromýý5-1 ACL utilities programýý5-1 Activate commandýý2-6 Add Columnsýý2-39ñý2-43 Advanced SCSI Protocol Interfaceýý7-2 Age commandýý2-9 AGE( )ýý4-12 Append To Fileýý1-16ñý1-17 AS/400, converting files for use in ACLýý5-12 ASCII DUMP file/recordýý2-58 field typeýý3-2 using the FIND() function to locate ASCII charactersýý4-33 ASCII ZONED data formatýý4-82 ASCII( )ýý4-13 ASPIýý7-2 Assign commandýý2-13 AT( )ýý4-14 Automatic field definitionýý6-7 Automatic Profiles preferenceýý2-138 B Bar graph, Histogramýý2-91 BASIC field typeýý3-3 Batch converting from DOSýý5-2 definition ofýý1-4 Dialog Builderýý2-48 testing field typeýý4-35 usingýý1-4 using to enter commandsýý1-4 BINARY field typeýý3-3 BIT( )ýý4-17 Bit/Character functions, summary ofýý4-3 Blank Detail Linesýý2-156 Blank fieldsýý2-35 BYTE( )ýý4-19 C Calculate commandýý2-16 Cell samplingýý2-164ñý8-3 CHR( )ýý4-20 Classify commandýý2-19 CLEAN( )ýý4-21 Close commandýý2-23 COBOL OCCURS clausesýý4-56 COBOL field type COBOL DISPLAYýý3-10 COMPUTATIONAL-1ýý3-3 COMPUTATIONAL-3ýý3-9 PIC S9(n)ýý3-11 COBOL PICTURE clauseýý3-2 COBOL, converting filesýý5-9 Command lineýý2-126ñý2-152 command logýý2-46 graphable dataýý1-18ñý2-96 parametersýý2-2ñý2-4ñý2-31ñý2-45 Command Logýý1-3 Command parameters in command modeýý1-19 in dialog boxesýý1-12ñý1-13 Index - 1

summaryýý1-12 Commands Acceptýý2-1 Activateýý2-6 Ageýý2-9 Assignýý2-13 Calculateýý2-16 Classifyýý2-19 Closeýý2-23 Commentýý2-25 Countýý2-28 Define Fieldýý2-31 Define Relationýý2-34 Define Reportýý2-44 Deleteýý2-45 Delete Historyýý2-45 Dialogýý2-48 Displayýý2-50 Do Batchýý2-53 Do Reportýý2-57 Dumpýý2-58 Duplicatesýý2-60 Elseýý2-61 Endýý2-63 Evaluateýý2-64ñý2-203 Exportýý2-71 Extractýý2-74 File Historyýý2-79 Findýý2-81 Gapsýý2-83 Groupýý2-84 Helpýý2-89 Histogramýý2-91 Ifýý2-99 Importýý2-100 Indexýý2-102 issuingýý1-2 Joinýý2-108 Listýý2-118 Locateýý2-122 Loopýý2-124 Mergeýý2-126 Openýý2-130 Passwordýý2-135 Pauseýý2-136 Profileýý2-138 Quitýý2-142 Randomýý2-143 Refreshýý2-147 Renameýý2-149 Reportýý2-152 Sampleýý2-162 Saveýý2-177 Searchýý2-179 Seekýý2-185 Sequenceýý2-187 Setýý2-195 Sizeýý2-203 Sortýý2-213 Statisticsýý2-218 Stratifyýý2-224 Summarizeýý2-232 summary ofýý1-6ñý1-12 Topýý2-237 Totalýý2-238 Verifyýý2-242 Commands, issuingýý1-2 using batches and groupsýý1-4 using button barýý1-2 using menusýý1-2 Comment commandýý2-25 COMPUTATIONAL-1 data typeýý3-3ñý5-11 COMPUTATIONAL-3 data typeýý3-9ñý5-11 Conditional samplingýý8-7 Conditionsýý1-9ñý2-99 Conventions bulleted listsýý1-6 numbered listsýý1-6 numbers and bulletsýý1-6 text formattingýý1-5 Conversion functions, summary ofýý4-4 Converting AS/400 filesýý5-12 Index - 2

COBOL filesýý5-9 data using ACLýý2-71 from ACL for DOSýý5-1 from DOS messagesýý5-3 SAP filesýý5-14 Count commandýý2-28 CR filesýý6-5 CR/LF filesýý6-5 CSVýý6-5 CTOD( )ýý4-22 CUSTOM field typeýý3-3 D Data downloadingýý6-3 obtaining from mainframe databasesýý6-8 obtaining from mainframe or minicomputerýý6-2 obtaining from personal computerýý6-2 obtaining from tapeýý6-4 obtaining from Xbase databasesýý6-7 translating concernsýý6-2 verifyingýý2-242 Data file how to accessýý6-1 preparation ofýý6-1 types ofýý6-4 Data types, see Field types Databases, mainframeýý6-8 Date and time functions, summary ofýý4-4 DATE field typeýý3-5 Date Fieldsýý2-35 DATE( )ýý4-24 Datesýý4-12 DB2 databaseýý6-8 dbase compatible productsýý6-7 defining DateTime fieldsýý6-8 input filesýý6-7 DEC DIBOL field typeýý3-11 DEC VAX Type D floating point dataýý3-11 DEC( )ýý4-25 Define Field commandýý2-31 Define Relation commandýý2-34 Define Report commandýý2-44 Delete commandýý2-45 Delete History commandýý2-45 Delimited file comma separated values (CSV)ýý6-5 overviewýý6-5 tab separated values (TSV)ýý6-5 usingýý6-5 Dialog Boxes Edit view filterýý4-34 Dialog Builderýý2-48 Dialog commandýý2-48 DIGIT( )ýý4-26 Display commandýý2-50 Do Batch commandýý2-53 Do Report commandýý2-57 Documentation options Comment commandýý2-25 DOS files conversion messagesýý5-3 convertingýý5-1 converting to ACL for Windowsýý5-7 using converted batch filesýý5-6 using converted filesýý5-5 using converted format filesýý5-6 using converted report filesýý5-7 DOW( )ýý4-27 Downloading dataýý6-3 Dump commandýý2-58 Duplicates commandýý2-60 Duplicates testingýý2-187 E EBCDIC DUMP file/recordýý2-58 field typeýý3-6 Index - 3

EBCDIC characters using the FIND() function to locateýý4-33 EBCDIC( )ýý4-28 Edit view filter dialog boxýý4-34 EFFECTIVE( )ýý4-29 Else commandýý2-61 End commandýý2-63 Evaluate commandýý2-64ñý2-203 EXCLUDE( )ýý4-30 EXP( )ýý4-31 Export commandýý2-71 Expression Builderýý2-36ñý2-39 using FIND() inýý4-33 Expressionsýý2-35ñý2-36 Extract commandýý2-74 F FDFýý5-12 Field definitionýý6-7 Field types ACCPACýý3-2 ACLýý3-2 ASCIIýý3-2 BASICýý3-3 BINARYýý3-3 corresponding data typesýý3-1 CUSTOMýý3-3 DATEýý3-5 EBCDICýý3-6 FLOATýý3-6 HALFBYTEýý3-6 IBMFLOATýý3-7 LOGICALýý3-7 MICROýý3-8 NUMERICýý3-8 PACKEDýý3-9ñý4-57 PCASCIIýý3-9 PRINTýý3-10 summary ofýý3-1 UNISYSýý3-10 UNSIGNEDýý3-11 VAXFLOATýý3-11 ZONEDýý3-11 Fields synonymsýý3-1 File History commandýý2-79 Files accessing files on personal computerýý6-2 accessing mainframe filesýý6-2 CRýý6-5 CR/LFýý6-5 dataýý6-4 Delimitedýý6-5 file preparationýý6-1 fixed lengthýý6-4 flatýý6-1 LFýý6-5 multiple record typeýý6-9 proprietary variable lengthýý6-6 reportýý6-8 variable length (IBM)ýý6-6 FILESIZE( )ýý4-32 Financial functionsýý4-2 FIND ( )ýý4-33 Find commandýý2-81 Finding a string of characters in a file using the FIND() function toýý4-33 FIXED BINARY field typeýý3-3 FIXED DECIMAL field typeýý3-9 Fixed interval samplingýý2-164ñý8-2 Fixed length filesýý6-4 Flat filesýý6-1 FLOAT field typeýý3-6 Fontsýý2-153ñý2-154 Foreign-language charactersýý3-3 FTYPE( )ýý4-35 Functions ABS( )ýý4-11 AGE( )ýý4-12 ASCII( )ýý4-13 Index - 4

AT( )ýý4-14 BIT( )ýý4-17 BYTE( )ýý4-19 CHR( )ýý4-20 CLEAN( )ýý4-21 CTOD( )ýý4-22 DATE( )ýý4-24 DEC( )ýý4-25 DIGIT( )ýý4-26 DOW( )ýý4-27 EBCDIC( )ýý4-28 EFFECTIVE( )ýý4-29 EXCLUDE( )ýý4-30 EXP( )ýý4-31 FILESIZE( )ýý4-32 financialýý4-2 FIND( )ýý4-33 FTYPE( )ýý4-35 FVANNUITY( )ýý4-37 FVLUMPSUM( )ýý4-39 HEX( )ýý4-40 INCLUDE( )ýý4-41 INT( )ýý4-42 LENGTH( )ýý4-43 LOG( )ýý4-44 LOWER( )ýý4-45 LTRIM( )ýý4-46 MASK( )ýý4-47 MATCH( )ýý4-48 MAXIMUM( )ýý4-50 MINIMUM( )ýý4-51 MOD( )ýý4-52 NOMINAL( )ýý4-53 NPER( )ýý4-55 OFFSET( )ýý4-56 PACKED( )ýý4-57 PMT( )ýý4-58 PROPER( )ýý4-59 PVANNUITY( )ýý4-60 PVLUMPSUM( )ýý4-61 RAND( )ýý4-62 RATE( )ýý4-63 RECLEN( )ýý4-65 RECNO( )ýý4-66 REMOVE( )ýý4-67 RND( )ýý4-62 ROOT( )ýý4-68 ROUND( )ýý4-69 SHIFT( )ýý4-70 SOUNDEX( )ýý4-71 SOUNDSLIKE( )ýý4-72 STRING( )ýý4-73 SUB( )ýý4-74 SUBSTRING( )ýý4-74 summary ofýý4-3 syntax conventionýý4-8 TEST( )ýý4-75 TIME( )ýý4-76 TRIM( )ýý4-77 UNSIGNED( )ýý4-78 UPPER( )ýý4-79 VALUE( )ýý4-80 VERIFY( )ýý4-81 ZONED( )ýý4-82 FVANNUITY( )ýý4-37 FVLUMPSUM( )ýý4-39 G Gaps commandýý2-83 Gaps testingýý2-189 Generating random numbersýý2-143 Graph Output Option recognizing graphable dataýý1-18ñý2-96 Graphs (see HISTOGRAM)ýý2-91 Group commandýý2-84 usingýý1-4 using to enter commandsýý1-4 H HALFBYTE field typeýý3-6 Hardware conflictsýý7-3 Index - 5

Help commandýý2-89 HEX( )ýý4-40 Hexadecimal DUMP file/recordýý2-58 Histogram commandýý2-91 I IBM SMF filesýý4-56 IBM ZONED DECIMAL field typeýý3-11 IBMFLOAT field typeýý3-7 IDMS databaseýý6-8 IEEEýý3-3 If commandýý2-99 If conditionýý2-99 Import commandýý2-100 IMS databaseýý6-8 INCLUDE( )ýý4-41 Index commandýý2-102 creating using a filterýý2-103 Index file/fieldýý2-35ñý2-37ñý2-38ñý2-39ñý2-41 Indexing useful tipsýý2-104 Infinite loops, controllingýý2-124 Input File Definitionýý2-37 Institute of Electrical and Electronic Engineersýý3-3 INT( )ýý4-42 INTEGER dataýý3-8 IRMA cardýý6-3 Issuing commands using batches and groupsýý1-4 using menusýý1-2 using the button barýý1-2 J Join commandýý2-34ñý2-108 Julian datesýý3-5 K Key fieldýý2-60ñý2-83 L LENGTH( )ýý4-43 LF filesýý6-5 List commandýý2-118 Locate commandýý2-122 Locate data file on multi-reel tapeýý7-9 Log Fileýý1-3 LOG( )ýý4-44 LOGICAL field typeýý3-7 Logical Fieldsýý2-35 Logical functions, summary ofýý4-5 LONG dataýý3-8 Loop commandýý2-124 LOWER( )ýý4-45 LTRIM( )ýý4-46 M Mainframe computer, obtaining data fromýý6-2 Manual special symbols inýý1-4 MASK( )ýý4-47 MATCH( )ýý4-48 Mathematical functions, summary ofýý4-5 MAXIMUM( )ýý4-50 Merge commandýý2-126 MICRO field typeýý3-8 Minicomputer, obtaining data fromýý6-2 MINIMUM( )ýý4-51 Miscellaneous functions, summary ofýý4-6 MOD( )ýý4-52 Modify Columnýý2-156ñý2-157 Monetary sampling, evaluating errorsýý2-64ñý2-66 Monetary unit sampling Index - 6

determining MUS sampling sizeýý2-205 types ofýý2-162 More buttonýý1-12ñý1-13 N NOMINAL( )ýý4-53 Non-standard characters in CUSTOM fieldsýý3-3 NPER( )ýý4-55 NUMERIC field typeýý3-8 O OFFSET( )ýý4-56 OPENýý2-130 Open commandýý2-40ñý2-130 Oversampleýý2-165 P PACKED DECIMAL field typeýý3-9 PACKED( )ýý4-57 Parent Fileýý2-35ñý2-36ñý2-38 Password commandýý2-135 Pause commandýý2-136 PCASCII field typeýý3-9 Personal computer, obtaining data fromýý6-2 PMT( )ýý4-58 Poisson distribution in sampling errorsýý2-65 Primary Fileýý2-35ñý2-36ñý2-38 PRINT field typeýý3-10 Profile commandýý2-138 PROPER( )ýý4-59 Proprietary variable length filesýý6-6 PVANNUITY( )ýý4-60 PVLUMPSUM( )ýý4-61 Q Quit commandýý2-142 R RAND( )ýý4-62 Random commandýý2-143 Random samplingýý2-165ñý8-4 RATE( )ýý4-63 RECLEN( )ýý4-65 RECNO( )ýý4-66 Record samplingýý2-162 determining sample sizesýý2-206 evaluating errorsýý2-65 RECORD sampling baseýý8-2 Refresh commandýý2-147 REMOVE( )ýý4-67 Rename commandýý2-149 Replacement, in samplingýý8-6 Report commandýý2-152 Report files capturingýý6-9 usingýý6-8 Reports converting from DOSýý5-2 ROOT( )ýý4-68 ROUND( )ýý4-69 S Sample Oversampleýý2-165 Selection order numberýý2-165 Sample commandýý2-162 Sampling approaches toýý2-163 biasýý2-163 cell methodýý8-3 conditionalýý8-7 determining sample sizeýý2-203 fixed intervalýý8-2 monetary unitýý8-1 monetary unit samplingýý2-162 noreplacementýý8-6 Index - 7

randomýý8-4 random intervalýý8-3 record samplingýý2-162 RECORD sampling baseýý8-2 replacementýý8-6 sampling bases explainedýý8-1 selection methodsýý2-164 subsamplingýý8-7 top stratum cutoffýý8-5 SAP files, converting to ACL for Windowsýý5-14 Save commandýý2-177 SCSIýý7-2 SCSI termination concernsýý7-3 Search commandýý2-179 Seek commandýý2-185 Sequence commandýý2-187 Set commandýý2-195 SHIFT( )ýý4-70 Size commandýý2-203 SKIP Dumpýý2-58 Small Computer System Interface (SCSI)ýý7-2 Sort commandýý2-213 sorting vs. classifying and summarizingýý2-214 SOUNDEX( )ýý4-71 SOUNDSLIKE( )ýý4-72 Square rootýý4-68 Statistics commandýý2-218 Stratify commandýý2-224 String access functions, summary ofýý4-7 STRING( )ýý4-73 SUB( )ýý4-74 SUBSAMPLE option in samplingýý8-7 SUBSTRING( )ýý4-74 Summarize commandýý2-232 Support for ACL productsýý1-22 Suppress Blank Detail Linesýý2-156 T Tainting in samplesýý2-203 Tape drive acquiringýý7-1 components ofýý7-2 controller cardýý7-3 device driverýý7-2 Technical supportýý1-22 Terminal emulationýý6-3 TEST( )ýý4-75 TIME( )ýý4-76 Top commandýý2-237 Top stratum cutoffýý8-5 Total commandýý2-238 Translating dataýý6-2 TRIM( )ýý4-77 TSVýý6-5 U UNISYS field typeýý3-7ñý3-10 filesýý3-6 half byte aligned dataýý3-11 PACKED fieldsýý3-10 unsigned dataýý3-10 UNSIGNED field typeýý3-7ñý3-11 Unsigned PACKED dataýý3-11 UNSIGNED( )ýý4-78 UPPER( )ýý4-79 V Validity of data testing forýý2-242 Verify commandýý2-242 VERIFY( )ýý4-81 VALUE( )ýý4-80 Variable length files overviewýý6-6 Index - 8

proprietaryýý6-6 Variablesýý2-48ñý2-99 assigning a value toýý2-13 VAXFLOAT field typeýý3-11 Verify commandýý2-242 VERIFY( )ýý4-81 View using FIND() inýý4-33 W Workspaces activatingýý2-6 converting from DOSýý5-2 savingýý2-177 X xbaseýý6-7 Z ZONED field typeýý3-11 ZONED( )ýý4-82 Index - 9