All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means (photocopying, electronic, mechanical, recording, or otherwise), without permission in writing from the publisher, except by a reviewer who may quote brief passages in a review. This manual may contain dated information. Use of these materials is based on the understanding that this manual may not contain all the information, or the most current information relevant to situation or intended application. Support and update services are available from ACL, by separate written agreement. Published May 2002 by: ACL Services Ltd. 1550 Alberni Street Vancouver, BC Canada V6G 1A5 Telephone: +1-604-669-4225 Fax: +1-604-669-3562 E-mail: [email protected] Web: www.acl.com For use with ACL for Windows Version 7.0 Printed in Canada 9 8 7 6 5 4 3 2 1 ISBN 1-894497-17 ACL and Audit Command Language are registered trademarks of ACL, or one of its subsidiaries or licensors. Microsoft, Windows, the Windows logo, and Windows NT are registered trademarks of Microsoft Corporation. SAP is a trademark of SAP AG. Other brands or products referenced in the software, or associated with it, are the trademarks or registered trademarks of their respective holders, and should be treated as such. Use of a term in this manual should not be regarded as affecting the validity of any trademark or service mark. iii
Contents About this Workbook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Installing ACL for Windows Workbook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Module 1: Welcome to ACL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Accessing and Downloading Data ........................................................... 8 Understanding How Computers Represent Data ............................ 8 Accessing a Data File ......................................................................... 9 Types of Data ACL Reads ............................................................... 11 Fixed-Point Arithmetic .......................................................................... 14 Fixed-Point Numbers ..................................................................... 14 Fixed-Point Arithmetic ................................................................... 14 Rounding in Calculations ............................................................... 14 Getting Started with ACL ....................................................................... 16 ACL Application Screen ................................................................. 17 Working with Menus ...................................................................... 17 Button Bar ....................................................................................... 18 Status Bar ......................................................................................... 21 Application Workspace .................................................................. 21 Working with Windows ................................................................. 22 Working with Dialog Boxes ............................................................ 27 Module 2: ACL Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Understanding ACL Projects ................................................................. 30 Naming ACL Files ........................................................................... 30 Creating, Opening, and Closing Projects ....................................... 32 Input File Definitions ............................................................................. 34 Creating an Input File Definition Using the Data Definition Wizard ............................................................................................. 34 Defining Data Fields Without the Wizard ..................................... 40 Defining Data Fields ....................................................................... 42 Editing Input File Definitions ......................................................... 47 Exiting ACL ..................................................................................... 49 Interpreting Dates .................................................................................. 50 Defining Date Fields ....................................................................... 50 iv Contents Selecting Dates ................................................................................ 52 Displaying Dates ............................................................................. 53 Overview Window ................................................................................. 57 Working with the Overview Window ............................................ 58 View Window ........................................................................................ 63 Working with the View .................................................................. 63 Customizing the View .................................................................... 65 Command Log ....................................................................................... 79 Opening Your Project .................................................................... 79 Command Log Window ................................................................ 79 Reissuing Commands ..................................................................... 84 Searching the Log ........................................................................... 85 Documenting Your Work ..................................................................... 86 Making Notes ................................................................................. 86 Copying and Pasting Text to a Note .............................................. 88 Printing Logs, Histories, and Notes ............................................... 89 Module 3: Understanding Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 Verifying Data ........................................................................................ 94 Using the Verify Command .......................................................... 94 Counting Records .................................................................................. 97 Using the Count Command ........................................................... 97 Totaling Fields ....................................................................................... 99 Obtaining Statistics ............................................................................... 102 Displaying Statistics ....................................................................... 102 Profiling ................................................................................................. 104 Profiling a Field ............................................................................. 104 Testing for Sequences, Duplicates, and Gaps ...................................... 107 Testing the Field Sequence ............................................................ 107 Testing for Duplicates ................................................................... 108 Testing for Gaps ............................................................................ 110 Testing Duplicates and Gaps Together ......................................... 111 Module 4: Manipulating Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 Extracting Data ..................................................................................... 114 Exporting Data ...................................................................................... 123 What is Exporting Data? ............................................................... 123 Exporting All Fields ....................................................................... 123 Exporting Selected Fields .............................................................. 126 Contents v
Exporting to Other Applications .................................................. 127 Sorting and Indexing ............................................................................ 129 Control Totals ............................................................................... 129 Using the Sort Command ............................................................. 130 Using the Index Command .......................................................... 137 Summarizing and Classifying .............................................................. 143 Using the Classify Command ....................................................... 143 Using the Summarize Command ................................................. 146 Stratifying Data ..................................................................................... 150 Stratifying Data ............................................................................. 150 Aging Data ............................................................................................ 156 Aging Date Fields .......................................................................... 156 Joining, Relating, and Merging Data ................................................... 164 Joining Data Files .......................................................................... 164 Creating Relationships .................................................................. 171 Merging Data Files ........................................................................ 178 Sample, Size, and Evaluate ................................................................... 180 Preparing Your File for Sampling ................................................. 180 Sampling Methods ........................................................................ 182 Monetary Unit Sampling ............................................................. 183 Record Sampling ........................................................................... 190 Using Functions ................................................................................... 197 Using the Find( ) Function .......................................................... 197 Generating Confirmation Letters ......................................................... 201 Generating Confirmation Letters ................................................. 201 The Benford Command ....................................................................... 215 Module 5: Creating Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 Using Expressions ................................................................................ 224 What is an Expression? ................................................................. 224 Creating Expressions .................................................................... 224 Working with Filters ..................................................................... 229 Deleting a Named Expression ...................................................... 235 Using Batches ...................................................................................... 237 What is a Batch? ............................................................................ 237 Creating a Batch ........................................................................... 238 Editing a Batch .............................................................................. 246 Running a Batch ........................................................................... 247 Using Interactive Batches ............................................................. 249 vi Contents Groups and Loops in Batches ............................................................... 252 Using Groups ................................................................................. 252 Creating Groups ............................................................................ 252 Using Loop .................................................................................... 264 Working with Multiple-Record-Type Files ......................................... 265 Reading Report Files ..................................................................... 266 Processing Multiple-Record-Type Files ............................................... 276 Module 6: Communicating Results . . . . . . . . . . . . . . . . . . . . . . . . . . 289 Formatting Reports ............................................................................... 290 Using the View to Create a Report ............................................... 290 Previewing the Report .................................................................. 294 Saving the Formatted View ........................................................... 298 Graphing Command Results ................................................................ 307 Setting Graph Output .................................................................... 307 Displaying a Histogram ................................................................. 307 The Notify Command ........................................................................... 323 Using the Notify Command .......................................................... 323 Module 7: Customizing ACL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327 Setting Preferences ................................................................................ 328 Selecting Options ........................................................................... 328 Interface Options ........................................................................... 330 Input File Options ......................................................................... 331 View Options ................................................................................. 333 Command Options ....................................................................... 335 Date Options ................................................................................. 337 Numeric Options .......................................................................... 339 Print Options ................................................................................. 341 Application Font Options ............................................................. 342 Module 8: Troubleshooting Data Errors . . . . . . . . . . . . . . . . . . . . . 343 Troubleshooting Data Errors ............................................................... 344 Data Errors .................................................................................... 344 Module 9: Using the Dialog Builder . . . . . . . . . . . . . . . . . . . . . . . . . 361 Designing Batches Using the Dialog Builder ....................................... 362 Planning a Batch Dialog Box ......................................................... 362 Creating a Batch Dialog Box ......................................................... 362 Editing an Existing Dialog ............................................................. 372 Contents vii
1 About this Workbook Welcome to the ACL for Windows Workbook, your personal guide to the worlds leading data analysis software. The ACL for Windows Workbook is a self-study guide. Whether you are new to data analysis or already have some experience with ACL, it will help you to master ACL for Windows and apply it to real-world problems. By applying ACLs powerful features, you will be more efficient and confident in your analysis. Here are a few features ACL offers: Ease of use Built-in audit and data analysis functionality Interactive interrogation capabilities Unlimited file size capability Ability to read multiple data types High quality reporting features If you are new to ACL, start at Lesson 1.1. Intermediate or advanced users can go directly to lessons for a specific application or function. This books hands-on, interactive approach makes it easy to quickly gain a working knowledge of the software. To help you realize the potential of ACL software, the CD-ROM included with this workbook contains a fully functional, educational version of ACL for Windows Version 7 that allows you to process up to 48 K of data. You can also use the data in this workbook in conjunction with the commercial version of the software. The ACL for Windows Workbook is provided to licensed users of ACL. To purchase additional copies, visit www.acl.com. For those seeking more in-depth advice on data analysis, Global Audit Publications (GAP) offers a range of books. A complete list of ACL user publications and GAP publications is available from our Head Office at +1-604-669-4225 or www.acl.com. 2 ACL for Windows 7 Related Publications ACL for Windows User Guide The user guide will help you start using ACL for Windows Version 7. It shows you how to: Read or import data from external source data files View, analyze, and report on data Automate custom analytical routines Use ACL for Windows together with ACL for OS/390 in a client/server environment The ACL for Windows User Guide is provided to licensed users of ACL. To purchase additional copies, visit www.acl.com. ACL for Windows Reference Manual The reference manual is a companion document that provides detailed information on: ACL field types ACL functions ACL commands The ACL for Windows Reference Manual is provided to licensed users of ACL. To purchase additional copies, visit www.acl.com. Need Help? Resources For assistance in using ACL, refer to these additional resources: ACL for Windows User Guide ACL for Windows Reference Manual ACL for Windows online Help Your companys internal ACL technical support center, if available
About this Workbook 3 Contacting Us If you can not find the solution to your problem and you are a supported user, you can contact ACL for assistance. Before contacting ACL, be sure you have the following infor- mation: Your ACL serial number. You can find this on the back of your CD case, or in ACL for Windows, select Help from the menu bar and choose About ACL. The type of hardware you are using, and whether it is connected to a Local Area Network (LAN). A description of what happened, and what you were doing when the problem occurred. The error message, if any, displayed by ACL. Online Support Center If you have access to the World Wide Web, go to www.acl.com and click the Online Support Center. There you will find helpful tools and resources to enhance your use of ACL. Global Help Desk The Americas Phone: +1-604-669-4997 Fax: +1-604-689-4209 E-mail: [email protected] Europe, Middle East, and Africa Phone: +32-2-642-22-90 Fax: +32-2-642-22-91 E-mail: [email protected] Asia and Pacific Rim Phone: +65-299-3350 Fax: +65-299-5110 E-mail: [email protected] 4 ACL for Windows 7 Wed Like to Hear From You! ACL is committed to providing you with quality products and services for data access, analysis, and reporting. To ensure your continued satisfaction, we welcome your sugges- tions for improvements to ACL for Windows, our user documentation, and online Help. Please send your comments to our Product Management team at: Phone: +1-604-669-4225 Fax: +1-604-669-3557 E-mail: [email protected] You can also send mail to: ACL Services Ltd. 1550 Alberni Street Vancouver, BC Canada V6G 1A5
5 Installing ACL for Windows Workbook The ACL for Windows Version 7 Workbook is intended for use with ACL for Windows Version 7.0. Later versions of the software may contain functionality not addressed in this publication. If you do not have ACL for Windows Version 7 installed on your system, then you must install it and the ACL for Windows Version 7 Workbook software from the CD-ROM included with this workbook. System Requirements ACL for Windows Version 7 Workbook requires the following: IBM 486 or higher personal computer (Pentium recommended) Eight megabytes of RAM minimum (32 megabytes recommended) At least seven megabytes of free space on a hard disk drive for storing the ACL program and all related files (significantly more disk space is recommended for storing your working files) Windows 95/98/ME, or Windows NT 4.0/2000 Installing the Workbook Data Files Only If you already have ACL for Windows Version 7 loaded on your system, you need to install only the Workbook data files. To install or reinstall only the working files (the sample data files used in the Workbook lessons) on your personal computer: 1. Close all programs. 2. Insert the CD into the CD-ROM drive. The installation program informs you of the progress and prompts for required information. 3. In the Setup Type dialog box, select Custom. Note: You must have administrator rights to install on a system running Windows NT or Windows 2000. 6 ACL for Windows 7 4. In the Select Components dialog box, select only the Workbook Data Files check box. Continue to follow the prompts to place the data folder in the desired location. Installing the Complete Workbook To install the program (48K limited version) and sample data files for ACL for Windows Version 7 Workbook on your personal computer: 1. Close all programs. 2. Insert the CD into the CD-ROM drive and follow the prompts for the type of instal- lation you want. 3. Select either Typical or Custom installation. The installation program informs you of the progress and prompts you for required information. Typical The Typical option is best for most users. The Typical installation installs all the necessary files and options on your computers hard disk. Select the Typical option unless you have specific reasons to choose another option. Custom The Custom option is for advanced users who want to install only specific compo- nents. If you select the Custom option, ACL displays an additional dialog box for you to select the components you want. Starting the ACL for Windows Workbook Program After you install ACL for Windows Version 7 Workbook, you can begin using the program. To start ACL for Windows Version 7 Workbook from the Windows desktop: 1. Click [Start] and select Programs. 2. From the Programs menu, select ACL for Windows Version 7.0 Workbook. The program starts and ACL displays the application screen. You are now ready to use ACL for Windows Version 7 Workbook. 7 Module 1 WELCOME TO ACL In Module 1, you are introduced to the basics of ACL and what you need to start using this workbook. You find out: About data, records, fields, and data files About fixed-point arithmetic How to start ACL, and how to work with the application screen, button bar, and windows 8 ACL for Windows 7 Workbook Accessi ng and Downl oadi ng Data Lesson 1.1 Accessing and Downloading Data You can use ACL to work with modern relational databases, as well as traditional legacy data storage systems. With legacy systems, where the programs originally used to create and process the data are not current, ACL gives you the ability to access the data. ACL can access data in diverse formats and on various types of storage devices. You can use ACL to verify the output from other applications if you do not have confidence in the data or suspect that an application is not functioning correctly. Use ACL for Windows to view, explore, and analyze all data and report on the results. Understanding How Computers Represent Data Data, in its simplest form, is stored with each character held in a byte. The value of the byte determines the character it represents. There are two main coding schemes that map the value of the byte to each specific character. EBCDIC Extended Binary Coded Decimal Interchange Code. This format is commonly found only on IBM mainframe and mid-range computers. ASCII American Standard Code for Information Interchange. This format is typically found on most personal computers and some mid-range and mainframe computers. In addition to EBCDIC and ASCII, ACL can read all numeric and date data types. You do not have to translate the data. In fact, ACL eliminates the risk of errors that may occur during the translation process. What is a Data File? The data you want to analyze can come from a mainframe, minicomputer, or PC. It can vary in record structure and data type, and can be on tape, disk, or another storage device. Computerized data is stored in units called data files. What is a Record? Data files contain smaller units, called records. Each record offers a complete set of data about a topic. For example, the name, address, and telephone number on one line in a telephone book could be combined to form a single record. There can be a great number of records in a file, just as there are possibly millions of records in a telephone directory. What is a Flat File? Each record in a data file may be either fixed or variable length, and the file may contain either single or multiple record types. These files are often referred to as flat files. Flat file
Module 1 Welcome to ACL 9 Accessi ng and Downl oadi ng Data is a lay term for a file that does not have a complex file structure such as in a database file. flat files are physically sequential in nature. Although it is not essential that you use Flat files when working with ACL, it is recom- mended. If your data is in a database, you should extract the data into a flat file format before you download or copy to tape. The exception is if you have ACL for OS/390, which can easily read common databases such as DB2 and IMS. What is a Field? Each record contains individual pieces of information called fields. In the telephone directory example, each entry (record) consists of details about a person, such as their last name, first name, address, and telephone number. In ACL, each of these data items is stored in a field. All records in a file are described by the same set of fields. Computer files can have many fields for each record. Each field has a name for reference. For example, the field names might be LASTNAME, FIRSTNAME, ADDRESS, and PHONE. Accessing a Data File The first step in obtaining a data file is identifying the sources of data. Identifying Sources of Data Files Data files stored on a minicomputer or a mainframe must be downloaded so that they can be accessed by a personal computer. The most common methods of obtaining data stored on a mini or mainframe computer include linking from a personal computer or a local area network (LAN) to a mainframe, or storing the information on tapes and cartridges. Most mini and mainframe computer manufacturers offer a way to connect a PC to their equipment, thus allowing the transfer of data files. If you are using a PC to access the mainframe, then you likely have the means to download or transfer data files through this link. As mentioned earlier, you should not need to translate the data to ASCII on download, as ACL is compatible with all major data types and is able to read your data. Make sure that you have enough space on your PCs hard disk or network drive to store the file that you want to download. In some cases, you will need a significant amount of space. Ask your computer department or equivalent what options are available to you. For most installations, downloading from mini or mainframe computers to PC or LAN will be the most common. 10 ACL for Windows 7 Workbook Accessi ng and Downl oadi ng Data Working with Your Computer Department Before downloading data from a mini or mainframe computer, it is important to do some initial planning to identify where the data is available and in what format. The first step is to speak with your computer department and request file layouts for the system. These may be called record definitions, data dictionaries, schemas, or a variety of other names, but they simply list all the fields of data held in a file for a particular system. The next step is to review the data, with or without file layouts, to determine all available fields in a system. This can be done by examining the available data on screen and in reports. Often a system may appear to have a particular field, but in practice the field is not actually used. Also, there are often various codes and conventions that users must learn. Examining file layouts, reports, and screen dumps should provide enough detail to easily identify what data is available in which files and what is required for a specific analysis. Preparing the Data File Before downloading the data, it is sometimes necessary to prepare the data. If all the data in a specific file is required and the file is in a format that ACL can read directly, then you can transfer the file of data in its native form to the PC. All the data may not be required for a very large file. In such cases, it is best to request assistance from your computer department to create an extract program. The extract program will create a smaller file with only those fields of data required for an analysis. For database files such as DB2, IMS, and IDMS, you will again require your computer department to provide an appropriate flat file copy of the database. Lastly, you can always access output report files in electronic form because almost all computer software generates detailed transaction reports. ACL can read information stored as a printed report. This technique is useful when you want to access data stored in a complex database format rather than a flat file because it opens up almost any data for independent analysis using ACL. The first step in processing a report as data is capturing the information in a disk file. In most mini and mainframe computer 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 ACL can process easily. If you plan to download spooled report files, ask your computer department to copy the required files to permanent disk files for you to download.
Module 1 Welcome to ACL 11 Accessi ng and Downl oadi ng Data Downloading the Data File to a PC, Network Server, or Tape When downloading data from a mini or mainframe computer via terminal emulation, the PC emulates a terminal on the mainframe or minicomputer with special terminal emulation software. Packages such as IBMs Personal Communications and PC3270, PC Support/400, IRMA, and Rumba provide such terminal emulation for PCs as well as an appropriate file transfer component for downloading files. Some downloading software will attempt to convert data from a mini or mainframe computer representation, such as EBCDIC, to one of those used on a PC, such as ASCII. Other packages often assume all data is text and, as a consequence, will corrupt any numbers. In these cases, it is best to download without any conversion options (sometimes called binary transfers) and to keep the original method of storing the data. ACL Conversion Utility ACL for Windows contains a conversion utility that allows you to convert certain types of files for use in ACL. This feature is located in the ACL for Windows Version 7 sublist of the Windows Start menu. You can also convert some file types using the Data Definition Wizard. For more information, see Appendix A: Using the ACL Utility in the ACL for Windows Reference Manual or online Help. Types of Data ACL Reads ACL reads the following types of data: Flat sequential dBASE (extension .dbf) Text (extension .txt) Delimited Print ODBC Tape Flat Sequential Flat sequential data files contain rows of consecutive data, arranged one after the other. Like the lines of information that are divided into sections in a telephone book, flat sequential files have rows of data, divided into fields. For example, one field might be the last name, another field the first name, and so on. 12 ACL for Windows 7 Workbook Accessi ng and Downl oadi ng Data dBASE ACL automatically detects, analyzes, and then creates an input file definition for dBASE files. This is also true for dBASE files created by dBASE compatible products, such as FoxPro TM , Visual FoxPro TM , and Clipper TM . ACL does not read associated files, such as index or memo files. When you select a dBASE file to define, the Data Definition Wizard automatically deter- mines the character set, classifies the file format as a dBASE compatible file, and defines the fields. Text A text data file contains only printable characters, such as the letters a through z, the numbers 1 through 9, and punctuation. Text files may or may not be print files. Delimited Many data files contain fields that do not have a fixed position in a record. Files in which each field is separated from the others by a field separator character are called delimited files. When you select a delimited file, the Wizard automatically determines the character set, classifies the file format as Delimited, and also determines the Field Separator and Text Qualifier. The Wizard then prompts you to save the data file as a flat file and to also name the fields. A carriage return and a line feed separate each record in a delimited file. Fields are usually separated by commas and character strings are enclosed in quotes. Print Files Print files are text files in the form of a printed report. They may also contain non-data lines such as headers, subheaders, blank lines, and total lines that ACL can filter when reading the print file. ODBC The term ODBC stands for open database connectivity a standardized application programming interface (API) technology that allows different applications to connect to and read each others data files. Developers can create ODBC-enabled applications (also known as ODBC-compliant or ODBC client applications). They can also write ODBC drivers for specific database management systems (data sources). ODBC technology gives developers and users an important tool for heterogeneous data source access. Prior to ODBC, applications were limited to the proprietary interface specific to the data source. Heterogeneous data source access was possible only by
Module 1 Welcome to ACL 13 Accessi ng and Downl oadi ng Data hard-coding applications to handle each specific data source. Such applications were difficult to code, burdensome to maintain, and complicated to extend. ODBC increases application portability by eliminating the need for data source-specific calls. ODBC-enabled applications can simultaneously access, view, and modify data from data sources, regardless of whether the source is object-oriented, ISAM, or plain text. Using ODBC, proprietary databases are now open to third-party applications and tools. For example, ODBC technology gives ACL for Windows complete access to Microsoft Access databases, even though the two systems are products of two different vendors. Although many ODBC supporters claim that ODBC enables better performance and faster data retrieval than SQL statements or the native database API, this is not generally true. The specific implementation of either technology, as well as the compatibility between the ODBC-enabled application implementation and the ODBC driver imple- mentation determines how performance is affected. See Lesson 2.2: Input File Definitions on page 34 and Appendix B: ODBC Access for more details on accessing ODBC files. Tape You can use ACL to easily access and read data from tape reels or cartridges. Accessing a file on tape similar to processing the file with disk-based files. ACL quickly reads untranslated data (do not use a back up copy), and your data remains on tape. ACL can read data from almost all types of tape, including inch 9-track tapes, IBM 3480 cartridges, 8mm tape, and 4mm DAT. For PC versions of ACL, you must attach the appropriate tape drive to your personal computer to use this method. 1 14 ACL for Windows 7 Workbook Fi xed-Poi nt Ari thmeti c Lesson 1.2 Fixed-Point Arithmetic ACL uses fixed-point arithmetic for its numeric operations for two reasons: It improves processing speed It gives you control over decimal numbers and rounding Fixed-Point Numbers ACL calculates fixed-point numbers exactly as they are stored. For example, if you specify two decimals when you define a field, ACL stores 1.11 as exactly 1.11, but it stores 1.1199 as 1.12. If you fix the number of decimals at four, ACL stores 1.1111 as 1.1111 but it stores 1.11119999 as 1.1112. You specify the number of decimal places for a field when you define it. And in a condi- tional computed field, the default value that you specify establishes the number of decimal places for the result. Fixed-Point Arithmetic Fixed-point arithmetic affects your calculations in the following ways: ACL provides exact results in calculations involving addition and subtraction, but it rounds at every stage of calculations involving multiplication and division. Results and intermediate calculations cannot exceed 22 digits, including decimals. When you use two values in an arithmetical operation, ACL rounds to the larger number of decimals of the two operands. This method is applied at the lowest level in any calculation and is repeated until the expression is evaluated. Consider the floating-point result you obtain when you divide 1000 by 177 then multiply by 3 (1000/177 * 3) on a calculator: 16.949152. If you use ACL to perform the same calculation, the fixed-point result is 0.18. Rounding in Calculations ACL rounds at every stage of calculations involving multiplication and division. To compensate for rounding, you can increase the number of decimal places or you can rearrange the equation. ACL uses the larger number of decimals in the first two values to determine rounding of the result. You can control the number of decimals in the result by using the same number of decimals in the first two values of an equation as you want for the result. By
Module 1 Welcome to ACL 15 Fi xed-Poi nt Ari thmeti c placing the values with the greatest number of decimal places first in your equation, you obtain the correct number of decimals in your result. Examples In the following example, ACL rounds to a whole number in stage one (1000 / 177) because both operands (1000 and 177) are whole numbers. In stage two (6 / 3), ACL again rounds to a whole number because the results of stage one (6) and the denominator (3) are both whole numbers. 1000 / 177 * 3 = 18 In the next example, ACL again rounds to a whole number in stage one (1000 / 177) because both operands (1000 and 177) are whole numbers. In stage two (6 / 3.00), ACL rounds to two decimals because the larger number of decimals of the two operands (6 and 3.00) is two. 1000 / 177 * 3.00 = 18.00 In the next example, ACL rounds to two places in stage one (1000 / 177.00) because 177.00 has the larger number of decimals of the two operands. Then, in stage two (5.65 * 3), ACL rounds to two decimals because the larger number of decimals of the two operands (5.65 and 3) is two. (1000 / 177.00 * 3) = 16.95 In the next example, ACL rounds to four places in stage one (1000 / 177.0000) because 177.0000 has the larger number of decimals of the two operands. Then, in stage two (5.6497 * 3), ACL again rounds to four decimals because the larger number of decimals of the two operands (5.6497 and 3) is four. (1000 / 177.0000 * 3) = 16.9491 In the next example, ACL rounds to a whole number in stage one (1000 * 3) because both operands are whole numbers. Then, in stage two (333 / 177), ACL again rounds to a whole number because both operands (333 and 177) are whole numbers. (1000 * 3 / 177) = 17 In the last example, ACL rounds to two decimal places in stage one (1000 * 3.00) because 3.00 has the larger number of decimals of the two operands. Then, in stage two (333.33 / 177), ACL again rounds to two decimals because the larger number of decimals of the two operands (333.33 and 177) is two. (1000 * 3.00 / 177) = 16.95 1 16 ACL for Windows 7 Workbook Getti ng Started wi th ACL Lesson 1.3 Getting Started with ACL To use this workbook, you must first install ACL for Windows Version 7 Workbook, which provides everything you need to understand the descriptions and complete the step-by-step procedures. To install ACL, follow the steps described in Installing ACL for Windows Workbook on page 5. As you work through the lessons, you add to existing files and create new files. Therefore, be sure to reinstall the data files so each new user starts with the data in its original form. See Installing the Workbook Data Files Only on page 5. To start ACL for Windows Version 7 Workbook: 1. Click [Start] and select Programs. 2. From the Programs menu, select ACL for Windows Version 7 Workbook.
Module 1 Welcome to ACL 17 Getti ng Started wi th ACL ACL Application Screen ACL displays the application screen below each time you start ACL:
Working with Menus The menu bar contains the nine menu choices in ACL: Each menu has a drop-down list of commands and options. A menu or menu item is grayed out if a command doesnt apply to the active window. Title bar Menu bar Button bar Status bar Application Workspace 18 ACL for Windows 7 Workbook Getti ng Started wi th ACL Using Menus to Select and Choose Options To select a menu choice from the menu bar: 1. Click a menu choice, such as File. ACL displays a drop-down menu of choices. For example, the File drop-down menu looks like this: As you move the mouse pointer down the menu, each menu choice is highlighted. To choose a command or option from the list: 1. Position your mouse pointer over one of the choices. 2. Click the left mouse button. ACL displays the command or option dialog box or window for you to select, change, or enter information. To close the drop-down list without making a choice, move the pointer off the menu and click the left mouse button. Button Bar The button bar provides fast access to commonly used commands and options. You can customize the number and order of icons in the button bar to suit your needs. Pointing to a Button To point to a button on the button bar, use your mouse to position your pointer over one of the ACL buttons. If you have the Show Tooltips preference selected, as it is by default, ACL displays a message showing the buttons name. To use a button, position the pointer over a button and click the left mouse button. ACL displays a dialog box or window where you select, change, or enter information.
Module 1 Welcome to ACL 19 Getti ng Started wi th ACL Default Button Bar ACL provides a default button bar to give you fast access to the most commonly used commands and options. The default button bar includes: You can add, delete, and rearrange all of these buttons to suit your individual needs. If you customize your button bar, it will not appear as shown above. The following reference chart describes the actions performed by the buttons on the default button bar: Button Quick Reference Chart Button Action Option or Command Displays the Save New Project As dialog box, allowing you to name and save a new ACL Project. Create a New Project Displays the Locate Project File dialog box, allowing you to open an existing ACL Project. Open an Existing Project Saves the current ACL Project. Save the Open Project Prints the contents of the active window. Print Active Window Allows you to add notes about an ACL Project Edit Project Note Allows you to undo the last operation performed. Undo Last Operation Displays the Overview window. Overview Displays the command log. Edit file definition Displays options for totaling numeric fields. The result is stored in a variable. Total Displays options for analyzing numeric fields, and displaying a variety of statistical information. The results are stored in variables. Statistics Displays options for extracting data. Extract Displays options for producing aged summaries of data. Age 20 ACL for Windows 7 Workbook Getti ng Started wi th ACL Customizing the Default Button Bar You can customize the default button bar by including any of the buttons you can access from menus, in any order, and with alternate spacing, until it best suits your needs. You do not need to have an ACL Project open to customize the button bar. To customize the button bar: Click the (Customize Button Bar) button, or select Tools from the menu bar and choose Customize Button Bar. To add a new button to the button bar: 1. Select Insert (it is selected by default). 2. Select Menu Item (it is also selected by default). 3. Click the command you want to add to the button bar from the appropriate drop-down menu. The icon associated with that command will be displayed. 4. Click the spot in the button bar where you want to display the button. Displays options for stratifying numeric data. Stratify Displays options for classifying data based on the value of character fields. Classify Displays options for testing for duplicate key field records. Duplicates Displays options for rearranging a file into a new physical record sequence. Sort Displays options for customizing the default button bar. Customize button bar Displays options for finding information. Help Button Action Option or Command
Module 1 Welcome to ACL 21 Getti ng Started wi th ACL To add a blank space to the button bar: 1. Select Insert option (it is selected by default). 2. Select Blank. 3. Click the spot in the button bar where you want to add the blank. To exchange a button on the button bar: 1. Select Replace. 2. Select Menu Item. Click the command you want to add to the button bar from the appropriate drop-down menu. The icon associated with that command will be displayed. 3. Click the spot on the button bar you want to replace with the button or blank. To remove a button from the button bar 1. Select Delete. 2. Click the button or blank you want to delete. ACL removes the button or blank and adjusts the buttons accordingly. 3. Click [OK] to save your changes. For more information, see Customizing the Button Bar on page 308 in the ACL for Windows User Guide or online Help. Status Bar The status bar displays the name of the Project with which you are working, the name of the currently open input file, and the number of records in that file. When you first start ACL, you can see from the status bar that no Project is open and no input file is in use. The Data, Analyze, Sampling, and Window menus are grayed out because there is no current data to analyze. Application Workspace The application workspace is the area where you work with your data. This area is blank until you open a data file. 22 ACL for Windows 7 Workbook Getti ng Started wi th ACL Working with Windows This section describes how you can manage windows to work with ACL more quickly and effectively. Moving Windows You can move windows on the screen to best suit your needs. For example, you can move a window that appears in front of text with which you are working. To move a window: 1. Move the mouse pointer to the windows title bar. 2. Press and hold down the left mouse button. 3. Move the window by moving the mouse. Resizing Windows ACL restores windows to the display settings you specified the last time you used an ACL Project. To maximize the size of a window: Click (Maximize) at the top, right corner of the window To minimize the size of a window: Click (Minimize) at the top, right corner of the window To adjust the size of a window: 1. Move the pointer to the outer edge or a corner of the window. The pointer becomes a double-headed arrow. 2. Press and hold the left mouse button and drag the window edge or corner in or out to the size you want. 3. Release the mouse button.
Module 1 Welcome to ACL 23 Getti ng Started wi th ACL The following picture shows samples of maximized, resized, and minimized windows: Note that the top, right buttons of each window change to reflect whether they are resized or maximized. Buttons in Windows When you resize a window containing buttons, ACL rearranges these buttons to fit in the available space. If the window becomes too small for the buttons to display vertically, ACL wraps the buttons in multiple columns. Maximized window Resized window Minimized window Buttons wrap to fit in the window. 24 ACL for Windows 7 Workbook Getti ng Started wi th ACL Scrolling in Windows When there are too many fields (columns) or records in the file to display on a single screen, you can scroll the view to see additional fields or records. To scroll the view horizontally: Click the right or left horizontal arrow button to move across one or more characters at a time. Click to the right of the horizontal scroll button to move across one or more fields at a time. Continue clicking until you have viewed all the fields. The horizontal scroll button should now be at the far right end of the scroll bar. You can also click to the left of the horizontal scroll button to move to the far left end of the scroll bar, moving across one or more fields at a time. Click the horizontal scroll button and drag it. The scroll button lets you quickly access the first or last column, or a column in between. To scroll the view vertically: Click the bottom vertical arrow button to move down one record at a time. Click the top vertical arrow button to move up one record at a time. Click below the scroll button in the vertical scroll bar to move down one screen of records at a time. Click above the scroll button to move up one screen of records at a time. Click the vertical scroll button and drag it. The scroll button lets you quickly access the first or last record, or a record in between. When you have reached the last record, the message End of File is displayed below that record. Using Text Boxes and List Boxes In most text boxes and list boxes in ACL, the scroll bar function will become active if there is more data contained in the box than can be displayed. You then use the scroll bars to view all the data, as described in Scrolling in Windows on page 24.
Module 1 Welcome to ACL 25 Getti ng Started wi th ACL In some text boxes, such as in the command log, when you enter information in the command text box, ACL expands the text box to display the entire entry. List view Scroll bar Text box List box Scroll bar Scroll bar Command text box 26 ACL for Windows 7 Workbook Getti ng Started wi th ACL Using List Views List views make it much easier to identify fields for analysis when field names are cryptic, and when there are a number of similar fields to choose from. This is particu- larly common when ACL automatically creates input file definitions from relational databases or Enterprise Resource Planning (ERP) systems, where encoded or hard-to-understand field names often have alternate titles that are more user-friendly. In addition to the field name, list views have columns that show the alternate field title, data type, field type, and other field characteristics. The order of the columns can also be rearranged to suit the needs of the user. List views support the following Windows behaviors: Click an item to select it and use an arrow button to move it to the accompanying list box. Double-click an item to select it and move it to the accompanying list box. Press CTRL+CLICK to select multiple individual items or press SHIFT+CLICK to select a block of neighboring items. Use the scroll bar to view all of the list. Click column headings to change the order of the columns. The changes apply to all subsequent list views. Click and drag column borders to change column width. Click and drag column titles to change order of columns. Click item name to select a single item. Press CTRL+CLICK to select multiple individual items or press SHIFT+CLICK to select a block of neighboring items. Use the scroll bars to move through the list horizontally and vertically, to see all of the field properties information. Click column headings to change column sort order Click and drag to resize columns Click and drag a column title to move it; you can arrange the columns in any order
Module 1 Welcome to ACL 27 Getti ng Started wi th ACL Working with Dialog Boxes Dialog boxes open when you make choices on the application screen that require more information. For example, the Count command displays a typical dialog box: Dialog boxes can be moved using the same techniques used for windows. To close a dialog box: Click a button that carries out the action you have begun, for example, [Save], [Open], or [OK]. Click [Cancel] to cancel the action. Click to close the dialog box. This will also cancel the action begun. Exiting ACL When you finish working with ACL, you should exit the program. To exit ACL from the application window: Click , or select File from the menu bar and choose Exit. Title bar Click to create an expression using the Expression Builder Click to execute the command Or, enter an expression directly in the text box Click to display additional options Click to cancel the command and close the dialog box Click to display online Help 28 ACL for Windows 7 Workbook Getti ng Started wi th ACL 29 Module 2 ACL FUNDAMENTALS In Module 2, you learn the fundamentals of ACL. You learn how to: Create an ACL Project and an input file definition Work with dates Manage the Overview and View windows Use the command log Make notes in the Project, input file definition, and view Print documentation and views 30 ACL for Windows 7 Workbook Understandi ng ACL Proj ects Lesson 2.1 Understanding ACL Projects ACL for Windows keeps track of your work in a file called a Project. The ACL Project is like a container or folder that contains items you create during data analysis. It also maintains links to other related files. The source data file is not part of the Project file, but is linked to it through the input file definition. ACL Project files have the extension .acl. An ACL Project file contains one or more input file definitions, views, batches, and workspaces. Input file definitions (IFDs) describe the record layout of the data file and let you define the fields ACL will examine. A Project can have several input file definitions linked to various source data files. Views are used to display all or some of the data, and to create ad hoc reports. You can create multiple views of a source data file. Batches. ACL has numerous predefined commands that you can use to analyze data or to create new computed data fields. Commands can be run individually or grouped together in a batch to run as a single application. Workspaces make it easier to share complex calculations between different files. The ACL Index command creates an index file containing pointers that allow ACL to read data in the sorted order, even though the records in the orgininal input file are unsorted. ACL Projects give you a way to organize your data analysis. Each Project file stores the input file definitions, views, workspaces, and batches you created for a specific Project. You can reuse these items the next time you need to analyze the same kinds of data. ACL even remembers the files you were working with, and the arrangement of windows on your screen. The next time you use the Project, you can start at the exact point you left off the last time you used ACL. Naming ACL Files When you name files in ACL for Windows, you can use up to 255 characters, including spaces. This allows you to give the files descriptive names so they are easily recognizable. Special characters, such as spaces, are converted to underscores. These long names are visible when you are working in ACL. You must always use an alpha character as the first character of a name.
Module 2 ACL Fundamentals 31 Understandi ng ACL Proj ects The output data file name has the extension .fil. For file management purposes, 32-bit file names are retained. 0100011 0101101 0001110 1010101 0101001 1010101 Data files are outside the ACL Project. ACL is read-only and cannot change the source data. Input file definitions describe the record layout of the data and let you define the fields ACL will work with Views display data and act as templates for printed reports Index files let you access data files as though they were physically sorted Workspaces let you share field definitions among input files and other ACL Projects Batches let you automate repetitive queries, perform complex analysis, and create custom applications The Command Log is like a flight recorder, keeping a complete record of your work Index files are outside the ACL Project. Source Data Files .DAT .DBF .TXT .FIL Other ACL Index for Source Data Files .INX Are linked to Are linked to Views Input file definitions Workspaces Batches ACL Command Log .LOG ACL Project .ACL Indexes 32 ACL for Windows 7 Workbook Understandi ng ACL Proj ects Creating, Opening, and Closing Projects When you first start ACL, the status bar on the ACL application screen indicates that there is no Project open and no input file in use. Before you can work with data in ACL, you must open or create a Project. To create a Project, you need to: name the Project, specify where to store it on your hard disk, identify a data file that contains the data you want to work with, and create an input file definition that contains the format for the data. To create a Project: 1. Select File from the menu bar and choose New Project. ACL displays the Save New Project As dialog box. 2. Double-click the Workbook Data Files folder to put your Project in the same folder as the data files. 3. Enter Newwork in the File name text box. You may also select a different drive or folder from the Save in drop-down list. 4. Click [Save] to create the new Project. ACL automatically adds the extension .acl to the file name and displays the Select Input File Definition dialog box. Once you have created and saved a Project, you can quickly open it using the File menu. ACL will list previously-opened Projects, to a maximum of eight Projects, at the bottom of the File menu. Click the name of the Project you want to open. Note: The default setting in Windows is to hide file extensions. While using this workbook, we suggest changing the setting to display file extensions, as the workbook has been created with file extensions displayed. For more information on file extensions, please consult your Windows user manual.
Module 2 ACL Fundamentals 33 Understandi ng ACL Proj ects If the name of the Project you want to open is not displayed, select File from the menu bar and choose Open Project. To close a Project, select File from the menu bar and choose Close Project. To create an input file definition, see Creating an Input File Definition Using the Data Definition Wizard on page 34. 2 34 ACL for Windows 7 Workbook I nput Fi l e Defi ni ti ons Lesson 2.2 Input File Definitions An input file definition is a format used to describe the structure and content of a data file. ACL uses the input file definition to read the data in the file without changing the original data file. The input file definition includes field names and data types, along with information such as where each field starts and the length of each field. The term input file describes the contents of a data file, as viewed through its associated input file definition. Before you create an input file definition, it is a good idea to get a copy or printout of the file layout and a screen print of the first 50 or so records. You can use this information as a reference when you define the data fields and create your input file definition. The easiest way to create an input file definition is to use the Data Definition Wizard. It is also possible to exit the Wizard and carry out all the steps yourself. Later on, you may need to edit your input file definition. All three processes are covered in this lesson. Creating an Input File Definition Using the Data Definition Wizard The Wizard can greatly simplify the process of creating an input file definition. For this exercise, use Inventory from the Workbook Data Files. The Wizard defines most of the files that you work with as easily as it defines this one. If you need more information than what the Wizard offers, you can turn to online Help for further assistance. This lesson presents a brief example of creating an input file definition using a single-record-type file. To create an input file definition: 1. Open the Workbook Project. 2. Select Data from the menu bar and choose Select to display the Select Input File Definition dialog box. Note: ODBC and dBASE files contain information about the file structure that allows ACL to automatically create an input file definition.
Module 2 ACL Fundamentals 35 I nput Fi l e Defi ni ti ons 3. In the Select Input File Definition dialog box, click [New]. ACL displays the Welcome screen of the Wizard. Click [Next]. 4. ACL displays the Select Data Source screen and sets the Disk option button by default. Notice the blue box at left showing the five main steps of the Wizard process. Completed steps are checked off. Click [Next]. 36 ACL for Windows 7 Workbook I nput Fi l e Defi ni ti ons 5. ACL searches for data on the computer hard drive or network disks. The Select File to Define dialog box appears. Select the data file you want to use by clicking the file name. For this exercise, choose Inventory.fil. The file name appears in the File name text box. Click [Open]. 6. The Character Set screen appears with the option button set to ASCII. Notice that the Select Data step in the list at left has been checked off. Click [Next].
Module 2 ACL Fundamentals 37 I nput Fi l e Defi ni ti ons 7. The File Format screen appears with the option button set to Other file format. Click [Next]. 8. The File Properties screen appears with the option button set to Fixed Length. Click [Next]. 38 ACL for Windows 7 Workbook I nput Fi l e Defi ni ti ons 9. The File Type screen appears with the option button set to Data File (Single Record Type). Click [Next]. 10. The Identify Fields screen appears. The Wizard tries to identify all the fields. You can create, delete, or move the field separators as needed. Click [Next].
Module 2 ACL Fundamentals 39 I nput Fi l e Defi ni ti ons 11. The Edit Field Properties screen appears. You can use this screen of the Wizard to modify the field names and field properties as required. For example, a field containing dates was defined as an ASCII field for generating reports, but you want to analyze the field for aging. To use the field this way, you need to change it from an ASCII field to a date field. You can change field types by selecting the type that you need from the Type drop-down list. Similarly, you can keep original field names for easier communication with the data provider. But for report purposes, you might prefer a more descriptive name. You can make NUMERIC1, for example, appear in your report as Product Number by entering the alternate title in the Column Title text box. Edit each field in turn, then click [Next] to continue. 40 ACL for Windows 7 Workbook I nput Fi l e Defi ni ti ons 12. The Final screen appears. You can click [Back] to alter previous steps or click [Finish] to exit the Wizard. 13. ACL prompts you to save the input file as Inventory. Click [OK] to return to the view, which now displays the newly defined data, ready for your analysis. Defining Data Fields Without the Wizard It is possible to create new data fields without using the Data Definition Wizard. In this example you will use the Newwork.acl Project that you created in Lesson 2-1 Creating a Project. 1. Select File from the menu bar and choose Open Project. 2. Double-click the Workbook Data Files folder to view the list of files. 3. Double-click Newwork.acl. 4. Select Input File Definitions in the Overview window. 5. Click (New). ACL displays the Welcome screen of the Data Definition Wizard. Click [Next]. 6. Proceed to the Select File to Define dialog box and select Inventory.fil.
Module 2 ACL Fundamentals 41 I nput Fi l e Defi ni ti ons 7. On the File Properties screen of the Wizard, choose Skip to Finish and click [Next]. The Final screen of the Wizard appears. Click [Finish]. 8. Click [OK] to save the input file as Inventory. The Input File Definition window appears with the first part of the data file shown in the lower half of the window. Click the [Input File Options] tab. The status bar displays the name of the open Project, the number of records the data file contains, and the name of the input file. The path and name of the data file being defined is displayed in the title bar in the Input File Definition window. The data files ACL creates have the default extension .fil, but the data files other software packages create may have different extensions. For example, dBASE files have a .dbf extension. 42 ACL for Windows 7 Workbook I nput Fi l e Defi ni ti ons When the Input File Definition dialog box is open and the [Input File Options] tab is chosen, ACL displays the following information about the data file: You only create an input file definition for a data file once. After that, ACL automatically links the data file to the input file definition each time you open it. The bottom section of the dialog box displays the actual data in the data file. Each row is a record. The ruler, located just above the data, marks the byte positions in each record. The scroll bars on the right and bottom sides of the dialog box let you scroll horizontally and vertically through the records. If the record length is correct, and it usually is, the data is vertically aligned. Defining Data Fields Next, you will define the data fields for your input file definition, without using the Wizard. To define the data format for the input file definition, you use the Input File Definition window. By defining data fields, you describe the layout and content of the file for ACL. You can define one or all of the fields, and then edit the field definitions later to add new fields or change existing ones. You can also define overlapping fields. Use the Input File Definition window to define filters and expressions, also called computed fields. For more information, see Lesson 5.1: Using Expressions on page 224. You define a field by specifying the name, length, start position, and type of the field. For numeric fields, you must also specify the number of decimal places. For date fields, Media Type Data accessed as Disk, Tape - One Reel, or Tape - Multi Reel. File Type Fixed Record Length, IBM Variable Record Length, or Text File (CR or CRLF). Character Type ASCII or EBCDIC. Record Length The length of the record for fixed length files or the length of the longest record if the records are variable length. Skip Length This value determines the number of bytes in the input file that ACL ignores or skips over before data analysis begins. For example, you can use Skip Length to have ACL ignore the header information and begin defining the file from the detail records. The default is zero, so ACL analyzes data from the beginning of the file.
Module 2 ACL Fundamentals 43 I nput Fi l e Defi ni ti ons specify the format in which the dates are stored. You only need to define the data fields required for the tasks you want to perform. When you enter a field definition, the field formatting area of the window changes to display only the options you require. Options that do not apply are grayed out. You can create and edit fields and column formats, and create expressions in the field formatting area. When you are adding a field, the fields area displays entry boxes for the field with which you are working. When you have completed your definition, a list of defined fields appears. You do not need to define all the data in a file. You can select only the fields you want to use. The following procedure defines the Product Number, Product Description, Unit Cost, Sale Price, and Cost Date fields used in this lesson. To define the data fields: 1. Click the [Edit Fields/Expressions] tab in the Input File Definition window. Add a New Data Field Data area Delete Fields Shift Fields Add a New Expression 44 ACL for Windows 7 Workbook I nput Fi l e Defi ni ti ons 2. Click row 1, position 1 in the data area in the lower part of the window, as shown below. The fields area in the top of the Edit Fields/Expressions window changes to display a set of field definition boxes. A list of field types appears in the Valid Field Types box. Notice that the Start and Length (Len.) text boxes each contain a 1, which corresponds to the highlighted position in the data area. 3. Click position 1 and drag to the right until the Len. text box displays 11, and release the mouse button. The cursor is blinking in the Name text box. You are now ready to name the data field. 4. Enter ProdNo in the Name text box. ASCII is displayed in the Type text box and also highlighted in the Valid Field Types list box. You can accept the assigned field type or double-click another type in the list. The Valid Field Types list box can change. Depending on the type of data you have highlighted in a record, ACL displays the most appropriate list. Note: You can use any row when defining data fields.
Module 2 ACL Fundamentals 45 I nput Fi l e Defi ni ti ons 5. Click (Accept Entry) to add the field description to the data fields list. The [Edit/Fields Expressions] tab now looks like this: If you scroll to the right of the list view, you will see that the field type for ProdNo has been entered as ASCII. 6. Click row 1, position 12, and drag to the right until the Len. text box displays 24. 7. Enter ProdDesc in the Name text box. 8. Click . ACL adds the field description to the data fields list. Defining an Overlapping Field In this procedure, you redefine a portion of the product number field that you have already defined. This is called an overlapping field. To define an overlapping field: 1. Click row 1, position 1, and drag to the right until the Len. text box displays 2. Release the mouse button. 2. Enter ProdCls in the Name text box. 3. Click . ACL adds the field description to the data fields list. Notice that the overlapping field has the same start position as the Prodno field. Defining a Numeric Field A numeric field contains printable numbers that have an explicit decimal point, as well as an indicator, such as a minus sign or parentheses, for negative numbers. Numeric fields may be coded in either ASCII or EBCDIC. 46 ACL for Windows 7 Workbook I nput Fi l e Defi ni ti ons When you define the next data field, you will first skip a field and then start to define a unit cost field, which you will name Uncst. To define the next field as a numeric unit cost field: 1. Click row 1, position 37 and drag to the right until the Len. text box displays 6. Release the mouse button. 2. Enter UnCst in the Name text box. The unit cost field is numeric, not ASCII as indicated in the Type drop-down list and in the Valid Field Types list box, so you need to change the field type. 3. Select NUMERIC from the Type drop-down list. For numeric data fields that contain decimals or currency amounts, you need to specify the number of decimal places. 4. Enter 2 in the Decimal (Dec.) text box. This formats the unit cost field to display two decimal places in views and reports. 5. Click (Accept Entry). Next, to define the Sale Price field: 1. Click row 1, position 49. Drag to the right until the Len. text box displays 6, and release the mouse button. 2. Enter SalePr in the Name text box. 3. Double-click NUMERIC in the Valid Field Types list box. 4. Enter 2 in the Decimal (Dec.) text box to set the number of decimal places to two. 5. Click (Accept Entry). Defining a Date Field The last field you will define is a date field. The cost date field begins at position 55 on the byte ruler in the data area. You need to specify the format in which the date is stored in the data file, unless date fields are packed. Packed fields are discussed in Lesson 2.3: Interpreting Dates on page 50. To define a date field: 1. Click row 1, position 55, drag to the right until the Len. text box displays 6, and release the mouse button. 2. In the Name text box, enter CstDte. Since the Cstdte field is a date field, you need to change the data type.
Module 2 ACL Fundamentals 47 I nput Fi l e Defi ni ti ons 3. In the Valid Field Types list box, double-click DATE. 4. Click the down arrow beside the Format drop-down list. Select YYMMDD. 5. Click (Accept Entry). 6. Click (Close) to close and save the Inventory input file definition. The default view of Inventory appears. Editing Input File Definitions You can change an input file definition at any time. For example, you can add or delete field definitions, and modify the definition or formatting for existing fields. You can also modify the media type, file type, character type, record length, and skip length. Adding Field Definitions You may want to add fields to the input file to produce a more complete representation of the records in the file. You can use the Input File Definition window to create additional field definitions to add to the input file definition. To add a field to the Inventory input file definition: 1. With the Inventory input file definition open in the View, select Edit from the menu bar and choose Input File Definition. ACL displays the Input File Definition window. 2. Click position 61 in a record and drag to the right until the Len. box displays 5. 3. Enter QtyOH in the Field Name text box. 4. Select NUMERIC from the Type drop-down list. 5. Enter 0 in the Dec. text box, as Quantity On Hand is in whole units. 6. Click (Accept Entry). 7. Close the Input File Definition window. The new field definition, QtyOH, does not automatically appear in your default view. To add field definitions to your default view, see Adding Columns on page 68. Deleting Field Definitions If you decide you do not want to include a field definition, you can delete it from the input file definition at any time. Use the Input File Definition window to delete a field definition. You cannot delete a field definition if the current view is using that field. Close the view first, then delete the field definition. 48 ACL for Windows 7 Workbook I nput Fi l e Defi ni ti ons To delete a field definition: 1. Select Edit from the menu bar and choose Input File Definition. ACL displays the Input File Definition window. 2. Select the field you want to delete. 3. Click (Delete Fields). ACL asks if you want to delete that field. 4. Click [Delete]. The field definition disappears from the Fields list view. To replace a field definition that has been deleted, redefine it in the Input File Definition window (follow the procedure on the previous page for Adding Field Definitions). Shifting Multiple Fields with the Shift Fields Button The Shift Fields button allows you to shift the starting position of a data field. For example, if data fields are added to or removed from a source file at any position before the end, data in previously defined fields often moves out of alignment. You can use this feature to realign the data fields. You can automatically shift the start position of that data field along with all those data fields to its right. To shift fields using the Shift Fields button: 1. Select Edit from the menu bar and choose Input File Definition to display the Input File Definition window. 2. From the list of fields on the [Edit Fields/Expressions] tab, select the name of the leftmost data field of the fields you want to shift. Then click (Shift Fields) to open the Shift Fields dialog box. Or, you can click the (Shift Fields) button to open the Shift Fields dialog box, and then enter the starting byte of the first data field that you want to shift in the Start Shifting Fields from position text box. To display fields in order of their start positions from left to right, click the heading titled Start in the list view on the [Edit Fields/Expressions] tab. In multiple-record-type files, you can shift fields related to a particular record type by first selecting the name of the filter that identifies these fields from the drop-down list on the [Edit Fields/Expressions] tab. 3. Enter the number of bytes that you want the fields to shift in the Shift fields by the following number of bytes text box. Enter a positive number to move the fields to the right or a negative number to move the fields to the left. Note: Shift Fields only shifts physical data fields. Because computed fields are virtual fields that make reference to other fields, they are not affected.
Module 2 ACL Fundamentals 49 I nput Fi l e Defi ni ti ons 4. Click [OK], and then click [Yes] to confirm the realignment. Exiting ACL To exit ACL, select File from the menu bar and choose Exit; or, in the application window, click (Close). ACL displays a dialog box asking if you want to save the changes made to the input file. Click [OK]. ACL will save the changes to the input file. If you dont want to save the changes, click [Discard]. 2 2 50 ACL for Windows 7 Workbook I nterpreti ng Dates Lesson 2.3 Interpreting Dates ACL offers flexibility in accessing, displaying, and calculating dates. Dates are stored in data files in a variety of ways. ACL displays dates using the date format you specify in the input file definition. You can choose from ACLs predefined formats or create a date format that best suits your needs. Opening Your Project For this lesson, you will use the Workbook.acl Project. To prepare for this lesson: 1. Select File on the menu bar and choose Open Project. The Locate Project File dialog box opens. The dialog box lists the Data directory that was installed with the Workbook Data Files. 2. Select Workbook.acl from the Data folder listing. 3. Click [Open]. The Workbook.acl Project opens. 4. Click (Overview) to open the Overview window, if it is not open already. 5. Click (Expand) beside Input File Definitions. 6. Click the (Input File Definition) icon beside Ar in the list. Drag the Default_View icon to the work area to open the Default_View of the Ar input file definition, which uses the data file Ar.fil. Defining Date Fields When you select the Date data type, you must define how the date field is stored in the data file. The Date data type can be defined as pure numeric (e.g. 10/31/00) or alphanu- meric (e.g. Oct 31, 2000). An ASCII or EBCDIC field may be defined as a Date data type in the input file definition.
Module 2 ACL Fundamentals 51 I nterpreti ng Dates Input Date Formats An input date format typically contains only numbers (numeric) or both letters and numbers (alphanumeric). Other characters are treated as formatting characters (filler). Common examples of filler are the / in 11/30/00 (MM/DD/YY), or the blanks and comma in Nov 28, 2000 (MMM DD, YYYY). Any formatting characters used for input formats must match the characters in the field. Standard Dates There are several valid date formats in common use: The date format you specify must exactly match the data in the field. Putting slashes (/) in the format when they are not in the data file (or vice versa) causes ACL to incorrectly interpret the date. This usually results in a zero value (01/01/00) for the field. To view the input date format for the date fields: 1. With the Ar file open, select Edit from the menu bar and choose Input File Definition. The Input File window appears. 2. Click the [Edit Fields/Expressions] tab. 3. From the list of fields, double-click Date. The Format text box shows the format YYYYMMDD. 4. Click (Clear Entry) to return to the list of fields screen. 5. From the list of fields, double-click Due. The Format text box also shows the format YYYYMMDD. 6. Click (Clear Entry) to return to the list of fields screen. You use the input date format to tell ACL how dates are stored in the data file. You can display dates in a wide variety of ways, depending on your preference. For more infor- mation, see Selecting Dates on page 52. Type Format Example using December 31, 2000 American MM DD YY 12 31 00 European DD MM YY 31 12 00 MMM DD DEC 31 Julian YYDDD 00365 52 ACL for Windows 7 Workbook I nterpreti ng Dates To edit the date format: 1. Double-click Date in the list of fields. The [Edit Fields/Expressions] tab now looks like this: The data area in the bottom part of the window shows you how the date is stored in the data file. The Valid Field Types area in the right side of the window shows you how the date appears in your view. If the date format does not match the data in the field, you can change it. 2. Click the Format drop-down list and select the correct format. 3. Click (Accept Entry). ACL changes the date format and returns to the fields list. Selecting Dates The Date Selector simplifies calendar date selection. Date fields are usually defined when you create an input file definition. To access the Date Selector in the Input File Definition window, double-click any date type field listed on the [Edit Fields/Expressions] tab and then press F8. You may also need to enter a date when creating expressions. To access the Date Selector in the Expression Builder, click the [Date] button.
Module 2 ACL Fundamentals 53 I nterpreti ng Dates Clicking the drop-down arrow in the Date Selector displays a monthly calendar with the current date circled. Use the left or right arrows to scroll back or ahead to the month you want and then select a day. You can quickly select a year by clicking the year on the calendar to display a spin box. Click the up or down arrows to select a year. You can also enter date information directly into the Date Selector text box. Select the name of the month in the text box, then move to the desired month using the up and down arrow keys on your keyboard. Or, again selecting the name of the month, enter the numeric value of the month that you want. For example, if you enter 12, the month changes to December. Change the numbers for the day and the year by selecting them individually and entering new numbers. Displaying Dates ACL defines dates in the data file according to what you specify in the Format text box in the Input File Definition dialog box. ACL displays dates in all views, reports, and other output according to the preferences you set for dates. Displaying Dates in the View Window You can choose from the Date Options in the Preferences dialog box to control the appearance of dates to in views, reports, and other output. For example, if you had an invoice date of November 12, 2000: The data file stores the date as: 20001112 The default preferences format is: MM/DD/YYYY The Input File date format specified by the user is: YYYYMMDD Selected day Scroll to month Scroll to year Calendar Current date Click to display Calendar 54 ACL for Windows 7 Workbook I nterpreti ng Dates The ACL default date format is mm/dd/yyyy. Dates are set globally for all views and output files. ACL interprets date formats as follows: To change the display of dates in both input and output files to month, day, year (MMM DD, YYYY format): 1. Select Edit from the menu bar and choose Preferences. 2. Click the [Date Options] tab in the Preferences dialog box to display the options for setting dates. The View window displays the data as: 11/12/2000 Year 1 99 YY Year 1900 9999 YYYY Month 1 12 MM Month Jan Dec MMM Day 1 31 DD Day 1 366 DDD
Module 2 ACL Fundamentals 55 I nterpreti ng Dates 3. Click the Default Date Format drop-down list and select the MMM DD, YYYY format. 4. Click [OK] to change the default date format for this ACL session. To change the existing date format to the European date format, dd/mm/yy: 1. Select Edit from the menu bar and choose Preferences. 2. Click the [Date Options] tab in the Preferences dialog box. 3. Select DD/MM/YY from the Default Date Format drop-down list. 4. Click [OK] to use the European date format for this session only. ACL globally reformats all date fields. If you wanted to save the new format for future ACL sessions, you could click [Save] and then [Yes]. Setting the Start of Century If all your dates contain four-digit years, you are set up for the twenty-first century and do not need to use the Start of Century preference. The Start of Century setting indicates the year separating this century and the next for dates with a two-digit year. You can use the Start of Century preference to set the first year of the 100-year period in which ACL will interpret data. The default is set to zero (in other words, the year 00 is treated as 1900). For example, you may choose to set 1960 as the separating year. You would enter 60 in the Start of Century text box. ACL then treats years 60 to 99 as 1960 to 1999 and years 00 to 59 as 2000 to 2059. The following table illustrates possible Start of Century dates: Note: If an alpha format is used in the data file to define months, the same format must be used in Abbreviation for month names. Alpha month formats are divided using list separators. Start of Century Date Years Display as Dates 00 00 to 99 1900 1999 (cannot display after 2000) 05 05 to 99 1905 1999 00 to 04 2000 2004 56 ACL for Windows 7 Workbook I nterpreti ng Dates To set the Start of Century for dates with a two-digit year: 1. Select Edit from the menu bar and choose Preferences. 2. Click the [Date Options] tab in the Preferences dialog box. 3. Enter 60 in the Start of Century text box. 4. Click [OK] to apply your settings for this session only. For more information, see Date Options on page 337 and online Help. Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit. 2 60 60 to 99 1960 1999 00 to 59 2000 2059 77 77 to 99 1977 1999 00 to 76 2000 2076 Start of Century Date Years Display as Dates
Module 2 ACL Fundamentals 57 Overvi ew Wi ndow Lesson 2.4 Overview Window The Overview window provides an easy way to manage all the components of your ACL Project. You can use the buttons in the Overview window to execute various Project management commands. 1. Select File from the menu bar and choose Open Project. The Save New Project As dialog box opens. 2. In the Workbook Data Files folder, select Workbook.acl. 3. Click [Open] to open the Workbook.acl Project. 58 ACL for Windows 7 Workbook Overvi ew Wi ndow Working with the Overview Window If your Overview window is not already open, click (Overview) on the button bar to display the Overview window. About the Overview Window Contents The Overview window displays a list of the Project format files: Batches, Input File Definitions, Views, Workspaces, and Indexes. Batches are a series of commands stored in a batch file in an ACL document. Input File Definitions describe the various structures and contents that have been defined for a data file. Views display, in column form, the data in an input file according to the way you define fields in their associated files. Workspaces are separate areas in an ACL Project that contain field definitions. Indexes contain pointers to the input file so that ACL can read and process the data file in sorted order.
Module 2 ACL Fundamentals 59 Overvi ew Wi ndow Icons in the Overview Window Icons represent the various file types referenced by a Project file.The following table defines these icons: Using Expand Buttons The (Expand) buttons beside the icons indicate that a list of files of that type exists. To see the list, click . ACL displays the list and changes to a (Collapse) button. To close the list, click the (Collapse) button. If there is no next to the icon, no list exists. Icon Represents Batches Input File Definitions Views Workspaces Indexes Collapse button Expand button 60 ACL for Windows 7 Workbook Overvi ew Wi ndow Opening an Input File You can open an input file from the Overview window. To open an input file in the Overview window, make sure the Input File Definitions list is expanded. If it is not, click (Expand) beside Input File Definitions. To open an input file, use one of the three following methods: Click the Inventory input file to select it and then click (Open) to open it Double-click the Inventory input file Click the Inventory input file and then drag and drop it onto your desktop ACL automatically closes the open file (if one is open), and then opens the file you selected and displays it in the View window. Closing an Input File To close a view from the Overview window: 1. From the list of input file definitions, locate the Inventory input file. The Inventory input file definition icon is highlighted, indicating that it is in use. 2. Click to select Inventory and click (Close). The Inventory input file closes. The Overview window remains open so that you can access other files. Importing an Input File Definition from Another Project Instead of creating a new input file definition in your current Project, you can import one from an existing Project, if it is already structured to fit your needs. This is a fast way to create field definitions and format a Project.
Module 2 ACL Fundamentals 61 Overvi ew Wi ndow To import an input file definition, you open a Project from the File menu and choose a file from the Locate Project File window. For example, you can import one or more input file definitions from Workbook.acl to the Newwork.acl Project that you created in the exercise on Creating, Opening, and Closing Projects on page 32. To import an input file definition from Workbook.acl into Newwork.acl: 1. Open Newwork.acl. 2. Click (Overview) on the button bar to display the Overview window. 3. In the Overview window, click Input File Definitions. 4. Click (Copy from Another Project). ACL displays the Locate Project File dialog box. 5. Select Workbook.acl from the dialog box and click [Open]. ACL displays the Import dialog box. The From text box displays the names of input file definitions defined in the Workbook Project. 6. In the From Workbook.acl list box, click Ar and then click [-->] to add the input file definition to the To Newwork.acl list box. 7. Click [OK] to close the Import dialog box. 8. In the Overview window, double-click Ar in the input file definitions list. ACL opens the default view of the accounts receivable file. You can see that all the fields are defined just as they are in the Workbook.acl Project. Duplicating an Input File Definition To duplicate an input file definition: 1. In the Overview window, select the input file definition you want to duplicate. 2. Click (Duplicate) in the Overview window. Click [Copy]. A message box appears advising that the input file has been duplicated. 3. Click [OK]. Linking an Input File Definition to a New Data File You can use the Link button in the Overview window to link an input file definition to a different data file. You should only use this feature when the data file to be linked has a structure identical to the input file definition. To link an input file definition to a new data file: 1. Open the Project containing the input file definition to be linked. 2. In the Overview window, select the input file definition and click (Link). The Locate Data File dialog box appears. 62 ACL for Windows 7 Workbook Overvi ew Wi ndow 3. Select a data file to link to your selected input file definition and click [Open]. The input file definition is opened using the selected data file. Refreshing From an ODBC Source File The Refresh from Source File button in the Overview window lets you refresh the data in an imported ODBC database table. To refresh the data in an input file definition linked to an ODBC table: 1. In the Overview window, select the input file definition name. 2. Click the (Refresh). Renaming an Input File Definition To rename an input file definition: 1. In the Overview window, select the input file definition you want to rename. If it is open, you must close it first. 2. Click (Rename). The Rename dialog box appears with the original input file definition name. 3. Enter a new name for the input file definition. 4. Click [OK] to rename the input file definition and close the dialog box. Deleting an Input File Definition To delete an input file definition: 1. In the Overview window, select the input file definition you want to delete. 2. Click (Delete).A dialog box appears asking Delete (input file definition)? 3. Click [Delete]. Creating an Input File Definition To create an input file from the Overview window: 1. In the Overview window, select Input File Definitions. 2. Click (New). ACL closes the current input file definition (if one is open). ACL displays the Data Definition Wizard. 3. Follow the steps for creating an input file definition in Lesson 2.2: Input File Defini- tions on page 34. Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit. 2
Module 2 ACL Fundamentals 63 Vi ew Wi ndow Lesson 2.5 View Window The View window is one of the most useful windows in ACL. The View window displays data in an input file according to the way you define its fields. The data in a view is in a tabular format that looks like a spreadsheet. You can easily scan through the records and fields in your file, rearrange the view, or print the view. Opening Your ACL Project To prepare for this lesson: 1. Select File from the menu bar and choose Workbook.acl. ACL opens the Workbook Project with the same view and windows as when you previously closed this Project. 2. In the Overview window, click (Expand) next to Input File Definitions. 3. Double-click the Inventory input file definition to open it. Working with the View In an ACL view, each row represents a record in the input file and each column repre- sents a field. Beside the column furthest to the left is the record number of that particular record (the record number is not part of the record). The highlighted record number is called the current record. You can click any record number to make it the current record. Report Edit View Note Add Columns Modify Column Delete Columns Change Font Scroll bar Horizontal scroll button Vertical scroll button Scroll bar View name Graph Selected Data Record numbers Column title 64 ACL for Windows 7 Workbook Vi ew Wi ndow What is a Record? A record is a complete set of data about a topic. Each numbered line in the view repre- sents a record in the data file. The total number of records corresponds to the record count displayed on the status bar. ACL also indicates, below the last record, that you have reached the End of File. Scrolling Through Records When there are too many records (rows) in the file to display at one time, you can scan for non-visible items using the scroll bars. For more information, see Scrolling in Windows on page 24. As you scroll the view to display additional records, notice that the column headings are still displayed at the top of the view. What is a Column? A column is a defined field or expression that is displayed vertically in the View window. View columns display the fields you have defined from the data file. You can add, delete, or modify columns in a view. Rows represent records
Module 2 ACL Fundamentals 65 Vi ew Wi ndow Column Headings The titles shown at the top of each column in the View window are called column headings. Although the column headings are for display only, you can change their formatting. ACL automatically names the column headings using the names from the data file, unless you give them a different title. For more information, see Modifying Columns on page 70. Scrolling Through Fields When there are too many fields (columns) in the file to display at one time, you can scroll to see non-visible items with the scroll bars. For details on scrolling to view non-visible columns, see Scrolling in Windows on page 24. Customizing the View You can create many different views for each input file. Each view can be formatted without changing other views. Selecting Multiple View Fonts You can apply different fonts to the header, title, data, totals, and footer areas of the view, or you can apply the same font to all areas. You cannot apply different fonts to single column titles, single sections of the data, or individual totals. The default setting uses the same font for data, headers, and footers. Column headings are shown at the top of the view. Each column represents a field. 66 ACL for Windows 7 Workbook Vi ew Wi ndow To change the font: 1. Click (Change Font) in the View window. ACL displays the Select View Fonts dialog box. 2. Click [All], [Header], [Titles], [Data], [Totals], or [Footer] to display the Font dialog box. Notice that when you select a font, the Sample box displays a preview. 3. Select a font and click [OK]. 4. Click [OK] again to apply your changes to the view. Note: The available fonts are those installed on your computer. Preview of fonts that appear in the report Preview of the font you select
Module 2 ACL Fundamentals 67 Vi ew Wi ndow Rearranging Columns A view allows you to look at the data in a file. If you modify a view, the changes you make affect only the current view. The data and the input file definition are not affected by the changes. Moving Columns The default view displays the defined fields in the order that you define them. You can easily rearrange the columns. To move a column in the View window: 1. Point to the column title Product Class. Click and hold down the left mouse button. The pointer becomes a (Hand) icon. 2. Drag and position the at the left side of the first column. 3. Release the mouse button to move the column to the new location. The view now looks like this: To move a column to the right side of another column, click and drag the column, positioning the hand icon on the right edge of the column title. Removing Columns You may not want to use all the columns in the default view for your analysis. If you want to work only with selected columns, you can remove the remaining columns from your view. The fields remain defined, however, and you can restore the columns to the view at any time. Note: If you want to delete a field definition from the input file definition, you must first delete the column from the view. 68 ACL for Windows 7 Workbook Vi ew Wi ndow To remove columns from the view: 1. Scroll to the right of the view and click the last column title. ACL highlights the entire column. 2. CTRL+CLICK the remaining column titles. ACL highlights the columns you select. Scroll the view to the left as required to select all the columns. 3. Click (Remove Columns). ACL displays the message: Remove Field from View? 4. Click [Remove]. ACL removes the columns from the view. Adding Columns You can restore one, many, or all of the available fields to the View window. To add a column to the view: 1. Click (Add Columns). ACL displays the Add Columns dialog box.
Module 2 ACL Fundamentals 69 Vi ew Wi ndow The Available Fields list view displays all the fields defined in the input file definition. Notice that the names of the data fields in the input file definition are different from the column titles in the view. You will learn how to define column titles later in this lesson. 2. There are a number of ways to add and remove fields: Click [Add All]. ACL copies all fields to the Selected Fields list box. Click [Clear All]. ACL clears all fields from the Selected Fields list box. Select the first field name in the Available Fields list view. SHIFT+CLICK the last field name. ACL highlights all the fields in between. Click [-->]. ACL copies the fields to the Selected Fields list box. Select a field name in the Selected Fields list box. CTRL+CLICK nonadjacent field names. Click [<--]. ACL removes the highlighted fields and displays only the field names that were not highlighted in the Selected Fields list box. Double-click the remaining field names to remove them. Double-click a field name in the Available Fields list view. The field name is copied to the Selected Fields list box. 3. To apply the changes, click [OK]. ACL closes the Add Columns dialog box and displays the default view. You will learn about the other buttons in the Add Columns dialog box in later lessons. 70 ACL for Windows 7 Workbook Vi ew Wi ndow Notice that ACL automatically adds new columns to the far right side of the view, unless you specify otherwise. If you want to move the new column to the left of a column, you can simply drag the column to the new position. If you select one of the columns before adding columns, ACL will insert the columns to the left of the selected column. Add Columns Hot Key Hot keys provide a valuable shortcut for adding columns. To add a new column to your view using the Add Columns hot key: 1. Click the column heading immediately to the right of where you want to put the new column. 2. Press INSERT while in the View window. ACL displays the Add Columns dialog box. Add the columns you want to your view. ACL displays the new columns to the left of the highlighted column. De-selecting a Column If you accidentally highlight a column or change your mind about moving or deleting a column, you can de-select the column. To do so, click any record in any column. Modifying Columns You can modify columns in the view to change their appearance. When you format fields in the Input File Definition window, you define default formats that always apply to that field in all views of that input file definition. Changes that you make in the View Modify Column dialog box override the default formats so you can have different formats in different views. You can save each of the modified views under individual names. To display the Modify Column dialog box: 1. Double-click the column or click the column to select it. 2. Click (Modify Column).
Module 2 ACL Fundamentals 71 Vi ew Wi ndow ACL grays out the options that are not applicable. Changing Column Titles When you create and save an input file definition, ACL automatically creates and displays a View window containing the fields you defined, with the names you assigned to them. In the view, you can modify the column titles to make them more suitable for the report you are designing. To change the name of a column: 1. In the Modify Column dialog box, highlight the column title in the Alternate Column Title text box. 2. Enter the title Status of Product in the Alternate Column Title text box. 72 ACL for Windows 7 Workbook Vi ew Wi ndow 3. Click [OK] to close the Modify Column dialog box. The new column title now appears in the View window. Modifying Column Formats You can change the column formats using the Modify Column dialog box. When you modify columns, you are only changing the way ACL displays the columns in the View window. You are not changing the actual data. Modifying Numeric Format You can modify the format of a numeric column for displaying negative amounts using the Format box in the Modify Column dialog box.
Module 2 ACL Fundamentals 73 Vi ew Wi ndow To modify a numeric format: 1. Double-click a numeric column name to display the Modify Column dialog box. The name of the highlighted column appears in the Column Contents text box and in the Alternate Column Title list box. 2. Select a format from the Format drop-down list. 3. Click [OK] to accept the change and close the dialog box. Defining a Numeric Format To define a numeric format to display negative amounts in brackets: 1. Double-click the Unit Cost column title in the View window to display the Modify Column dialog box. 2. Click and enter (999,999.99) in the Format text box. This number format prints numeric values with two decimal places and uses a comma as the thousands separator character. Negative amounts are enclosed in parentheses, but are not preceded by a minus sign. 3. Click [OK]. ACL changes the number formatting in the Unit Cost column in the view. Changing Column Width When you want to increase or decrease the width of columns, you can do so easily in the View window or in the Modify Column Width text box. Using the View Window To change the column width in the View window: 1. Point to the column separator line between the column titles. Your pointer now looks like this: 2. Hold down the mouse button. 3. Drag the column separator to the left to decrease, or the right to, increase the column width. Note: The Format drop-down list is available only for numeric fields. You cannot apply numeric formats to character fields containing numbers such as location codes or invoice numbers. 74 ACL for Windows 7 Workbook Vi ew Wi ndow 4. Release the mouse button. Adjust the column separator until the column is the exact width you want. Using the Modify Column Dialog Box To change the column width in the Modify Column dialog box: 1. Click the column title and then click (Modify Column) to display the Modify Column text box. The Width text box shows how many characters wide the field is. 2. Click in the Width text box and enter a number smaller or larger than the number currently defined, depending on whether you want to make the column narrower or wider. Modifying Expressions You can create and modify expressions using the Modify Column dialog box. For more information, see Lesson 5.1: Using Expressions on page 224. Constructing Multiline Views The fields of one record can be distributed on two or more lines. You can further refine the look of your views by adding, deleting, and hiding rows, as well as moving columns to different rows. Adding and Deleting Rows You can add or delete blank rows in the view to change the space between the column titles and the records, and between record rows. When you add or delete rows using the following procedure, the space between every row, including the column titles, changes. You cannot add or delete just one row between two specific records. Drag to increase or decrease the column width
Module 2 ACL Fundamentals 75 Vi ew Wi ndow To add rows to below the column titles and record rows: 1. Place the pointer on the line between any two rows in the record number column. Your pointer now looks like this: . Click and hold down your left mouse button. 2. Drag the horizontal line down two rows. ACL adds two rows to the bottom of both the column title and the data area. To delete blank rows below the column titles and record rows: 1. Point between record number one and two in the record number column. Your pointer now looks like this: . 2. Click and drag upwards one row. ACL deletes one of the rows that you just added from the bottom of both the column title and data area. Only blank rows can be removed in this way. You can also add blank rows above column titles and record rows. To add blank rows above column titles and record rows, click and hold the mouse button in the record number column on the line above the column title area. The pointer changes to . Drag the line down. Blank rows are added above the column titles and the record rows. Drag to add or delete rows Drag down to add blank lines 76 ACL for Windows 7 Workbook Vi ew Wi ndow To delete the blank rows above the column titles and record rows, click any short line in the record column and drag upward. Moving Columns to Create Multiline Reports Once you have added blank rows to your view, you can move columns so that they appear on separate rows in your report. To move a column to create a multiline report: 1. Add a blank row between records as described above. 2. Point to the Product Description column title. Click and hold the left mouse button until it becomes a (Hand) icon. 3. Drag and position the to the left and below the Product Number column. ACL moves the Product Description column so that it is positioned in a separate row. 4. Click and drag the Sale Price column down and to the right of the Product Description column. It now shows on the same row as Product Description. 5. Add another two more blank rows to your view by placing your pointer in the record number column and dragging the down two rows. 6. Click and drag the Quantity on Hand column to the left, below the Product Description column. The Quantity on Hand column now appears in a separate row.
Module 2 ACL Fundamentals 77 Vi ew Wi ndow Printing the View You can print a view of all the records in the input file that are displayed in the view. You cannot, however, print only selected portions of a view. To print the view: 1. Select File from the menu bar and choose Print. ACL displays the Print dialog box. Your print dialog box will look similar. In the Print Range, you can select one of the following: All to print all of the view Pages to print one page Pages, then enter start and end page numbers to print a range of pages Column title Column data Printer that prints your report 78 ACL for Windows 7 Workbook Vi ew Wi ndow 2. Click [Setup]. ACL displays the Page Setup window. 3. Make any changes you want and click [OK], or click [Cancel] to close the Page Setup dialog box. 4. Click [Print]. ACL automatically provides half-inch margins on the top, bottom, left, and right sides of all printed output. Closing the View Window To close a view from the View window: 1. Close the view by clicking (Close) in the View window. ACL prompts you to save any changes to the default view. Rather than saving to the default view, it is a good idea to assign a new name that describes the contents of the changed view. 2. Enter a new name in the text box to save the altered view under the new name. 3. Click [OK]. ACL saves and closes the view. Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit. 2
Module 2 ACL Fundamentals 79 Command Log Lesson 2.6 Command Log The command log keeps track of the tasks you have performed. You can check the commands in a file, look at command results, add comments, print, or clear the command log. Opening Your Project To prepare for this lesson: 1. Open the Workbook.acl Project. For details on how to open an ACL Project and an input file definition, see Lesson 2.4: Overview Window on page 57. 2. From the Overview window, drag and drop the Default_View of the Inventory input file definition onto the (Open) button. The default view for the Inventory input file opens. Command Log Window The Command Log window (referred to as the log) records all commands you issue and their results from the time you open until the time you close an ACL Project. The log is the most complete documentation tool in ACL. The information in the log is cumulative: when you open an existing Project, the current activity for that Project is added to your previous activity. The log file has the same name as the Project, but with a .log extension. Displaying the Command Log When you perform some commands, such as Total and Count, ACL automatically displays the command log, otherwise you must display the command log manually. To display the command log, click (Command Log) or select Window from the menu bar and choose Open Command Log. ACL also displays the date and time the log was opened. 80 ACL for Windows 7 Workbook Command Log Take a few minutes to scroll through the log. ACL has compiled a complete record of all the commands and results since you started working with your Project. Commands are prefixed by the symbol @ and are recorded using command mode syntax. Each command is followed by its results. You can see the date and time the log was first created at the beginning of the log. At the bottom of the log, you can see the last command issued. Changing the Log Display To change the display of information in the log file: Select one of the following from the drop-down list in the command log: Log File to show both commands and results Commands to display only the commands Results to display only the results Last Result to show the last command issued and its result Adding Comments to the Log You can enhance the information in the log by including explanations or notations in the log file. To add a comment to the log: 1. Select Tools from the menu bar and choose Comment. The Comment dialog box appears. 2. In the Comment text box, enter Negative amounts should be discussed with the controller. 3. Click [OK]. ACL adds your comment to the Command Log at the end of the log file. You can enter single or multiple lines of comments at any time to document your thoughts, objectives, and calculations, and to insert explanations for future reference. Clearing the Log The log file must be cleared regularly or it can become very large. It is best to document your work as you go, and clear the log if you have no further use for its contents. You can choose to clear the entire log, a section from the beginning of the log up to the cursor, or a highlighted selection. You cannot use the delete or backspace keys to delete entries from the log. Note: You can also enter a single-line comment in the text box in the command log.
Module 2 ACL Fundamentals 81 Command Log While you progress through this workbook, it is a good idea to retain a record of your activities in the log file. You can display the log any time you want to review information about when a file was opened or the commands you issued and their results. Clearing the Log to the Cursor You can clear the oldest portion of the log by placing the cursor at the point where you want the clearing to stop. To clear the log to the cursor: 1. Scroll through the log and place your cursor at the end of the information you want to clear. 2. Select File from the menu bar and choose Clear Log File. The Clear Log File dialog box appears. 3. Select Clear Log to Cursor. 4. Click [OK] to accept the entry and close the dialog box. ACL inserts an entry in the log: Log has been cleared to cursor. Clearing a Section of the Log To clear a section of the log: 1. Scroll through the log and place your cursor at the start of the section you want to delete. 2. To highlight the information you want to clear: Click and drag to select a section by pressing the left mouse button, dragging the mouse to select the section you want, and releasing the mouse button. Click at the start of the section, scroll down to the end of the section and press SHIFT+CLICK, placing your cursor at the end of the section. 3. Select File from the menu bar and choose Clear Log File. ACL displays the Clear Log File dialog box. Important: Log entries that have been cleared cannot be recovered. 82 ACL for Windows 7 Workbook Command Log 4. Select Clear selection to clear only the highlighted selection. 5. Click [OK]. ACL clears the highlighted section and, in place of the deleted selection, records the message: A range of the Log has been deleted. Clearing the Full Log To clear the full log: 1. Scroll through the log to make sure there is nothing you want to keep. 2. Select File from the menu bar and choose Clear Log File. ACL displays the Clear Log File dialog box. 3. Select Clear entire Log. 4. Click [OK] to accept the entry and close the dialog box. Printing the Log Printing the log file is useful if you want permanent documentation of your work. You can print the entire log or just a portion of the log. You can select the information to be displayed from the drop-down list in the command log. For more information, see Changing the Log Display on page 80. Important: ACL does not verify your request when you clear the full log. Look through the log first to make sure you want to delete everything in it.
Module 2 ACL Fundamentals 83 Command Log Printing the Full Log To print all of the log: 1. Select File from the menu bar and choose Print Documentation. The Print Documentation dialog box appears. 2. Check the Log check box to turn on the option. 3. Click [Print] to close the Print Documentation dialog box. ACL displays the Print dialog box. 4. Click [Print] again to begin printing. ACL prints all the commands and their results as they appear in the log. Printing a Section of the Log To print only a portion of the log: 1. In the command log, point to the start of the section you want to print. Press the left mouse button and drag to highlight the portion of the window you want to print. Release the mouse button. 2. Select File from the menu bar and choose Print. ACL displays the Print dialog box. 3. Click [Print] to print only the highlighted section of the log. 84 ACL for Windows 7 Workbook Command Log Displaying the File History Each time ACL creates a data file as output, it also creates a record of the commands and options used to create the file. This record is called the file history. To view file history: Select Tools from the menu bar and choose File History to display the command log. ACL displays the time and date of each step you take to create the file. ACL includes the file name in the title bar and creates input file notes to tell you how the file was created. Whenever ACL creates a data file as output, it adds a description of the process to the input file definition, called the file history. If you are using a data file that was not created in ACL, there will be no file history to display, as shown above. The file history details the source file and the processes applied to produce the output file. When you issue several commands in sequence, such as Extract, Sort, Summarize, and Sample, each step adds another line to the history. Reissuing Commands You can use the command log to change the output or edit the command specifications and reissue commands. It is sometimes faster to edit a previous command than enter a new command. Command Mode Syntax Commands are represented in the command log by their command mode syntax. In command mode syntax, the @ symbol precedes all commands. For example, the command mode syntax of the Open command that you used to open the Inventory file is: @ OPEN Inventory You do not have to use command mode syntax. You only need to recognize the command. The syntax for a command includes the command name as the first word in the string, therefore finding a given command is easy.
Module 2 ACL Fundamentals 85 Command Log Using the Results to Reissue Commands To reissue a command: 1. In the command log, click a command. ACL copies that command to the text box at the top right of the window. 2. Click (Accept Entry) to reissue the command. You can also enter new specifications in the command line, and then click to issue the command with changes. If the command has an associated dialog box, you can click the desired command in the command log and then click (Edit Command) to display the dialog box, enter changes, and reissue the command. Searching the Log The Find feature makes it easy to find things in the command log, especially when it becomes very long. You can search for any text item, including command names and field names. Finding Items in the Command Log To search for text in the command log: 1. Click to display the Find dialog box. 2. Enter the name of the item in the Find what text box. 3. Select Up or Down to choose a search direction. 4. Click [Find Next]. ACL finds the next occurrence of the character string you are searching for and highlights it in the log. Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit. 2 86 ACL for Windows 7 Workbook Documenti ng Your Work Lesson 2.7 Documenting Your Work Documenting your work is an essential part of most data analyses. Using notes and printouts lets you keep a record of procedures and comments for future reference. Anyone working with the Project can draw a wealth of information from notes and printouts. ACL gives you flexibility and control in creating complete records that you can use for review and reference. You can use notes in the Input File Definition, View, Data Definition/Expression, Document, and Batch windows. You can also print input file definitions and file histories. Opening Your ACL Project To prepare for this lesson: 1. Select File from the menu bar and choose Open Project. 2. Double-click the Workbook Data Files folder. 3. Double-click Workbook.acl. 4. Click (Expand) beside Input File Definitions in the Overview window. 5. Drag and drop Inventory onto the (Open) button. The view of the Inventory file that you worked in most recently opens. Making Notes Aside from adding comments to the log, another way to provide information about Projects, files, fields, batches, or views is to make notes. Notes are extremely useful as online references. Notes are different from comments in that they are not included in the command log. You can print Project notes when you choose Print Documentation from the File menu. Project Notes Use Project Notes to record general information about a Project. To add a note to a Project: 1. Click (Edit Project Note) on the main button bar.
Module 2 ACL Fundamentals 87 Documenti ng Your Work 2. Enter ACL for Windows Workbook Project. The Project Notes window now looks like this: 3. Close the Project Notes window. ACL shades the bottom portion of the button to show that there are now Project notes: View Notes The most obvious place to add notes is the View. Notes can explain the reasons for creating a particular view and clarify its usage to other users. To create a note for the view: 1. Click (Edit View Note) on the View window button bar. 2. Enter Inventory file showing product class, location, and product number. 3. Close the Notes window. ACL shades the bottom portion of the Notes button to indicate that you added a note. Input File Definition Notes You can use an input file definition note to describe why the input file definition was created. To make a note about an input file definition: 1. Select Edit from the menu bar and choose Input File Definition. The Input File Definition window opens. 2. Click the [Input File Options] tab. 3. Click (Edit Input File Definition Note) on the Input File Definition window button bar to display the Input File Inventory Notes window. 88 ACL for Windows 7 Workbook Documenti ng Your Work 4. Enter Input file definition for the Inventory data file. 5. Close the Notes window to save the note. 6. Close the Input File Definition window. The button, with the bottom half of the note darkened, indicates that notes already exist and are available for viewing or editing. Copying and Pasting Text to a Note You can use the Edit menu to copy individual sections of data in a view. You cannot copy areas from a multiline view or an entire column. To copy data in the view: 1. Highlight the area you want to copy. 2. Select Edit from the menu bar and choose Copy. ACL copies the data into your computers clipboard. You can now paste the data into a note, text box, or different program. To paste data into the view note: 1. Click in the View window to display the view note. 2. Select Edit from the menu bar and choose Paste. ACL places the copied data into the View Notes window. Highlight the area you want to copy
Module 2 ACL Fundamentals 89 Documenti ng Your Work Printing Logs, Histories, and Notes You can print the contents of any active window or any highlighted section of text by clicking (Print Active Window). To selectively print information about a file, you can choose Print Documentation from the File menu. Printing Documentation Whenever ACL creates a data file as output, it also keeps a record of the printing documentation. ACL offers a range of options for printing documentation, including additional reference items such as input file definitions, batch and view definitions, and Project notes. To print the active window or any highlighted section: 1. Click (Print Active Window) on the button bar. ACL displays the Print dialog box. 2. Make sure that your printer is connected and ready. Click [Print]. To print the view, see Printing the View on page 77. To selectively print documentation: 1. Select File from the menu bar and choose Print Documentation. ACL displays the Print Documentation dialog box: Note: The data that you copy may be spaced slightly differently when you paste it. 90 ACL for Windows 7 Workbook Documenti ng Your Work 2. In the list box on the right, click one of the view definitions. 3. Check the Page Break after each Category check box to begin printing each category at the top of a page. Check the Page Break after each Item check box to start each item at the top of a page. 4. Click [Print]. ACL displays the Print dialog box. Make sure that your printer is connected and ready. 5. Click [Print] again to print the view definition. ACL prints a list of the fields in the view. The list includes any options set for the field. To print documentation for all input file definitions, views, or batches, you simply check the check boxes at the top of each of the list boxes in the Print Documentation dialog box. You can also print the command log from the Print Documentation dialog box by selecting the Log check box. Similarly, you can print any notes you have made for the Project by selecting the Project Notes check box. For more information, see Printing the Log on page 82.
Module 2 ACL Fundamentals 91 Documenti ng Your Work Changing the Font Size You can select a different font size from the drop-down list at the top of the Print Documentation dialog box. Increase the number to make the printed text larger, or decrease the number to make the printed text smaller. The default setting is 9 point font size. Preferences Check the Preferences check box in the Print Documentation dialog box to include a list of the current Preference settings with your documentation. Your current preference settings print at the beginning of the documentation. Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit.
Module 2 ACL Fundamentals 92 Documenti ng Your Work 93 Module 3 UNDERSTANDING DATA In Module 3, you will use ACL commands and functions to gain an understanding of your data and verify its validity and completeness. Work through this module to learn how: Verify detects errors in data fields Dump helps you understand invalid data Count counts records Total totals fields and expressions Statistics displays information on numeric fields Profile shows summary statics on numeric fields Sequence, Duplicates, and Gaps identify duplicates, gaps, and missing records 94 ACL for Windows 7 Workbook Veri fyi ng Data Lesson 3.1 Verifying Data Use the Verify command to validate data before working with a file for the first time. Verify analyzes fields to ensure that the data is consistent with the specified field type. For example, in character fields, you can check for unprintable characters. In numeric fields, you can check for items such as more than one preceding plus (+) or minus () sign or more than one decimal point (.). You can check for alphabetic characters in a numeric field, which is sometimes a sign of corrupted data. In date fields, you can check for invalid dates such as February 29, 1999, or March 34, 2001. Opening Your Project To prepare for this lesson: 1. Open the Workbook.acl Project. For details on how to open an ACL Project and an input file definition, see Lesson 2.4: Overview Window on page 57. 2. Select Inventory and drag and drop it onto the (Open) button to open the default view of the Inventory input file that uses the data file Inventory.fil. Using the Verify Command The Verify command uses the input file definition to check the specified fields for errors. To verify all the defined data fields: 1. Select Analyze from the menu bar and choose Verify. The Verify dialog box appears.
Module 3 Understanding Data 95 Veri fyi ng Data 2. Click [Verify Fields] to display the Selected Fields dialog box. The Available Fields list view contains all defined fields for the Inventory input file definition. 3. Click [Add All] to copy all the available fields to the Selected Fields box. 4. Click [OK] to close the Selected Fields dialog box. 5. Click [OK] again to execute the Verify command. The result of the verification appears in the command log. In this case, no errors were found. If there are errors in the file, ACL displays the details of the errors in the log. Using Conditions with the Verify Command You can include conditions with the Verify command to check the contents of data fields of specific records according to the test you specify. For example, you can verify data by using a condition to check fields for records that contain a specific invoice number. For more information, see Lesson 5.1: Using Expres- sions on page 224. Verifying Data Automatically Set the Verify Data preference to automatically check the validity of numeric data whenever you use an input file. This option is turned off by default to increase processing speed. For more information, see Verify Data on page 303 of the ACL for Windows User Guide and online Help. Using the VERIFY( ) Function Another way to identify invalid data is to use the VERIFY( ) function to detect errors in individual fields. 96 ACL for Windows 7 Workbook Veri fyi ng Data VERIFY( ) determines whether a field contains valid data and returns a True or False value, as appropriate. Computed fields and expressions always return a True value because they cannot contain invalid data. You can also use the VERIFY( ) function as the condition portion of a computed field to test for invalid data and substitute a value for the invalid data so that processing can continue. For more information, see VERIFY( ) on page 85 of the ACL for Windows Reference Manual and online Help.
Module 3 Understanding Data 97 Counti ng Records Lesson 3.2 Counting Records When you first use an input file, you should ensure that you are working with the correct data file and that the data is complete. Always begin your analysis by checking that data has not been lost during file prepa- ration or while downloading data to your hard disk. You can confirm the number of records by looking at the status bar. ACL automatically displays the number of records in a fixed record length file in the middle of the status bar. Opening Your Project To prepare for this lesson: 1. Open the Workbook.acl Project. For details on how to open an ACL Project and an input file definition, see Lesson 2.4: Overview Window on page 57. 2. In the Overview window, drag Ap_Trans onto the application workspace. The View window opens and displays the records and columns for the input file definition Ap_Trans. Using the Count Command The Project status bar shows you there are 102 records in the data file. It is good practice to make sure that your control totals are correct, especially since you are often provided with more records than you need. Use the Count command to test the number of records in the file. To Count the number of records: 1. Select Analyze from the menu bar and choose Count. ACL displays the Count dialog box. 98 ACL for Windows 7 Workbook Counti ng Records 2. Click [OK]. ACL displays the command log with the number of records counted. ACL reports that there are 102 records in the file. This number agrees with your control total, so you know that you did not lose records while preparing the file or downloading data to your hard disk. Use the Count command to record the number of records in the log file as part of your documentation. Command mode syntax Result
Module 3 Understanding Data 99 Total i ng Fi el ds Lesson 3.3 Totaling Fields The Total command displays the total of numeric fields or expressions in an input file. Frequently, you will want to check the totals of the numeric fields in the data. Opening Your Project To prepare for this lesson: 1. Open the Workbook.acl Project. For details on how to open an ACL Project and an input file definition, see Lesson 2.4: Overview Window on page 57. 2. From the Overview window, drag Ap_Trans onto the application workspace. The View window opens and displays the records and columns for the input file definition Ap_Trans. Total the Numeric Fields To total the numeric fields in an input file: 1. Click (Total) or select Analyze from the menu bar and choose Total. ACL displays the Total dialog box. As Total only operates on numeric fields, ACL shows only numeric fields and excludes all other fields in the Total Fields list view. 2. Click [Total Fields] to display the Selected Fields dialog box. 100 ACL for Windows 7 Workbook Total i ng Fi el ds 3. Click [Add All]. ACL copies all the fields to the Selected Fields list box. 4. Click [OK] to return to the Total dialog box with the selected fields highlighted. 5. Click [OK] again. ACL displays the totals of all the numeric fields in the command log. Totaling Data Automatically ACL automatically executes commands when the Autoexecute Commands preference is set. When you select a command from the menu bar, the results are immediately shown and the dialog box is never displayed. See Command Options on page 335 for further details. To see if the Autoexecute Commands preference is set: 1. Select Edit from the menu bar and choose Preferences. ACL opens the Preferences dialog box. 2. Click the [Command Options] tab to show the Command Options.
Module 3 Understanding Data 101 Total i ng Fi el ds 3. Make sure the Autoexecute Commands check box is selected. 4. Click [OK]. To autoexecute a total: 1. CTRL+CLICK the Invoice Amount, Quantity, and Unit_Cost headings to select them. 2. Click or select Analyze from the menu bar and choose Total. The result immediately appears in the command log. Notice that the total is identical to that reported in the previous command result. Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit. 102 ACL for Windows 7 Workbook Obtai ni ng Stati sti cs Lesson 3.4 Obtaining Statistics The Statistics command provides statistics on numeric and date fields. For example, in numeric fields, Statistics provides control totals that you can use to verify subsequent processes. You can also use Statistics for bounds checking. In date fields, for example, you can find maximums and minimums. Statistics that highlight abnormalities in the data file can influence your subsequent analysis. Opening Your Project To prepare for this lesson: 1. Open the Workbook.acl Project. For details on how to open an ACL Project and an input file definition, see Lesson 2.4: Overview Window on page 57. 2. From the Overview window, drag Ap_Trans from the list of input file definitions onto the application workspace. The View window opens and displays the records and columns for the input file definition Ap_Trans. Displaying Statistics Before doing any detailed processing, you should look at some statistics. The Statistics command provides: Record counts Field totals Average values Absolute values Range between the minimum and maximum values Standard deviations Highest field values Lowest field values To obtain statistics on a numeric or computed field: 1. Click (Statistics) or select Analyze from the menu bar and choose Statistics. ACL displays the Statistics dialog box. 2. In the Statistics On list view, select Invoice_Amount. 3. Check the Std. Deviation check box to have the standard deviation included in the results.
Module 3 Understanding Data 103 Obtai ni ng Stati sti cs 4. Click [OK]. ACL displays the result in the command log. ACL displays the number of positive, zero, and negative values in the file, along with the totals and averages for each field. The absolute value and range of the values are shown, as are the fields standard deviation, and the five maximum and five minimum values. Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit. 104 ACL for Windows 7 Workbook Profi l i ng Lesson 3.5 Profiling The Profile command provides summary statistics on one or more numeric fields in an input file. The Profile command provides: Total value Absolute value Minimum value Maximum value When you issue the Profile command first, ACL uses the results as the default values for the Stratify, Histogram, or Sample commands. You do not need to calculate the above values for the Stratify, Histogram, or Sample commands. Opening Your Project To prepare for this lesson: 1. Open the Workbook.acl Project. For details on how to open an ACL Project and an input file definition, see Lesson 2.4: Overview Window on page 57. 2. In the Overview window, select Ap_Trans from the list of input file definitions. Click (Open) in the Overview button bar. The View window opens and displays the records and columns for the input file definition Ap_Trans. Profiling a Field To profile a numeric field: 1. Select Analyze from the menu bar and choose Profile. ACL displays the Profile Fields dialog box. Note: The Statistics command will give you more complete information than the Profile command.
Module 3 Understanding Data 105 Profil ing 2. In the Profile Fields list view, click Invoice_Amount. 3. Click [OK]. ACL displays the Total, Absolute Value, Minimum, and Maximum amounts, along with the field name, in the command log. Automatic Profiling You can set a preference to automatically execute the Profile command when you open an ACL Project or change input files. To set the automatic profiling preference: 1. Select Edit from the menu bar and choose Preferences. The Preferences window opens. 2. Click the [Input File Options] tab. The screen changes to show the available options for input files. 3. Check the Automatically Profile on Open check box. 4. Click [OK] to accept the setting and close the dialog box. 106 ACL for Windows 7 Workbook Profi l i ng The next time you open an input file definition, ACL will automatically profile all numeric fields and display the results in the command log. Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit. Note: If an input file has many numeric fields, setting the Automatically Profile on Open preference may slow the opening of the file.
Module 3 Understanding Data 107 Testi ng for Sequences, Dupl i cates, and Gaps Lesson 3.6 Testing for Sequences, Duplicates, and Gaps You can locate inaccuracies in the data file using the Sequence, Duplicates, and Gaps commands. The Sequence, Duplicates, and Gaps commands share the same dialog box. Duplicates and Gaps commands are variations of the Sequence command. When you choose Sequence from the Analyze menu, the dialog box opens with Sequence as its title. When you choose Duplicates or Gaps from the Analyze menu, the dialog box opens with the appropriate title. The options in the dialog box are the same, but depending on the command you have chosen, different options are selected by default. In this lesson you test for gaps in check numbers and duplicate employee numbers. Opening Your Project To prepare for this lesson: 1. Open the Workbook.acl Project. For details on how to open an ACL Project and an input file definition, see Lesson 2.4: Overview Window on page 57. 2. Select Payroll and drag and drop it onto the (Open) button in the Overview window to open the default view of the Payroll input file, which uses the data file Payroll.fil. Testing the Field Sequence Use the Sequence command to test that an input file is sorted on a specific field. If it is, the command log will show no sequence errors. If the input file is not sorted on the field you select, the command log reports the number of records that are out of order and lists the records. 108 ACL for Windows 7 Workbook Testi ng for Sequences, Dupl i cates, and Gaps To issue the Sequence command and find out if the data file is already sorted: 1. Select Analyze from the menu bar and choose Sequence. The Sequence dialog box opens. 2. In the Sequence On list view, select EmpNo. 3. Click [OK]. ACL reports no errors in the command log. Some of the items in the Sequence dialog box appear faded. ACL grays out options that do not apply to the task you are performing. The fields in the List Fields list view are grayed out until you check the Duplicates check box. The Gaps options, List Gap Ranges, and List Missing Items are grayed out until you check the Gaps check box. Testing for Duplicates Use the Duplicates command to find out if key fields in the current file contain dupli- cates in the sequence. The Duplicates command is a variation of the Sequence command. The next exercise tests to find out if duplicate paychecks have been issued to employees. To test for duplicate paychecks: 1. Click (Duplicates), or select Analyze from the menu bar and choose Dupli- cates. ACL displays the Duplicates dialog box with the Duplicates check box selected.
Module 3 Understanding Data 109 Testi ng for Sequences, Dupl i cates, and Gaps 2. In the Sequence On list view, click EmpNo. 3. In the List Fields list view, click Gross_Pay. Then, CTRL+CLICK Paydate and Check_No. 4. If you are not sure if the Sequence On field is sorted, check the Presort check box. 5. Click [OK]. ACL prompts you to enter the output file name. 6. Click [OK]. Select Screen instead and click [OK]. ACL reports the result. For each duplicate occurrence, ACL reports the employee number, gross pay amount, and pay date in the command log. The command log also shows the total number of duplicates and/or gaps. When you locate duplicates, you may want to print a hard copy that lists the multiple pay check numbers, dates, and amounts. The command log contains all the infor- mation you need to report inaccuracies to the payroll department. 110 ACL for Windows 7 Workbook Testi ng for Sequences, Dupl i cates, and Gaps Now that you have tested for duplicates, you can see if there are any gaps in the sequence of check numbers. Testing for Gaps Use the Gaps command to find out if key numeric fields in the current file contain gaps in the sequence. To test for gaps, select Analyze from the menu bar and choose Gaps. The Gaps dialog box opens. Note that the List Fields contents appear on a gray background, as they do not apply to the Gaps command. Reporting Gap Ranges and Missing Items You can select List Gap Ranges or List Missing Items if you want these additional items reported in the command log. The default is to test for a gap range. To test for a gap range: 1. Make sure the Gaps dialog box is open. 2. In the Sequence On list view, click Check_No. You can only select one key field for each gap test. 3. List Gap Ranges is already selected. 4. If you are not sure if the Sequence On field is sorted, check the Presort check box.
Module 3 Understanding Data 111 Testi ng for Sequences, Dupl i cates, and Gaps 5. Click [OK]. ACL reports that there is one gap in the check number sequence. ACL lists the check numbers on either side of each gap range, so you can see where the gaps exist. Reporting Missing Items To use the Gaps command to list each missing check number separately: 1. Select Analyze from the menu bar and choose Gaps. ACL displays the Gaps dialog box with the Gaps check box selected. 2. In the Sequence On list view, select Check_No. 3. Click List Missing Items. The Maximum Missing Items text box becomes available. You can now specify a limit on the number of missing check numbers that ACL lists in each range. 4. Click [OK]. ACL reports all the missing check numbers in the command log. ACL lists the check numbers inside the specified gap range. Testing Duplicates and Gaps Together You can test for duplicates, as well as gaps in the key field sequence, at the same time. To test for duplicates and gaps at the same time: 1. Click (Duplicates), or select Analyze from the menu bar and choose Duplicates to open the Duplicates dialog box. 2. In the Sequence On list view, click Check_No. You can only test for sequence errors on a single key field. 3. Select both the Gaps and Duplicates check boxes. 4. To ensure that the Sequence On field is sorted, check the Presort check box. 112 ACL for Windows 7 Workbook Testi ng for Sequences, Dupl i cates, and Gaps 5. Click [OK]. ACL reports the total for both gaps and sequence errors. The number of data sequence errors in this test is zero. The total number of gaps is one, indicating that there is one gap. Since you left the List Gap Ranges option button selected, the numbers on each side of the gap are reported to make identifying the missing checks simple. In this case, the gap includes four missing checks, numbers 12389 to 12392. Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit. 113 Module 4 MANIPULATING DATA In Module 4, you will learn how to manipulate data for various purposes. You will use: Extract to extract selected records or fields from the current file and copy them to a different file Export to create a file that can be used directly by other software programs, such as Word or Excel, for further processing Sort to actually sort the data in a file and create a new sorted input file Index to create an index that reorganizes the data in a view Stratify to count and total records in specified ranges Age to summarize date intervals Histogram to produce graphical overviews of the contents of an input file Join, Relations, and Merge to combine input file fields Sample to create record or monetary unit samples, Size to determine the appropriate size for samples, and Evaluate to determine the effect of errors detected in your sampling results 4 114 ACL for Windows 7 Workbook Extracti ng Data Lesson 4.1 Extracting Data You can use the Extract command to select specific records from a large file in order to work with those records in a smaller file. Extracting records or fields to a separate file can significantly reduce your processing time and disk space requirements. You can also use the Extract command to extract data to a new file, isolating unusual items for separate analysis. Extract copies a subset of some or all of the records or fields in an input file and creates a data file of the extracted records. Records in the original data file are unchanged. ACL automatically creates an input file definition for the new data file. When you execute the Extract command, you create an output file to hold the data you are extracting. This output file, in turn, becomes an input file for further analysis. Opening Your Project To prepare for this lesson: 1. Open the Workbook.acl Project. For details on how to open an ACL Project and an input file definition, see Lesson 2.4: Overview Window on page 57. 2. In the Overview window, select Inventory and drag and drop it onto the (Open) button to open the default view of the Inventory input file that uses the data file Inventory.fil. Working with the Extract Command To work with the Extract command: 1. Create a filter to choose the records you want to extract. 2. Obtain control totals by running the Total command before you extract the records. 3. Extract the records to a new input file. 4. Run the Total command to compare the totals of the new input file with the control totals. Creating a Filter You can use the Extract command to analyze records for products in a remote warehouse. In the Inventory input file, this warehouse is defined as location 05. To define a local filter to make it easier to work only with the records for location 05: 1. Select Analyze from the menu bar and choose Count to open the Count dialog box. 2. Click [If] to open the Expression Builder.
Module 4 Manipulating Data 115 Extracti ng Data 3. In the Available Fields list view, double-click Loc. The Loc field is copied to the Expression text box. 4. Click in the set of buttons in the center of the Expression Builder. The equals sign is copied to the Expression text box beside Loc. 5. Enter "05" for location code 05 beside the equals sign in the Expression text box. 6. Click in the Save As text box and enter LOC05 to name the filter. 7. Click [OK] to save the filter and close the Expression Builder. The Count dialog box reappears. 8. Click [OK] in the Count dialog box to issue the Count command. The command log reports that 13 of the 152 records met the condition. Verifying the Control Totals Before you extract records for location 05, you should verify the control totals for that location using the Total command. 116 ACL for Windows 7 Workbook Extracti ng Data To obtain control totals for numeric fields: 1. Click (Total) or select Analyze from the menu bar and choose Total to open the Total dialog box. 2. Click [Total Fields] to display the Selected Fields dialog box. 3. Click [Add All]. 4. Click [OK] to return to the Total dialog box. All the fields will be highlighted. 5. Click [If] to open the Expression Builder. The filter you created, LOC05, is in the Filters box. 6. Double-click LOC05. The filter is copied to the Expression text box. 7. Click [OK] to close the Expression Builder and return to the Total dialog box.
Module 4 Manipulating Data 117 Extracti ng Data 8. Click [OK] in the Total dialog box to issue the Total command. 9. ACL shows the LOC05 filter totals in the command log. Extracting Records to an Output File This exercise takes you through the process of creating an output file. The output file, once again, is a new data file containing a copy of the extracted records and an input file definition. You must enter a name for the output file. To extract selected records to an output file: 1. With the Inventory file open, click (Extract) or select Data from the menu bar and choose Extract. The Extract dialog box appears. Leave Record selected (as it is by default) to extract all the records for the location 05 warehouse. 2. Click [If] to open the Expression Builder. 118 ACL for Windows 7 Workbook Extracti ng Data 3. In the Filters list box, double-click LOC05, the filter that you created in the exercise on Creating a Filter on page 114. LOC05 is copied to the Expression text box. 4. Click [OK]. The Expression Builder closes. The expression LOC05 is now in the If text box. 5. In the To text box, enter Location05 to name the output file. Note that the Use Output File check box is checked. When ACL executes the Extract command, it will also open the new input file definition in the view. 6. Click [OK]. The results of the extract appear in the command log. The new input file definition opens automatically in the View window. 7. Click Input File Definitions in the Overview window to display the list. The new definition, Location05, is in the list. Looking at the columns in the View window, you can see that ACL has created an input file that contains field definitions identical to those in the original file, including computed fields. Because you extracted records, not individual fields, each extracted record is identical to the record in the original data file. If you scroll the view to the right, you can see that the fields you defined previously are included in the new view.
Module 4 Manipulating Data 119 Extracti ng Data Naming Output Files Automatically You can set a preference to automatically name output files. Command options in the Edit ACL Preferences dialog box provide an Automatic Output Filenames option for output files. When this option is turned on, ACL suggests names for data files created by a command. This name consists of the command name and an incremental number starting at 01. You can accept the name or enter a different name. To set the Automatic Output Filenames preference: 1. Select Edit from the menu bar and choose Preferences to open the Edit ACL Prefer- ences dialog box. 2. Click the [Command Options] tab. The dialog box changes to show the available options for commands. 3. Check the Automatic Output Filenames check box. 4. Click [OK] to accept the setting and close the Edit ACL Preferences dialog box. Verifying Control Totals You should also check the control totals to make sure they match the totals you obtained earlier for the inventory input file. To confirm the control totals: 1. Click (Total) or select Analyze from the menu bar and choose Total. ACL displays the Total dialog box. 2. Click [Total Fields]. 3. Click [Add All] and then click [OK]. 4. Click [OK] again to issue the Total command. ACL displays the result in the command log. The results should match the earlier Total results which you can view by scrolling up in your command log. Extracting Fields to an Output File You can extract all the defined fields to a new file. You might want to do this if the file is large, but only a small number of fields have been defined. Extracting All Fields To create a file of all the defined fields: 1. In the Overview window, select Inventory and click (Open) to open the default view of the Inventory input file that uses the data file Inventory.fil. 120 ACL for Windows 7 Workbook Extracti ng Data 2. Click (Extract) or select Data from the menu bar and choose Extract. ACL displays the Extract dialog box. 3. Select Fields. 4. Click [Extract Fields]. 5. Click [Add All] and then click [OK]. 6. Click in the If text box and enter LOC05. This tells ACL to extract records for location 05 only, using the local filter you defined earlier. 7. You will notice in the To text box that an output file name has automatically been suggested. EXTR01 has been chosen because this is the first (01) output file you have created with the Extract command. 8. Click in the To text box and enter Location5A to change the name of the new file. 9. Click [OK]. ACL executes the command and opens the new input file definition in the View window. 10. Notice that ACL changed the order of the fields for the 13 records and arranged the columns in alphabetical order by field name. Extracting Selected Fields You have complete control over the fields you extract. ACL extracts only the fields you select, in the order you select them, to the new input file. Extracting selected fields makes it easy to create smaller files that contain only the information with which you are inter- ested in working. To extract some fields from the Inventory input file: 1. Click the Input File box at the right end of the status bar. The Select Input File Definition dialog box appears. 2. In the Select Input File Definition list box, double-click Inventory. ACL opens the Inventory input file and its default view. 3. Click (Extract) or select Data from the menu bar and choose Extract. ACL displays the Extract dialog box. 4. Select Fields. 5. Click [Extract Fields]. 6. In the Available Fields list view, double-click ProdNo, ProdDesc, QtyOH, and Value to add the fields to the Selected Fields list box. Note: ACL converts computed fields to the appropriate field type: ACL, ASCII, or LOGICAL.
Module 4 Manipulating Data 121 Extracti ng Data 7. Click [OK] to close the Selected Fields dialog box. If you scroll down, you will see that the fields you selected are highlighted in the Extract Fields box. 8. In the Extract dialog box, click in the If text box and enter LOC05. This instructs ACL to extract fields for location 05 only, using the local filter you defined earlier. 9. Click in the To text box and enter Location5B to change the name of the output file ACL will create for the new information. 10. Uncheck the Use Output File check box. 11. Click [OK]. ACL creates the input file and shows the result in the command log. 12. In the Overview window, expand Input File Definitions to view the list. Click and drag the new input file name, Location5B, to the application workspace. The new input file definition opens. For more information on opening a file, see Opening an Input File on page 60. Comparing Date Values You can also use Extract to compare a date field value in the data file to a date field constant. For example, you can list all of the transactions in the file that have a due date before January 2, 2000. To do this, you need to compare the value of the due date field to the value of January 2, 2000. ACL treats dates as an integral data type, therefore you can compare dates by enclosing them in reverse quotes using the YYMMDD or the YYYYMMDD format. To extract only the transactions in the Ar file that have a due date prior to January 2, 2000: 1. In the Overview window, drag Ar from the input file definitions onto the application workspace. 2. Click (Extract) or select Data from the menu bar and choose Extract. ACL displays the Extract dialog box. 3. Select Fields. 4. Click [Extract Fields], click [Add All], and then click [OK]. 5. Click in the If text box and enter DUE < `000102`. Use the back quote (`) that is usually located on the key with the tilde (~) (upper left side on most keyboards). 6. Click in the To text box and enter PRE0102 to name the output file definition. Important: When you use reverse quotes, ACL treats the date given within the quotes as an integral data type. The format must be YYMMDD or YYYYMMDD. Any other format is invalid. 122 ACL for Windows 7 Workbook Extracti ng Data 7. Click [OK] to execute the command. ACL displays seven items that have a due date prior to January 2, 2000 in the View window. The command log shows the details of the action. Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit.
Module 4 Manipulating Data 123 Exporti ng Data Lesson 4.2 Exporting Data You can export data from ACL for further processing in other software packages. Opening Your Project To prepare for this lesson: 1. Open the Workbook.acl Project. For details on how to open an ACL Project and an input file definition, see Lesson 2.4: Overview Window on page 57. 2. Drag and drop Inventory onto the (Open) button to open the default view of the Inventory input file that uses the data file Inventory.fil. What is Exporting Data? When you use the Export command, ACL converts data into a format that other software packages can read and saves it as an export file. You can use the Export command to: Produce a mail merge document to export to a word processor to prepare confir- mation letters Export data fields to a complex presentation graphics package Export specific fields to a software system with reporting functionality that is different from ACL Exporting All Fields To export data to a new file: 1. Select Data from the menu bar and choose Export. ACL displays the Export dialog box. 124 ACL for Windows 7 Workbook Exporti ng Data 2. Click [Export Fields] to open the Selected Fields dialog box. 3. In the Selected Fields dialog box, click [Add All]. The list of Available Fields is copied to the Selected Fields box. 4. Click [OK] to close the Selected Fields dialog box and return to the Export dialog box. ACL highlights all the fields in the Export Fields list view. 5. Click the drop-down arrow in the Export As area. 6. Select Delimited [,] from the drop-down list. The Export command places quotes around date fields (in addition to character strings) when you export to a delimited file.
Module 4 Manipulating Data 125 Exporti ng Data 7. Click in the To text box and enter Invent. ACL exports the data to this file. 8. Click the [More] tab to display additional options. The Append To Existing File check box gives you the option to append the output to an existing file. This time, however, leave the check box unchecked. 9. Click [OK] to close the dialog box and execute the command. ACL also creates the Invent file with the appropriate extension, in this case, .del for Delimited. The result appears in the command log. 126 ACL for Windows 7 Workbook Exporti ng Data The file is ready to use in any compatible program. Exporting Selected Fields The following table shows how ACL field types are exported: To export selected fields: 1. With the Inventory file open, select Data from the menu bar and choose Export. ACL displays the Export dialog box. 2. In the Export Fields list view, click ProdNo. Then CTRL+CLICK, in this order, ProdDesc, QtyOH, and Value. When you export data fields, select the fields in the order that you want them to appear in the new file. For example, to display address information in the correct order in a word processing merge file, select the name first, then the address. 3. Select Excel from the Export As drop-down list. 4. Click in the To text box and enter Invent2. 5. Click [OK]. ACL creates the file and displays the result. The file is ready to use in the appropriate program. Field Type Output ASCII Character Same length as the original file. ACL Computed Numeric Twelve bytes wide unless you have changed the default width using the Field Width preference. See Changing Column Width on page 73. Logical One byte (containing either a T or F). Numeric Length is determined by the maximum size number that can be contained in the field [number of digits + 1 (for the sign) + 1 (for the decimal point, if decimals > 0)].
Module 4 Manipulating Data 127 Exporti ng Data Exporting to Other Applications You can now export the data that you want to use in another software package. The following table shows the different formats and programs to which you can export data: Format (type of file generated) Extension Comments Plain Text (ASCII) .txt Also referred to as undelimited SDF by some software. Each field is adjacent, with no dividers. There is a CR/LF combination at the end of each line. dBase (dBase III+ database) .dbf Fully compatible with dBase IV and most dBase compatible products, this format correctly translates dates, as well as character, numeric, and logical fields to their dBase equivalents. Delimit (comma delimit) .del Fields are separated by commas and character strings are enclosed in quotes. Also referred to as CSV. Excel (Excel XLS worksheet) .xls Fully compatible with all versions of Excel and other packages that read Excel files. Excel exports are limited to 255 columns (fields). Lotus (Lotus 123 worksheet) .wks A version 1 WKS file, that is fully compatible with all subsequent Lotus versions, as well as any packages that read Lotus files. Date fields are correctly converted to Lotus dates. Numeric fields display with the correct number of decimals, and character and logical fields are transferred as labels. Column widths are automatically adjusted to reflect the width of the data in each field. WKS files are limited to 2048 rows or records. Although packages such as Excel can read WKS files, they will only read in the first 2048 records. To overcome this restriction, you can export in dBase format, or one of the other formats readable by your spreadsheet. Word (Microsoft Word mail merge) .doc The file created by ACL can be used as the secondary file in a Word mail merge. The file has a tab-delimited format that can also be read by Excel. 128 ACL for Windows 7 Workbook Exporti ng Data Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit. WordPerfect (WordPerfect secondary merge) .wp Can be directly merged with a WordPerfect document. Clipboard Copies the selected fields to the clipboard in a tab-separated format that can be pasted directly into most spreadsheet and word processing applications. Format (type of file generated) Extension Comments
Module 4 Manipulating Data 129 Sorti ng and I ndexi ng Lesson 4.3 Sorting and Indexing Use the Sort and Index commands to arrange records in physical or logical order for analysis or producing a report. Sort organizes records in the current input file in ascending or descending order, based on specified key fields. It creates a new data file that has been reordered. Index creates an index file, also based on key fields, that can be named, saved, and applied to an input file at any time. Indexing reorders records in a view. It does not create a new data file. Saved indexes and sorted input files are listed in the Overview window. 4When deciding whether to use Sort or Index, keep in mind that accessing an indexed file is slower than a sorted file, but indexing is faster than sorting. Opening Your Project To prepare for this lesson: 1. Open the Workbook.acl Project. For details on how to open an ACL Project and an input file definition, see Lesson 2.4: Overview Window on page 57. 2. From the Overview window, drag and drop Ap_Trans onto the (Open) button to open the default view of the Ap_Trans input file that is linked to the data file Ap_Trans.fil. Control Totals When you use an ACL command that produces a file, you can create control totals for the numeric fields. Control totals allow you to check files that you use repeatedly for completeness and consistency. To create control totals for numeric fields: 1. With the Ap_Trans input file definition open, click (Total) or select Analyze from the menu bar and choose Total to open the Total dialog box. 130 ACL for Windows 7 Workbook Sorti ng and I ndexi ng 2. Select the Invoice_Amount field. 3. Click [OK] to issue the Total command. 4. The control total for Invoice_Amount appears in the command log. Using the Sort Command When you perform a sort, ACL physically reorders the records and creates a data file arranged in the sorted sequence. Sorting requires both memory and disk space, so you should ensure that your system has adequate resources before using the Sort command. ACL will use as much extended or expanded memory as is available to Windows on your system. As a general rule, allow disk space of at least 2.5 times the size of the file you want to sort.
Module 4 Manipulating Data 131 Sorti ng and I ndexi ng Because sorting takes time and processing power, you may want to avoid sorting large data files. For example, you can use the Classify and Stratify commands instead of Sort and Summarize to achieve the same results with unsorted data. Specifying Sort Fields To sort a file, specify the fields that you want ACL to sort. You can sort character, numeric, date, and computed fields. ACL sorts fields in the order in which you select them. For example, the first field selected is the first sort field, the second field is the second sort field, and so on. As is usual with sorting, a second sort is performed within a first sort, and a third sort within a second sort. Sorting on a Single Field To sort a file in ascending order (from the lowest to the highest number): 1. Click (Sort) or select Data from the menu bar and choose Sort. ACL displays the Sort dialog box. 2. In the Sort On list view, click Vendor_No. 132 ACL for Windows 7 Workbook Sorti ng and I ndexi ng 3. Click in the To text box and enter the name Sortvend. 4. Click [OK] to issue the Sort command. The dialog box closes and ACL opens the new sorted input file in the new default view for the new data file Sortvend.fil. The command log displays the results. 5. In the View window, use the scroll bar to scroll to the bottom of the view. You can see that all the records are now sorted by vendor number. Verifying the Sort Sequence Use the Sequence command to verify that the file is sorted on the field you specified. To verify the sort sequence: 1. Select Analyze from the menu bar and choose Sequence. The Sequence dialog box appears. 2. In the Sequence On list view, select Vendor_No. 3. Make sure both the Gaps and Duplicates check boxes are unchecked. 4. Click [OK]. The command log displays a message informing you that there are no data sequence errors. This proves that the file is sorted correctly by Vendor Number. Verifying the Totals To verify the total for the new file, issue the Total command for the Invoice_Amount field. For more information, see Lesson 3.3: Totaling Fields on page 99 for details on using the Total command. Compare the total to the one you obtained earlier for the Ap_Trans input file. The totals should be the same.
Module 4 Manipulating Data 133 Sorti ng and I ndexi ng Sorting on Multiple Fields You can sort on multiple fields in the same file. You can even sort one field in ascending order and another field in descending order. You could, for example, want to produce a report listing all vendors by Vendor Number and the Invoice Amount in descending order so that the largest amount for each vendor is displayed first. To sort the Ap_Trans file by Vendor Number and, within each Vendor Number, by the Invoice Amount in descending order: 1. In the Overview window, drag and drop Ap_Trans onto the (Open) button to open the Ap_Trans input file. 2. Click (Sort) or select Data from the menu bar and choose Sort. ACL displays the Sort dialog box. 3. Click [Sort On] to display the Selected Fields dialog box. 4. In the Available Fields list view, double-click Vendor_No to copy it to the Selected Fields list box. Notice that an (ascending) arrow appears next to the Vendor_No in the Selected Fields list box to indicate an ascending sort order. 5. Double-click the Invoice_Amount field to copy it to the Selected Fields list box, and click the arrow next to Invoice_Amount so that it points downward, indicating a descending sort order. The Selected Fields dialog box should now look like this: 6. Click [OK] to return to the Sort dialog box. 134 ACL for Windows 7 Workbook Sorti ng and I ndexi ng 7. Click in the To text box and enter the name Sortvip. 8. Click [OK] to issue the Sort command. ACL displays the new sorted input file in the View window. The command log displays the result. You can see that the file is now arranged in ascending order by Vendor Number and in descending order by Invoice Amount within each Vendor Number.
Module 4 Manipulating Data 135 Sorti ng and I ndexi ng Rearranging Sorted Columns You can rearrange the columns in the view to reflect the new sort order of the file and to make the sort order more visually apparent. To move the Product Number column to the immediate right of the Invoice Number column: 1. Point to the Product Number column heading. Click and hold down the left mouse button. The pointer becomes a (Hand). Drag and drop it on the right side of the Invoice Number column heading. ACL moves the Product Number column to the right of the Invoice Number column. 2. Click any record in any column to remove the highlighting. Searching for Specific Records One of the benefits of sorting a file is that you can search for specific records very quickly. The more records a file contains, the more apparent the increase in search speed. The Sortvip file you created in the last exercise has 102 records, therefore the increase in search speed is only moderate. To search for the first record with the vendor number 13373: 1. Select Analyze from the menu bar and choose Search. ACL displays the Search dialog box. 2. Select Locate If. 136 ACL for Windows 7 Workbook Sorti ng and I ndexi ng 3. Click [Expr...]. ACL displays the Expression Builder. 4. In the Available Fields list view, double-click Vendor_No. ACL copies Vendor_No to the Expression box. 5. Click to copy the equals sign to the Expression box beside Vendor_No. 6. Enter "13373". The expression looks like this: Vendor_No = "13373". 7. Click [OK] to close the Expression Builder. ACL displays the command in the Expr text box of the Search dialog box. 8. Click [OK] to issue the Search command.
Module 4 Manipulating Data 137 Sorti ng and I ndexi ng The command log shows that the first record in the file that matches the Vendor Number is record number 80. If you know the record number, you can select the Locate Record option button and enter the record number in the Expr text box. The Locate Record and Locate If options in the Search dialog box work with sorted, unsorted, or indexed input files. Using the Index Command You can use the Index command to sequence data in a logical rather than physical order. Index creates a file containing pointers that allow ACL to read data in the sorted order, even though the records in the original input file are not sorted. As with Sort, you can index any number of key fields. ACL establishes relationships between two or more files through indexing. With Index you can conduct a much faster search. Since a new data file is not created, you save disk space. Choosing Sort or Index The following table outlines and compares the Sort and Index commands. Sort vs. Index For comparison purposes, you will index the file on the same fields you used in the previous sort. Item Sort Index 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 138 ACL for Windows 7 Workbook Sorti ng and I ndexi ng To open the Ap_Trans input file, select the Ap_Trans input file definition from the Overview window and drag it onto the application workspace. Creating an Index To create an index of the Ap_Trans input file: 1. With the Ap_Trans file open, click Indexes in the Overview window. 2. Click (New). ACL displays the Index dialog box. 3. In the Index On list view, click Vendor_No. 4. CTRL+CLICK Invoice_No and then ProdNo. ACL indexes in the order you choose the fields. 5. Click in the To text box and enter the name Indvip to name and save the index. 6. Click [OK]. ACL creates an index and links it to the input file. In the Overview window, Indvip is listed under Indexes. The Use Output File option is selected by default, so ACL immediately applies the index. The command log and status bar both indicate that the index is open. Note: You do not have to immediately use the indexes you create. You can uncheck the Use Output File check box in the Index command dialog box when you want to link an input file to an index later.
Module 4 Manipulating Data 139 Sorti ng and I ndexi ng The Overview window displays the newly-created index under Indexes and under the Ap_Trans input file definition. Expand Ap_Trans or Indexes to see that an index for Ap_Trans now exists. Status bar indicates the number of records indexed Overview lists index file under Ap_Trans and under Indexes. 140 ACL for Windows 7 Workbook Sorti ng and I ndexi ng Searching for Key Values in an Indexed File When an index is active, ACL can access the data in the input file in logical order. You can use an index to quickly search for and locate specific records. For example, if you want to find the invoices for a specific vendor you can use the Find Literal option of the Search command. Using the Find Literal Option To find invoices for Vendor Number 12433: 1. With the Indvip index open, select Analyze from the menu bar and choose Search. ACL displays the Search dialog box. Find Literal is selected by default. 2. Enter 12433 in the Expr text box. In this case, the character string you specify in the text box cannot be surrounded by quotes. 3. Click [OK]. ACL applies the search to the view. ACL positions the records for Vendor Number 12433 at the top of the view.
Module 4 Manipulating Data 141 Sorti ng and I ndexi ng The Find Literal and Seek Expression options of the Search command can only be performed on indexed files. In addition, the file must be indexed on at least one character field in ascending order. To use the Seek Expression option, you must specify a character-type expression, rather than a literal character string. In the case of Seek Expression, always enclose the character string in quotes. This allows you to include leading or trailing blanks in the search string. Use the Search command with the Seek Expression option to search for the first match for Vendor Number 12701: 1. With the Indvip file open, select Analyze from the menu bar and choose Search to display the Search dialog box. 2. Select Seek Expression. 3. Enter "12701" (note the matching double quotes) in the Expr text box. 4. Click [OK]. The records containing Vendor No. 12701 are moved to the top of the View window. Creating a Conditional Index You can index a portion of a file, instead of the whole file, by specifying a condition. If you create and use a conditional index, you access only the records included in the condition. This is a useful feature when you want to use only a subset of a large file. For example, you can work with just the records for a specific vendor. The Ap_Trans view that you create in the following lesson lists six records using this index condition. To create a conditional index for Vendor Number 12433: 1. Select Data from the menu bar and choose Index. ACL displays the Index dialog box. 2. In the Index On list view, click on Vendor_No to select it. 3. In the If text box, specify the condition by typing Vendor_No = "12433". 4. In the To text box, name the index file by typing Vend12433. 5. Click [OK]. ACL creates the Vend12433 index and immediately applies it to the view. Because ACL immediately applies this conditional index, it displays only those records that meet the condition. You see only the six records for vendor 12433 in the view. The middle of the status bar tells you that a filtered index is in effect. All the records are still in the file, and once you remove the conditional index, they will all be displayed. 142 ACL for Windows 7 Workbook Sorti ng and I ndexi ng Opening an Index File You can have more than one index per file, but you can only work with one index at a time. To open an index file: 1. In the Overview window, expand Input File Definitions to view the list of input file definitions. 2. Expand the Ap_Trans file. ACL uses the index icon to show any indexes associated with that file. The Ap_Trans file has two indexes, one named Indvip, which you created in the exercise on Creating an Index on page 138, and a condi- tional index named Vend12433 which you created in the exercise on Creating a Conditional Index on page 141. 3. Select the Indvip index and drag and drop it onto the application workspace. ACL opens the default view of the Ap_Trans using the Indvip index. Any previously opened index closes. The center box on the status bar indicates the input file is indexed. 4. Select the Vend12433 index again and drag and drop it onto the application workspace. ACL closes the present index and opens the default view of Ap_Trans using the Vend12433 index. The center box on the status bar indicates this is a filtered (conditional) index. Because a filter is in effect, there are fewer records in the view. Only the records meeting the condition are displayed. Closing an Index File When you finish working with an index, you may want to close the active index file. To close an index file: 1. In the Overview window, expand Indexes to display the list of Indexes. ACL displays next to the active index. 2. Click the name of the active index file and click (Close). ACL returns to the unsorted view of the file. Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit.
Module 4 Manipulating Data 143 Summari zi ng and Cl assi fyi ng Lesson 4.4 Summarizing and Classifying There are two approaches to summarizing data with ACL. Use the Classify command to count the number of records relating to a unique key character field value and to accumulate totals of specified numeric fields for each key value. Use the Summarize command to generate a record count and numeric field value totals for each distinct key value for one or more character or date fields in a sorted file. In this lesson, you compare the results of the Classify and Summarize commands. You also learn more about when to use each command. Opening Your Project To prepare for this lesson: 1. Open the Workbook.acl Project. For details on how to open an ACL Project and an input file definition, see Lesson 2.4: Overview Window on page 57. 2. Drag and drop the Ap_Trans input file definition from the Overview window onto the (Open) button to open the default view of Ap_Trans that is linked to the data file Ap_Trans.fil. Using the Classify Command You can use Classify to quickly scan and summarize records, based on each unique class in a field. You can use Classify on unsorted data. The number of classes you can summarize depends on the Max RAM preference. A practical limit for the default Max RAM setting is 10,000 classes. For details on changing the Max RAM preference, seeMax RAM (MB) on page 333. Classify counts the number of records that fall into each stratum of a character field and accumulates totals for each stratum of a numeric field. Classify can also be used to produce a new input file of classified data or view classified data in the command log. To classify data: 1. Click (Classify) or select Analyze from the menu bar and choose Classify. ACL displays the Classify dialog box. 144 ACL for Windows 7 Workbook Summari zi ng and Cl assi fyi ng 2. Click the Classify On drop-down list and select the Vendor_No field. 3. Select Invoice_Amount in the Accumulate Fields list view. 4. Click the [Output] tab to display the Output options. Note: Only character fields appear in the Classify On drop-down list.
Module 4 Manipulating Data 145 Summari zi ng and Cl assi fyi ng 5. Screen is selected by default. This means the output will be displayed on the screen. You can also send the output to a printer, graph, or file. 6. Click [OK] to close the Classify dialog box and execute the command. 7. ACL displays the result in the command log. The Count field shows the number of records in each interval. The fourth column tells you the percentage of the invoice amounts for each vendor. ACL displays the accumulated totals for each vendor in the last column. You can see at a glance which vendors have the greatest total value. Classify provides the percentages of record counts and invoice amounts for each vendor. Printing the Result of the Classify Command If you want to print the classified data as it is shown in the command log: 1. Click the drop-down list in the command log and select Last Result. 2. Select File from the menu bar and choose Print. 3. Click [Print] to print the window. You can also click the Output tab in the Classify dialog box and select the Print option button to send the output to the printer. Creating an Input File of Summarized Data You can store the results of a Classify or Summarize command in an output file. You may want to create a separate file so you can later process the classified or summarized infor- mation. Vendor number Percentage of items per classified field Percentage of total invoice amounts Accumulated totals per classified field No. of records per classified field 146 ACL for Windows 7 Workbook Summari zi ng and Cl assi fyi ng When you store summarized or classified data to a file, ACL creates a Count field. This Count field and all the accumulated fields are stored in an ACL file type. This does not affect how you work with the data in the file, only how ACL stores the summarized infor- mation. To create a file that contains the results of the Classify command: 1. Click the Classify command line in the command log. ACL copies the command line to the text box to the right of the command log. 2. Click the (Edit Command). ACL displays the Classify dialog box with the same parameters specified in the command line. 3. Click the Output tab to display the Output options. 4. Click File to save the result to a file. 5. Click in the Name text box and enter Classven. 6. Click [OK] to close the Classify dialog box. ACL creates the Classven file that contains the classified data. 7. Find Classven and drag it out of the Overview window to open it. Notice that ACL lists the Count column after the Vendor Number, followed by the Percent of Count and Percent of Field columns. This is the same order as in the command log. Remember that you can use the Overview window to quickly see all the files and views in your Project at any time. Using the Summarize Command The Summarize command generates a record count and accumulates totals of numeric fields for each unique value of key character or date fields. Summarize is particularly useful with large input files, as it can report on a limitless number of unique key field values. Summarize allows you to use date fields as key fields. It also allows you to select multiple key fields in combinations of date and character fields. Use Summarize for data files that contain more than 50,000 records. Summarize also lets you include other character or numeric fields in the summary file. This is useful when the field value of the other field is constant in the summarized group. For example, if you summarize on customer number and customer name, the summary shows that there is a one-to-one relationship between these fields. Summarize allows you to create a comprehensive report.
Module 4 Manipulating Data 147 Summari zi ng and Cl assi fyi ng The Summarize command requires a sorted file. However, the Presort option is selected by default so you do not need to run the Sort command separately. To summarize the input file on the key character fields: 1. Select Data from the menu bar and choose Summarize to open the Summarize dialog box. The Summarize On list view lists date and character fields, as well as expressions. 2. In the Summarize On list view, click Vendor_No. 3. In the Accumulate Fields list view, click Invoice_Amount. 4. Click the [Output] tab to display the output options. 5. Select File. 6. Click in the Name text box and enter Sumven. 7. Click the [Main] tab to return to the main options. 8. To ensure that the Summarize On field is sorted, check the Presort check box. The Summarize dialog box now looks like this: 148 ACL for Windows 7 Workbook Summari zi ng and Cl assi fyi ng 9. Click [OK] to close the Summarize dialog box and execute the command. ACL opens and displays the result in the new Sumven.fil view. ACL creates one record for each Vendor Number and displays the totals for the accumulated field Invoice_Amount. ACL also summarizes the total number of records in each Vendor Number in the Count column. Data Type ACL When you use the Summarize or Classify commands to create a new file, ACL creates the Count field and assigns it and all the accumulated fields the data type ACL. This type indicates how ACL stores summarized information. To view the data types: 1. If it is not already open, drag the Sumven input file definition out of the Overview window to open it. 2. Click (Edit File Definition) or select Edit from the menu bar and choose Input File Definition to open the Input File Definition window. Make sure that the [Edit Fields/Expressions] tab is selected. The field names and data types for the current file are listed on the screen.
Module 4 Manipulating Data 149 Summari zi ng and Cl assi fyi ng In this example, the Count field is an ACL type, as is the Invoice_Amount field, which also contains summarized information. 3. Close the Input File Definition window and return to the view. Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit. 150 ACL for Windows 7 Workbook Strati fyi ng Data Lesson 4.5 Stratifying Data Use the Stratify command to summarize specified intervals of numeric data in a file. Stratify counts and totals the number of records that fall into specified intervals, or strata, of numeric fields or expression values. You can specify equally-sized intervals using the Intervals option or you can specify varying-sized intervals using the Free option. You do not need to sort or index the data. Opening Your Project To prepare for this lesson: 1. Open the Workbook.acl Project. For details on how to open an ACL Project and an input file definition, see Lesson 2.4: Overview Window on page 57. 2. Drag the Ap_Trans input file definition from the Overview window and drop it onto the (Open) button to open the default view of the Ap_Trans input file definition that is linked to the data file Ap_Trans.fil. Stratifying Data Stratifying data involves two operations: 1. Obtaining maximum and minimum values 2. Stratifying the data Obtaining Maximum and Minimum Values First, run either the Profile or the Statistics command to generate minimum and maximum values for the field to be analyzed. These values then appear by default in the Maximum and Minimum text boxes of the Stratify dialog box. To profile the numeric fields: 1. Select Analyze from the menu bar and choose Profile to display the Profile fields dialog box.
Module 4 Manipulating Data 151 Strati fyi ng Data 2. Click Invoice_Amount in the Profile Fields list view. 3. Click [OK]. The total, absolute value, minimum, and maximum amounts for the Invoice_Amount field appear in the command log. To obtain statistics on the numeric fields: 1. Select Analyze from the menu bar and choose Statistics to display the Statistics dialog box. 152 ACL for Windows 7 Workbook Strati fyi ng Data 2. Click Invoice_Amount in the Statistics On list view. 3. Click [OK]. The command log displays statistics for the Invoice_Amount field. The Stratify command uses the minimum and maximum values. Stratifying a Data File To stratify a data file: 1. Click (Stratify) or select Analyze from the menu bar and choose Stratify. ACL displays the Stratify dialog box. 2. Invoice_Amount is displayed in the Stratify On drop-down list. Note that the Minimum and Maximum values from the Profile result are entered in the appro- priate text boxes.
Module 4 Manipulating Data 153 Strati fyi ng Data 3. In the Accumulate Fields list view, click Quantity, and then SHIFT+CLICK Unit_Cost. The Stratify dialog box now looks like this: You can enter different minimum and maximum values if, for example, you do not want to perform the Stratify command on the entire population. For now, leave the default values. The Intervals option button is selected. 4. Click [OK]. ACL displays the result. Number of items in each value interval Percentage of items in each value interval Percentage of total quantity Total quantity Total unit cost 154 ACL for Windows 7 Workbook Strati fyi ng Data The Invoice_Amount column lists the ten equal minimum and maximum value intervals ACL has created. The Count column lists the number of items in each value interval. You can see that the majority of the items are included in the first two ranges. You can also see that there is one instance of a high Invoice Amount in the last range. The next column, <--%, tells you the percentage of the number of items in each value interval, based on the total number (Count). The percentage of the total quantity on hand column, %-->, is based on the column to its right (in this case, the Quantity column) and is always performed for the first field to be accumulated. Changing the Intervals If you want to concentrate on the distribution of the values, you can adjust the intervals on a numeric field to suit the population. You can specify a different number of even intervals, or any number of intervals of any size, called free intervals. You can also narrow the range to take a more specific look at the records clustered in the first two intervals. The first stratification shows that these two ranges contain a dispro- portionate number of items. To evaluate the contents of these two ranges, you can limit the upper range to 11,400, as the largest value included is $11,365.34. To adjust the intervals: 1. In the command log, click the Stratify command line. This copies the command into the text box on the right of the window. 2. Click (Edit Command) to open the Stratify dialog box. 3. Click Free and then enter the following in the text box: 10 500 1000 2500 5000 8000 11400 Note: ACL calculates the above on unsorted data.
Module 4 Manipulating Data 155 Strati fyi ng Data 4. Click [OK]. ACL displays the result in the command log. You can see that the largest percentage of items is in the 10.00 to 499.99 interval. Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit. 156 ACL for Windows 7 Workbook Agi ng Data Lesson 4.6 Aging Data The Age command produces aged summaries on unsorted data. You can either specify a cutoff date, or let ACL automatically base the aged summary on the current system date. ACL creates a Count field to display the number of records in each age period. Opening Your Project To prepare for this lesson: 1. Open the Workbook.acl Project. For details on how to open an ACL Project and an input file definition, see Lesson 2.4: Overview Window on page 57. 2. Drag the Ar input file definition from the Overview window and drop it onto the (Open) button to open the default view of the Ar input file definition that is linked to the data file Ar.fil. Aging Date Fields In your data analysis, you may want to create summary reports or classifications based on aged dates. For example, you may want to view aged data to find out the age of invoices outstanding since the end of the fiscal year or since they were issued. To use the Age command to create aged summaries on date fields: 1. Click (Age) or select Analyze from the menu bar and choose Age. ACL displays the Age dialog box.
Module 4 Manipulating Data 157 Agi ng Data 2. Select Due from the Age On drop-down list. 3. Click the Cutoff Date drop-down arrow to display the Date Selector. The default is the current system date. Select August 31, 2000. 4. In the Accumulate Fields list view, click Amount. The Age dialog box now looks like this: ACL provides the default values of 0, 30, 60, 90, 120, and 10,000 days for aging periods. These numbers indicate the lower bounds of the aging period. The last default period of 10,000 is intended to be large enough to include all overdue amounts. For further details on changing the aging periods, see Date Options on page 337. 5. Click [OK]. In the command log, ACL displays each transaction in the file that has a due date before the cutoff date, and groups the transactions using the default aging periods. Note: You can change the aging periods to any values that suit your needs. If you want to change the aging periods every time you use the Age command, change the Aging Periods preference in the Date Options tab in the Preferences dialog box. 158 ACL for Windows 7 Workbook Agi ng Data You now have a complete picture of all the aged transactions as of the current date, grouped according to the default aging periods. There are two invoices with outstanding balances aged between 90 and 119 days and another two invoices are long overdue (120 days or greater). ACL shows that $458, 062.39 of the outstanding balance is not due as of the cutoff date. To get more details on the aged records, you may want to investigate the long overdue balances further. For more information on how to work with dates see Lesson 2.3: Interpreting Dates on page 50 and Defining Data Fields on page 42. Adding a Filter Many of the items in the transaction file are credit notes, payment notes, or other trans- action-type fields. If you want to view only aged invoices, you can easily add a local filter to the Age command you just issued. To use a filter to Age a data file: 1. Click (Age) to display the Age dialog box. 2. Select Due from the Age On drop-down list. 3. Click the Cutoff Date drop-down to display the Date Selector. Select December 31, 2000.
Module 4 Manipulating Data 159 Agi ng Data 4. Click [If] to open the Expression Builder. 5. In the Available Fields list view, double-click Type. 6. Click to copy the equals sign to the Expression text box. 7. Enter "IN". The Expression Builder now looks like this: 160 ACL for Windows 7 Workbook Agi ng Data 8. Click [OK] to apply the filter and close the Expression Builder. The Age dialog box appears again with the filter in the If text box. 9. Click [OK] again to execute the command and close the Age dialog box. ACL displays only the invoices in the file, grouped according to the specified aging periods.
Module 4 Manipulating Data 161 Agi ng Data Using the AGE( ) Function The AGE( ) function calculates the number of days between two dates you specify. If you do not specify a second date, ACL selects the current system date. For example, you can use AGE( ) to compare a receivable transaction date to a year end date in order to determine account ages at year-end. The dates you enter may be in the format of a character string, in the format YYMMDD or YYYYMMDD, or a valid ACL date field in any format. Dates older than the cutoff date return a positive value, whereas dates more recent than the cutoff date return a negative value. In this exercise, you extract the customer number, transaction amount, and invoice date for all items aged more than 180 days, as of the fiscal year ended December 31, 2000. To use the AGE( ) function to perform the described task: 1. If you have closed the Workbook file, open the Workbook.acl file and drag the Ar default view from the Overview window. 2. Click (Extract) or select Data from the menu bar and choose Extract. The Extract dialog box opens. 3. Select Fields to make the Extract Fields list view available. 4. Select the No field; hold down CTRL and select the Amount and Due fields as well. 162 ACL for Windows 7 Workbook Agi ng Data 5. In the If text box, enter AGE(DUE,`001231`)>180. This expression instructs ACL to compare the date in the due field to the date December 31, 2000, which is stored in YYMMDD format. 6. In the To text box, enter Aged to name the new input file. Since the Use Output File check box is checked, ACL will open Aged in the view. The Extract dialog box now looks like this: 7. Click [OK] to execute the command. The results appear in the command log. The results show that 262 records met the test and three fields were activated.
Module 4 Manipulating Data 163 Agi ng Data The new view shows the invoices aged by more than 180 days as of the fiscal year end, December 31, 2000. Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit. 164 ACL for Windows 7 Workbook Joi ni ng, Rel ati ng, and Mergi ng Data Lesson 4.7 Joining, Relating, and Merging Data 4 Join, Relations, and Merge are commands you can use to combine information from two or more files: Use the Join command to combine fields from two sorted files into a third file. Use the Relations command to establish a relationship between two or more files. Most functions of the Join command can be done faster and more easily with Relations. Use the Merge command to combine two files with identical record structures to produce a third file. Opening Your Project To prepare for this lesson: 1. Open the Workbook.acl Project. For details on how to open an ACL Project and an input file definition, see Lesson 2.4: Overview Window on page 57. 2. Select Empmast from the list of input file definitions. 3. Click (Open) to open the Empmast file. Joining Data Files With the Join command, you can create a file that combines fields from two different files, giving you access to fields from both files in a single input file definition. You can join files of dissimilar data. But key fields must be character type, left-justified, and the same length. Use functions to harmonize key fields. If you want to join more than two files, first join one primary and one secondary file, and then join the resulting output file to a third file. What are Primary and Secondary Files? After selecting the two files that you want to join, decide which file to use as the primary file and which to use as the secondary file. View the primary file, usually the larger of the two, as the core of the join, and the secondary as its complement. You open the primary file to begin the join, then select the secondary file from the drop-down list in the Join dialog box. For example, you may choose to join 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
Module 4 Manipulating Data 165 Joi ni ng, Rel ati ng, and Mergi ng Data file. If you join a transaction file and master file, the transaction file is usually the primary file. The master file is usually the secondary file. In this lesson, Empmast is the primary file, and Payroll is the secondary file. Output Options The Join command has five output options. The output option you choose determines which records are included in the third (output) file. The five output options are: 1. Matched Records Matching records from the primary and secondary files are included in the output file. 2. Matched RecordsAll Primary Matching records from the primary and secondary files, and unmatched records from the primary file, are included in the output file. Note: Be sure to correctly identify your primary and secondary files. The results you obtain will differ if the files are reversed. Primary File Secondary File Output file contains these records Primary File Secondary File Output file contains these records 166 ACL for Windows 7 Workbook Joi ni ng, Rel ati ng, and Mergi ng Data 3. Matched RecordsAll Secondary Matched records from the primary and secondary files, and unmatched records from the secondary file, are included in the output file. 4. Matched RecordsAll Primary and Secondary All records from both the primary and secondary files are included in the output file. 5. Unmatched Records Only unmatched records in the primary file are included in the output file. Primary File Secondary File Output file contains these records Primary File Secondary File Output file contains these records Primary File Secondary File Output file contains these records
Module 4 Manipulating Data 167 Joi ni ng, Rel ati ng, and Mergi ng Data Sorting Files Before Joining You must sort the secondary file in ascending sequence on the key character fields before using Join. It is a good idea to also sort the primary file in ascending sequence on the key character fields. Though it is not essential, presorting the primary file will speed up the join. Partially sorting the primary file on the key field (for example, when doing a join on an account code where the primary file is sorted by account code within each month), moderately decreases processing time. Instead of sorting the primary file, you can index it. To join two files, the key fields must be character fields and their length must be the same in both the primary and secondary files. If you are working with a large file, the easiest way to check the sort order is to use the Sequence command. If you open the Payroll input file definition you can see at a glance that it is sorted on the Employee Number field. You will make the Work Dept. field a key field to join to the Work Dept. field in the Empmast file. Joining Matched Records The Join command will create an output file of matching records. ACL includes only the selected fields from those records in which a key field match is found from the primary and secondary files. If there is more than one key field match in the secondary file, ACL uses only data from the first matched record. If there is no matching secondary file record, ACL does not produce an output record. To join all records from the primary file that match records in the secondary file: 1. Select Data from the menu bar and choose Join. ACL displays the Join dialog box. 2. Select Payroll from the Secondary File drop-down list. 3. In the Primary Keys list view, click EmpNo. This is the sort key field in the primary file. 4. In the Secondary Keys list view, click EmpNo. This is the sort key field in the secondary file. 5. In the Primary Fields list view, CTRL+CLICK EmpNo, WorkDept, and Pay_Per_Period to include these fields from the primary file in the new file. Notice that ACL inserts a number beside each field name, indicating the order of the join. 6. In the Secondary Fields list view, click Gross_Pay. 7. Enter Matched in the To text box. 168 ACL for Windows 7 Workbook Joi ni ng, Rel ati ng, and Mergi ng Data 8. To ensure that your primary field is sorted, check the Presort check box. The Join dialog box now looks like this: 9. Click [OK] to execute the command. ACL displays the command log and opens the Matched input file definition in the view. You can see that ACL has produced 41 records and bypassed 1 record. This means that one employee record in the Empmast file did not have a matching employee number in the Payroll file. You will take a closer look at this unmatched record later in this lesson.
Module 4 Manipulating Data 169 Joi ni ng, Rel ati ng, and Mergi ng Data The last column of the View window displays the gross pay for each employee. You can rearrange the columns and format the view. Joining Unmatched Records You can now create an output file of unmatched records. ACL includes only those records from the primary file which do not have a matching record in the secondary file. For example, to identify payroll records for which no employee records exist, specify the Payroll file as the primary file. To identify employee records that do not have matching payroll records, specify the Empmast file as the primary file. To create a file of employee records that do not have matching payroll records: 1. Open the Empmast primary file again by dragging it out of the Overview window. The output file Matched closes. 2. Select Data from the menu bar and choose Join to open the Join dialog box. Notice that ACL retains the Payroll file as the secondary file. 3. In the Primary Keys list view, click EmpNo. This is the sort key field in the primary file. 4. In the Secondary Keys list view, click EmpNo. 170 ACL for Windows 7 Workbook Joi ni ng, Rel ati ng, and Mergi ng Data 5. Click [More] to switch to the additional options. 6. Click Unmatched Records. 7. Click [Main] to return to the Main options. 8. Enter Unmatched in the To text box to name the output file. By default, all fields in the Empmast file copies to Unmatched. Since you want to include all the primary fields, you do not need to select fields from the Primary Fields list view. 9. Click [OK] to execute the command. ACL displays the single record which has no matching record in the secondary file and bypasses the remaining 41 records.
Module 4 Manipulating Data 171 Joi ni ng, Rel ati ng, and Mergi ng Data You can see that employee number 90 is the cause of the unmatched record. This employee is not present in the payroll file. ACL reports the results in the command log. For more details on the other Join command options, see Join on page 223 of the ACL for Windows Reference Manual. Creating Relationships Use Relations to establish relationships between fields in two or more files. The fields do not necessarily have the same headings, but the data in the fields must match. Planning and Preparing Data Relationships Before you use Relations, it is important to be familiar with the contents of the files. You need to first decide which files and fields you want to relate and then plan how you want to relate them. The time spent planning may save you a lot of time and effort later. In this section, Ap_Trans is the primary file and Vendor and Inventory are the child files. To plan relationships between files: 1. First, find a common field for each pair of files you want to relate. Look at the first two files you want to relate and make a note of the field they have in common. Continue to do this for each set of files, until you know the common field for each pair. Note: The Unmatched Records option includes only unmatched records from the primary file. To get the results you want, you may need to change the primary and secondary files. For example, if you want a list of employees who are paid but have no employee records, use the Payroll file as the primary file and Empmast as the secondary file. The output file will contain all unmatched records from the Payroll file. 172 ACL for Windows 7 Workbook Joi ni ng, Rel ati ng, and Mergi ng Data 2. Next, determine which file will be the parent file and which file(s) relate to it (also called related or child files). You may find it helpful to sketch a diagram of how you want to relate files and fields. For example, you may draw something that looks like the following: The arrows in the diagram point to common fields. 3. After determining the child files, index the files on the key field. There is no need to index the parent file. Defining the Plan For this project: The primary file is Ap_Trans. Vendor and Inventory are the child files. Ap_Trans and Vendor can be related on the Vendor_No field. Ap_Trans and Inventory can be related on the ProdNo field. Index vendor on the key field Vendor_No and index Inventory on the ProdNo field. Ap_Trans (parent file) Inventory (related file) Vendor (related file) INVOICE_AMOUNT INVOICE_DATE INVOICE_NO PRODNO QUANTITY CSTDATE LOC MINQTY MKTVAL VENDOR_CITY VENDOR_LAST_ACTIVE VENDOR_NAME VENDOR_NO UNIT_COST VENDOR_NO PRCDTE PRODDESC PRODNO PRODSTAT VENDOR_REVIEW_DATE VENDOR_STATE VENDOR_STREET VENDOR_ZIP QTYOH PRODCLS SALEPR
Module 4 Manipulating Data 173 Joi ni ng, Rel ati ng, and Mergi ng Data Indexing the Child Files To index the child files: 1. Drag the Vendor input file definition from the Overview window and drop it onto the application workspace to open it. 2. Click (Index) or select Data from the menu bar and choose Index to open the Index dialog box. 3. Click Vendor_No in the Index On list view to select the key field to index on. 4. In the To box enter Vendorno to name the output file for the index. 5. Click [OK] to execute the Index command and close the dialog box. The number of indexed records appears in the box in the center of the status line. The command log reports the results. 6. To index Inventory, drag the input file definition out of the Overview window and drop it onto the application workspace. The default view for Inventory.fil appears in the view. 7. Repeat steps 2 through 5 to index Inventory, indexing on the key field ProdNo in step 3, and naming the index Prodno in step 4. Relating Files You are now ready to use the Relations dialog box to establish a relationship between Ap_Trans, Vendor, and Inventory. To create a relationship: 1. In the Overview window, open the parent file by double-clicking the Ap_Trans input file definition. Your open input file is always your parent file. Note: If an index file becomes outdated, ACL automatically recreates the index file using the same index file name. 174 ACL for Windows 7 Workbook Joi ni ng, Rel ati ng, and Mergi ng Data 2. Click (Relations) or select Data from the menu bar and choose Relations. ACL displays the Relations dialog box. In the Relationships list box, ACL reports that no known relations exist. When you create a relation, ACL displays a detailed description of it in the Relationships list box. 3. In the Relate on list view, select the Vendor_No field as your key field. 4. In the Related File drop-down list, choose Vendor as the child file. ACL displays the the relation name (Vendor), along with index used (Vendorno). 5. Select the Vendorno index from the Using Index list box. Primary file Key fields index file child file
Module 4 Manipulating Data 175 Joi ni ng, Rel ati ng, and Mergi ng Data 6. Click [Relate]. ACL displays the relationship in the Relationships list box. The Relations dialog box remains open so that you can create multiple relationships. To create the second relationship: 1. Click the ProdNo field in the Relate On list view to select it. 2. Click the Related File drop-down list and select Inventory. 3. Select the only index for the Inventory file, ProdNo, in the Using Index list box. 4. Click [Relate] to create the second relation. The Relationships list box shows the second relationship. 5. Click [Done] to close the Relations dialog box. Working with Related Files All dialog boxes that include the Available Fields list view also contain a From Input File drop-down list. The From Input File drop-down list displays all related files. When you select a related file, the Available Fields list view changes to display the fields from the related file. This lets you work with the fields from related files. Note: Relation Name allows you to build more than one relation to the same file or to build self-referencing relations. By default, the Relation Name text box displays the name of the related input file definition. But you can enter a different, unique name and then create a second relationship between the same files using a different key field. Related file Key field Index file 176 ACL for Windows 7 Workbook Joi ni ng, Rel ati ng, and Mergi ng Data Now that you have related three files, create a view that displays fields from all three files. To add a column from a related file to the Ap_Trans file: 1. In the Overview window, drag and drop the Views icon onto (Open) to open a new blank view of the Ap_Trans file with the Add Columns dialog box on top. 2. Click the From Input File drop-down list and select Vendor as your input file. Notice that the Available Fields list view changes to display the field name from the Vendor file. The field names precede the name of the related file. This helps you to quickly see which field comes from which related file, no matter how many related files you have. 3. In the Available Fields list view, double-click Vendor.Vendor_No and Vendor.Vendor_Name to copy them to the Selected Fields list box. 4. Select Inventory from the From Input File drop-down list as your input file. ACL changes the Available Fields list view to show the fields from the Inventory file. 5. Double-click the Inventory.ProdDesc field in the Available Fields list view to copy it to the Selected Fields list box. 6. To go back to the parent file, click the From Input File drop-down list and select the Ap_Trans file. The Available Fields list view changes to show fields from Ap_Trans.
Module 4 Manipulating Data 177 Joi ni ng, Rel ati ng, and Mergi ng Data 7. In the Available Fields list view, double-click the Invoice_Date and Invoice_Amount fields to copy them to the Selected Fields list box. Your Add Columns dialog box now looks like this: 8. Click [OK] to close the Add Columns dialog box. ACL adds the columns to the view and displays the View window. ACL places the columns in the order that you select them in the Add Columns dialog box. You can add fields from related files at any time. Just click (Add Columns) in the View window and select field names. If a record from the parent file finds a related record in a child file, ACL moves to the next record and continues processing. If there are duplicate fields in a related file, ACL uses the first occurrence. Fields from input file Related or open input file Related fields 178 ACL for Windows 7 Workbook Joi ni ng, Rel ati ng, and Mergi ng Data If there is no match between related files (in other words, no comparable information), ACL displays a blank in the columns of the related file. Deleting Relationships You can delete relationships using the Relations dialog box. If the active view references the relationship you want to delete, you must close the view before deleting the relationship. You cannot delete relationships that have dependent relations, referenced, fields, computed fields, or filters. To remove a relationship: 1. Close the view of Ap_Trans that you created in Working with Related Files on page 175. ACL prompts you to name the view. 2. Name the view Ap_Trans2 and click [OK]. 3. In the Overview window, expand Ap_Trans to display the list of views. Double-click Default_View to open it. 4. Click (Relations) or select Data from the menu bar and choose Relations. The Relations dialog box opens. 5. Click the Related File drop-down list and select Inventory. 6. From the Relate On list box, select Prodno. 7. From the Using Index list box, select Prodno. 8. Click [Delete relationship] to remove the relationship. ACL asks you if you want to delete the previous relationship. 9. Click [Yes] to remove the relationship. If you want to, you can select the other relationship and click [Delete relationship] to remove it. 10. Click [Done] to close the Relations dialog box. Merging Data Files The Merge command is another multifile processing option. Merge combines two files that have identical record structures into a third file. Both files must be sorted in ascending sequence on the key fields before merging. For example, you can use Merge to combine files from two different time periods or company branches. Note: Only records in the parent file will be processed. There may be records in the related file that do not appear in your view, as they do not match records in the parent file.
Module 4 Manipulating Data 179 Joi ni ng, Rel ati ng, and Mergi ng Data To Merge two data files with identical record structures into a third file: 1. Open the primary file from the Overview window. 2. Select Data from the menu bar and choose Merge. ACL displays the Merge dialog box. 3. Select the secondary file from the Secondary File drop-down list. 4. In the Primary Keys list view, select the field you want to sort on. 5. In the Secondary Keys list view, select a field with an identical record structure. 6. To ensure that your primary field is sorted, check the Presort check box. 7. Enter an output file name in the To text box. 8. Click [OK]. ACL displays the command log and opens the new input file definition in the view. For further details on the Merge command, see Merge on page 239 in the ACL for Windows Reference Manual. Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit. 180 ACL for Windows 7 Workbook Sampl e, Si ze, and Eval uate Lesson 4.8 Sample, Size, and Evaluate 4 In this lesson, you will learn to use the Sample, Size, and Evaluate commands to determine sample sizes, draw samples, and evaluate sample errors. The Sample command selects statistical record samples or monetary unit samples (MUS), also known as dollar unit samples, from a population within an input file. The Size command determines the appropriate sample size for record and monetary unit samples. The Evaluate command determines the effects of errors detected in sampling results on the overall population. Opening Your Project To prepare for this lesson: 1. Open the Workbook.acl Project. For details on how to open an ACL Project and an input file definition, see Lesson 2.4: Overview Window on page 57. 2. In the Overview window, select Ar and drag it out into the application workspace. This opens the default view of the Ar input linking to the data file Ar.fil. Preparing Your File for Sampling Before you do a Sample, use the Statistics command to determine useful information about the Amount field. To display statistics for sampling: 1. Click (Statistics) or select Analyze from the menu bar and choose Statistics. The Statistics dialog box appears. Note: The theory behind statistical sampling is complex and goes beyond the scope of this workbook. If you are not familiar with the critical judgments required to perform statistical sampling, we recommend consulting a statistics specialist before using the ACL Evaluate, Sample, and Size commands.
Module 4 Manipulating Data 181 Sampl e, Si ze, and Eval uate 2. In the Statistics On list view, click Amount. 3. Click [OK] to execute the command. ACL displays the field statistics in the command log. Note: You can note or retrieve Count and Statistics information from the log file for subse- quent sampling. For record samples, you would note the record count; for MUS you would usually note the absolute value. Total record count for record samples Absolute value of the amount field for MUS samples 182 ACL for Windows 7 Workbook Sampl e, Si ze, and Eval uate Sampling Methods ACL offers two basic sampling methods: record sampling and monetary unit sampling (MUS), also known as dollar unit sampling. Both record sampling and MUS allow two types of interval sampling, as well as random sampling. You can also add options to further restrict or define the sample. MUS and Record Sampling Options 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, and First clauses Automatic or manual seed (for repeatability) MUS Only Sampling Options No repeats Subsampling Top stratum cutoff Choosing a Sampling Approach The sampling option you choose depends on your assessment of the characteristics of the population, as well as your current needs and preferences. If you choose a sampling approach, it is useful to understand the impact that the sampling bias and selection method will have on the results. Bias refers to the chance of selection for each item in the population. The bias varies with the sampling option you choose: A MUS biases higher-value items. A record sample is unbiased. The Cutoff option biases classes of transactions, such as the high value of key items over a certain dollar amount. Specifying a condition biases classes (or records). Examples of conditions include items in product class 05 or amounts over $10,000 in the month of April.
Module 4 Manipulating Data 183 Sampl e, Si ze, and Eval uate Selection Methods The Sample command has three parameters you can use to determine the specific method ACL applies to draw the sample: Fixed Interval sampling is required before using the Evaluate command to determine the effect of errors on the population. The sample sizes determined by the Size command are also designed for use with fixed interval sampling. Fixed interval sampling requires that you specify an interval value and a random start number. You can also specify a cutoff. Cell sampling (also referred to as a random interval sample) chooses one random item from each group. The population is broken into groups the size of the interval. ACL automatically generates the required random numbers. You specify an interval number, a random seed number, and, optionally for a MUS, a cutoff. Random sampling generates the desired number of random numbers between 0 and the population specified. These random numbers are then used to make selections. You must specify the number of selections desired, a random seed value, and the size of the population. For more information on the Sample command, see Report on page 279 and Sample on page 284 of the ACL for Windows Reference Manual. Monetary Unit Sampling A MUS is most likely to select records of greater value in the data file. For example, it is more likely to select a million dollar item than a hundred dollar item. The chance of selection is directly proportional to the size of the item. A MUS is useful for substantive or overstatement tests because it selects the greater value items. These greater value items present the largest risk of containing a material error for substantive or overstatement tests. By biasing greater value items, a MUS provides a high level of assurance that ACL will test all significant items in the population. The population for a MUS is the absolute value of the field being sampled. However, large transactions may be subject to extra controls not present for smaller amounts. If you choose a method that biases large amounts, you may miss a weakness relating to smaller transactions. A MUS is not appropriate if testing for compliance or understatement. You may choose to ignore negative items, as they do not usually result in an overstatement. To do this you can specify a local filter (for example, AMOUNT>0 if the field name is AMOUNT) as part of the Sample command. 184 ACL for Windows 7 Workbook Sampl e, Si ze, and Eval uate Monetary Unit Sampling on a Fixed Interval When you apply the fixed interval method to a MUS, you are selecting individual dollars from the population. Given that a thousand dollar item contains 1,000 individual dollars and a million dollar item contains 1,000,000 individual dollars, any of the individual dollars may be selected and the corresponding record drawn. You must specify an interval value and a random start number. If you specify a random start of 611 and an interval of 900, ACL selects the 611th item and every 900th item thereafter. You can also specify a cutoff. You may be asked to draw a sample of a fixed size, regardless of the monetary size of the population. This is seldom appropriate statistically, as it may result in oversampling or undersampling. You can use a MUS with fixed intervals to sample for the overstatement of any dollar values. If you choose an interval sample, you cannot specify the sample size directly. To get the desired number of selections, divide the population by the desired sample size. You can then use the result to specify the interval. Using the Size Command for MUS The Size command allows you to determine the appropriate sample size and to evaluate any sample errors detected. While ACL is an excellent tool for obtaining samples, do not use ACL to calculate sample sizes if you: Are sampling very small populations, especially populations of less than 1000 Have in-house sampling experts Have a another tool mandated for sampling Want to perform variables or estimation sampling You can use the Size command to determine numeric or interval sample sizes. The most common way to determine interval size is to decide on a materiality level and base the interval on this value.
Module 4 Manipulating Data 185 Sampl e, Si ze, and Eval uate To use the Size command to determine the MUS Sample Size, Interval and Maximum Tolerable Taintings: 1. Select Sampling from the menu bar and choose Size. ACL displays the Size dialog box. The Monetary option button is selected by default. 2. Enter 95 in the Confidence text box. The confidence is the level of reliability (entered as a percentage) you would like the sample to generate. The sample has a 95 percent confidence, as it would likely be wrong only 1 time in 20. 3. Enter 585674.41 in the Population text box. The Population for a MUS is the absolute value of the field being sampled. 4. Enter 12000 in the Materiality text box. The materiality is the amount of total error where action must be taken. In this example, projected errors less than $12,000 are acceptable. Note: If you intend to use the Evaluate command later to evaluate any errors detected in a MUS sample, you must use fixed interval sampling. 186 ACL for Windows 7 Workbook Sampl e, Si ze, and Eval uate 5. Leave the Expected Total Errors text box blank. The expected total errors are the total dollar amount of errors anticipated in the population. The greater the amount of expected total errors you specify, the larger the sample size. 6. Click [Calculate] to preview your results. ACL displays the Sample Size, Interval, and Maximum Tolerable Taintings in the Results area of the Size dialog box. The maximum tolerable taintings are the sum of the error percentages associated with each amount in a given sample. The Size dialog box now looks like this:
Module 4 Manipulating Data 187 Sampl e, Si ze, and Eval uate 7. Click [OK] to execute the command. ACL records the calculations in the log file and displays the command log. Drawing an MUS Fixed Interval Sample You can now use the results of the Size command to draw a sample. To use the results of the Size command to draw a sample: 1. Select Sampling from the menu bar and choose Sample. ACL displays the Sample dialog box. Notice that you can click the [More] tab in the Sample dialog box to include scope parameters and other options. 188 ACL for Windows 7 Workbook Sampl e, Si ze, and Eval uate 2. In the Interval text box enter 4000. The interval is the value determined by the previous size calculation. 3. In the Start text box enter 234. This can be any random number. 4. In the To text box enter Sampsize. The Sample dialog box now looks like this: 5. Click [OK] to execute the command. ACL creates Sampsize.fil with the items in your sample and displays it in the view.
Module 4 Manipulating Data 189 Sampl e, Si ze, and Eval uate 6. The results of the calculation also appear in the command log. Notice that the selection remainder is also reported for reconciliation purposes and that there are three top stratum items. The top stratum items are amounts greater than or equal to the interval size. Printing the Sample Command Results If you want to produce a record of the sampling parameters you used for this sample, you can print the information. To print the command log: 1. Click the command log to activate it. 2. Click the drop-down list in the command log and choose Last Result. 3. Select File from the menu bar and choose Print. ACL displays the Print dialog box. 4. Click [Print]. MUS With Top Stratum Cutoff When performing Monetary Unit Sampling with either of the two interval sampling methods, ACL automatically stratifies the population into a top stratum and bottom stratum, based on the absolute value of the field being sampled. The top stratum items are those items whose absolute value is equal to or greater than the interval. These items are automatically selected and then added to by subjecting the remaining population, the bottom stratum, to the specified MUS interval sample. ACL includes a Cutoff parameter for any interval sample command issued. This allows you to override ACLs automatic use of the specified interval as the basis for Cutoff, and instead substitute their own Cutoff, typically some value smaller than the interval. To include a Cutoff value larger than the specified interval would cause items larger than the interval to remain in the bottom stratum. These items would then have a greater chance 190 ACL for Windows 7 Workbook Sampl e, Si ze, and Eval uate of being selected more than once, which may not be desirable (unless the items reflect vouchered amounts for which testing of multiple supporting amounts is desired). No Repeats The No Repeats sampling method does not apply to random samples. With a random sample, you can use an If test to list the larger items and another If test to exclude them from the sample. In MUS, ACL can select the same record more than once, as different dollars in the same amount may be selected. The No Repeats option suppresses any additional selec- tions of the same item. This may result in undersampling where a specific number of selections is required. Therefore, it is a good idea to intentionally oversample when No Repeats is turned on. The No Repeats check box is found in the [More] tab of the Sample dialog box and is grayed out if the option does not apply to your sample. Subsample The records you are sampling may represent multiple rather than individual transac- tions. For example, an accounts payable sub-system may have multiple transactions assigned to each record. Subsampling lets you sample the supporting items. When you choose the Subsample option in the [More] tab of the Sample dialog box, ACL generates a random number for each selection. This number can then be used to draw a subsample of the individual transactions that make up the selected record. Record Sampling You can use Record Sampling to do compliance testing and to perform a random sample of records. Record Sampling only samples based on the records themselves, not the value of the numeric fields in the records. When you perform a record sample, each record in the file has an equal chance of being selected. For example, a hundred-dollar item has the same chance of selection as a million-dollar item. Record sampling may overlook very large transactions. Record sampling is most useful for compliance or understatement testing. You can use record sampling to test the compliance or rate of errors in the total population. Similarly, with understatement tests you are more concerned with items that are missing from the file or recorded at too small a value. It may be that the larger amounts are least Note: Modifications to the top stratum cutoff should be made only by specialists experi- enced in the technical theories relating to statistical sampling.
Module 4 Manipulating Data 191 Sampl e, Si ze, and Eval uate likely to be understated. You want to find items such as a million-dollar item that has been incorrectly recorded as a dollar. Random Record Sampling To perform a random record sampling: 1. Open the Ar file from the Overview window. 2. Select Sampling from the menu bar and choose Sample. The Sample dialog box opens. 3. In the Sample Type area, select Record. 4. In the Sample Parameters area, select Random. ACL automatically displays the Population in the text box. The Population is the total number of records in the file. 5. Click [Size]. ACL displays the Size dialog box. 6. In the Confidence text box enter 95. 7. In the Upper Error Limit text box enter 5. Leave the Expected Error Rate text box blank. 8. Click [Calculate] to preview your results. ACL displays the Sample Size, Interval, and Number of Tolerable Errors in the Results area of the Size dialog box. 9. Click [OK]. ACL closes the Size dialog box and returns to the Sample dialog box. 10. In the Sample Parameters area, enter 234 in the Seed (oversample) text box. Notice that ACL fills in the Size. Note: If performing a random sample or subsampling, you can request the selection order number of the items drawn. This is useful when you oversample. 192 ACL for Windows 7 Workbook Sampl e, Si ze, and Eval uate 11. In the To text box, enter the output file name Arrand2. The Sample dialog box now looks like this: 12. Click [More] to display additional options. 13. In the Output area, select Fields. 14. In the Extract Fields list view, click Date and CTRL+CLICK Amount. 15. Check the Report Selection Order check box to get the selection order number of the sampled items. Note: The Report Selection Order check box is available only if your output choice is Fields rather than Records.
Module 4 Manipulating Data 193 Sampl e, Si ze, and Eval uate 16. Click [OK]. ACL creates the output file and displays it in the view. The new data file is Arrand2.fil. The status bar of the ACL window shows the input file name Arrand2. The view of your output file contains an Order field in 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. In the above example, record 2 is the second item selected, record 12 is the ninth item selected, and so on. The command log describes the results of the sample. 194 ACL for Windows 7 Workbook Sampl e, Si ze, and Eval uate Sorting the Output File by Order You can sort the output file by the Order column to make it easier to see the selection order. To use the Sort command to sort the random record sample file: 1. With Arrand.fil still open in the view, select Data from the menu bar and choose Sort. ACL displays the Sort dialog box. 2. Select the field Order from the Sort On text box. 3. In the To text box, enter the output file name Arrand3. 4. Click [OK]. ACL creates the input file Arrand3.fil and displays it in the view. Using the Evaluate Command on Sampling Results The Evaluate command uses the sampling parameters and errors detected to calculate the effect on the upper error limit (UEL). The UEL is the amount you are confident the errors do not exceed. For example, you could estimate that there are $5,000 worth of errors, but you are 95 percent confident they do not exceed $8,000. The UEL at 95 percent confidence would be $8,000. To evaluate the Sampsize file: 1. Drag Ar out of the Overview window to open the accounts receivable file again. 2. Select Sampling from the menu bar and choose Evaluate. ACL displays the Evaluate dialog box. Note: When performing random sampling, it is important to check that both the sample and the population sizes match the ones you enter. If an incorrect population for a record sample is entered, ACL tells you that the supplied population total differs from the actual total and that the sample results may be invalid.
Module 4 Manipulating Data 195 Sampl e, Si ze, and Eval uate 3. Enter 95 in the Confidence text box. 4. Enter 4000 in the Interval text box. This time, the interval is the size of the Fixed sampling interval you are using for the sample. 5. In the Errors list box, enter: 2150,50 2295,300 Enter only one error on each line. The Evaluate dialog box now looks like this: Each error contains the sample item amount that was selected, followed by a comma, and then the amount of the error entered (the sample item amount minus the actual amount). In other words, if a sample item was recorded as 2150, but the correct value was 2100, then the error is 50. If the actual amount is greater than that recorded, enter the error as a negative amount. 6. Click [OK] to execute the command. ACL processes the errors recorded and displays the result in the command log. 196 ACL for Windows 7 Workbook Sampl e, Si ze, and Eval uate 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, while you can estimate that the most likely errors are $615.90, you can be 95 percent confident that the total errors do not exceed $13,059.22. You can also use the Evaluate command to measure the effective errors detected in the random record sample drawn earlier against the entire population. Simply choose the Record option button and enter the required parameters. For more information on the Evaluate command, see Evaluate on page 179 of the ACL for Windows Reference Manual and online Help. Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit.
Module 4 Manipulating Data 197 Usi ng Functi ons Lesson 4.9 Using Functions Functions are predefined routines that perform standard computational tasks more easily. You can specify them wherever you require fields or expressions. Functions can even use other functions as parameters. It is easy to identify a function. All functions have parentheses immediately following the function name, with no space between the function name and the parentheses. The data to be manipulated is enclosed in the parentheses, along with specific parameters. You can abbreviate function names in the same manner as all other keywords in ACL. They can be as short as desired, as long as they are unique. For example, the VALUE( ) function can be abbreviated as short as VAL( ). For complete function descriptions, including examples to show how each function operates, see your ACL for Windows Reference Manual and online Help. Opening Your Project To prepare for this lesson: 1. Open the Workbook.acl Project. For details on how to open an ACL Project and an input file definition, see Lesson 2.4: Overview Window on page 57. 2. In the Overview window, drag and drop the Customer input file onto the application workspace. The default view for the Customer input file opens. Using the Find( ) Function You can use FIND( ) to test for a string of characters in a field or record. The Find function is not case-sensitive, so it will find both uppercase and lowercase, as well as both ASCII and EBCDIC characters. The following example shows you how to access functions while building expressions. Finding Characters in a Field Use the FIND( ) function to find any string of characters within the field you specify. To look in the State field for companies located in New York: 1. Click (Edit View Filter) in the View window. ACL displays the Expression Builder for you to define a view filter. 198 ACL for Windows 7 Workbook Usi ng Functi ons 2. Uncheck the Paste Parameters check box at the bottom right of the Expression Builder. 3. Click the Functions drop-down list on the right side of the dialog box and select Logical. The functions list changes to show the group of Logical functions. 4. Double-click the FIND( ) function to copy the function to the Expression text box. The cursor is blinking inside the parentheses. 5. Enter "NY", (comma). Note: If you want to copy the function with its parameters, check the Paste Parameters check box in the bottom right of the Expression Builder. If you double-click the function to copy it to the Expression text box, the parameters for the function are also copied and appear between the parentheses. Replace the parameters with the appropriate fields or data.
Module 4 Manipulating Data 199 Usi ng Functi ons 6. In the Available Fields list view, double-click State to copy it to the Expression text box to complete the expression. The Expression Builder now looks like this: 7. Click [OK]. The Expression Builder closes. The expression you created with FIND( ) appears in the text box in the View window and is applied to the view immediately. The view now lists customers in New York state only. All others have been filtered out. If you scroll to the right of the view, you will see that the State field has been added. You can change the display of filtered records in the View by changing your Prefer- ences. See View Options on page 333 for more details. 8. Click (Remove Filter) to remove the filter and restore the original view. 200 ACL for Windows 7 Workbook Usi ng Functi ons 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. To search for the words New York anywhere in the record: 1. In the View window, click (Edit View Filter) to open the Expression Builder. 2. Uncheck the Paste Parameters check box. 3. From the Functions drop-down list select Logical. 4. Double-click the FIND( ) function from the list of Logical functions to copy the function to the Expression text box. 5. Enter "New York". 6. Click [OK]. The Expression Builder closes. ACL searches the input file and highlights those records that have New York in any field. The view shows the found record. 7. Click (Remove Filter) to remove the FIND( ) filter and restore the original view. For a full list of ACL functions and how to use them, see Functions on page 23 in the ACL for Windows Reference Manual. Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit.
Module 4 Manipulating Data 201 Generati ng Confi rmati on Letters Lesson 4.10 Generating Confirmation Letters ACL lets you use your own word processing package to produce confirmation letters using the data ACL analyzes. In this lesson, you will use the Summarize, Sample, and Join commands to generate and prepare data in ACL for export to a word processor. Opening Your Project To prepare for this lesson: 1. Open the Workbook.acl Project. For details on how to open an AC Project and an input file definition, see Lesson 2.4: Overview Window on page 57. 2. In the Overview window, drag Ar out of the Overview window. This opens the default view of the Ar input file definition linking to the data file Ar.fil. Generating Confirmation Letters Because you want to confirm balances, you must summarize the file to include the outstanding balance for each customer. The Summarize command requires sorted data, so you must first presort the file. Presorting and Summarizing a File You can presort the file when you execute the Summarize command. To presort and summarize the Ar file: 1. Select Data from the menu bar and choose Summarize. The Summarize dialog box opens. 2. Check the Presort check box. 3. In the Summarize On list view, click the No field. 4. In the Accumulate Fields list view, click the Amount field. 202 ACL for Windows 7 Workbook Generati ng Confi rmati on Letters You are interested in only outstanding balances, so you will not click any fields in the Other Fields list view. The Summarize dialog box now looks like this: 5. Click the Output tab to display the Output options. 6. Click File in the To box. 7. In the Name text box, enter Ar_summary.
Module 4 Manipulating Data 203 Generati ng Confi rmati on Letters 8. Click [OK] to execute the command. ACL displays the view. The new view shows the customer number, outstanding balance, and a count of the number of transactions within each customer number. You can also see the outcome in the command log. Obtaining Descriptive Statistics You can now use the Statistics command to get some descriptive statistics about the Amount field you are going to sample. Note: You can use the Classify command to output the same information to a separate data file. It is best, however, to use the Summarize command if you are working with a large file of sorted transactions. 204 ACL for Windows 7 Workbook Generati ng Confi rmati on Letters To obtain statistics on the Amount field: 1. Click (Statistics) or select Analyze from the menu bar and choose Statistics. ACL displays the Statistics dialog box. 2. In the Statistics On list view, click the Amount field. 3. Click [OK]. ACL displays the results in the command log.
Module 4 Manipulating Data 205 Generati ng Confi rmati on Letters Sampling the Summarized Data To do a dollar unit sample using fixed intervals: 1. Select Sampling from the menu bar and choose Sample. ACL displays the Sample dialog box. 2. The Sample On drop-down list displays the Amount field. 3. In the Interval text box enter 23450. 4. In the Start text box enter 154. 5. In the To text box enter Arsample. The Sample dialog box now looks like this: 6. Click [OK]. ACL creates a file of sample balances for your confirmation letters and displays it in the View window. 206 ACL for Windows 7 Workbook Generati ng Confi rmati on Letters Joining the Data Files Before you export the sample balances to your word processor, you must join this file with the file of names and addresses from the Customer Master file. For more infor- mation, see Sorting Files Before Joining on page 167. To see if the Customer file is sorted on the customer number: 1. In the Overview window, click Customer in the list of input files and drag and drop it onto the (Open) button. ACL displays the account number, names, and addresses of all the customers in the view. 2. Select Analyze from the menu bar and choose Sequence. ACL displays the Sequence dialog box.
Module 4 Manipulating Data 207 Generati ng Confi rmati on Letters 3. In the Sequence On list view, click the No field. Leave both the Gaps and Duplicates check boxes unchecked, as they are by default. 4. Click [OK] to execute the command. ACL displays the results in the command log. You can see from the list of sequence errors in the command log that the file is not sorted on customer number. To sort the customer file on customer number: 1. Click (Sort) or select Data from the menu bar and choose Sort. ACL displays the Sort dialog box. 2. In the Sort On list view, click the No field. 208 ACL for Windows 7 Workbook Generati ng Confi rmati on Letters 3. Click in the To text box and enter Custsort. The Sort dialog box now looks like this: 4. Click [OK] to execute the command. ACL sorts the file and displays the new view.
Module 4 Manipulating Data 209 Generati ng Confi rmati on Letters The results appear in the command log. Joining the Matching Records You can now join the sample balance file as the primary file with the file of customer names and addresses as the secondary file. To join the files: 1. In the Overview window, double-click the Arsample input file to open the file. 2. Select Data from the menu bar and choose Join. ACL opens the Join dialog box. 3. Select Custsort from the Secondary File drop-down list. 4. In the Primary Keys list view, click the No field. This is the sort key field in the primary file. 5. In the Secondary Keys list view, click the No field. This is the sort key field in the secondary file. 6. In the Primary Fields list view, select all three fields. 7. In the Secondary Fields list view, click Name and then CTRL+CLICK Address, City, State, and Zip. 210 ACL for Windows 7 Workbook Generati ng Confi rmati on Letters 8. In the To text box enter Arconf. The Join dialog box now looks like this: 9. Click [More] to display the additional options. Matched Records is selected by default.
Module 4 Manipulating Data 211 Generati ng Confi rmati on Letters 10. Click [OK] to execute the command and close the Join dialog box. ACL creates the joined file and displays it in the view. To check the successful joining of all records, check the command log or scroll the View window. Exporting Results to a Merge File You can now export the data you want to use in a word processor. The file you export will be used as the secondary merge file in your word processor. The letter will be the primary merge file. When you export data fields, select the fields in the same order in which you want them to appear in the confirmation letter. For example, ACL will display your address infor- mation in the header of the letter. The customer number, number of transactions and outstanding balance will be in the body of the letter. Export the data fields in the same order as the merge text appears in Word. The exact format of the merge text depends on the version of Word you are using. To make the data more presentable in the confir- mation letter, you can use the ACL function PROPER( ) to convert uppercase data to mixed case. These fields are from the Arsample file. These fields are from the Custsort file. 212 ACL for Windows 7 Workbook Generati ng Confi rmati on Letters To export the data to a Word merge file: 1. Select Data from the menu bar and choose Export. The Export dialog box opens. 2. Click [Export Fields] to display the Selected Fields dialog box. 3. Click [Expr] to display the Expression Builder. 4. Uncheck the Paste Parameters check box. 5. In the Functions list box, double-click PROPER( ) to copy it to the Expression text box. 6. In the Available Fields list view, double-click Name to place it inside the parentheses in the function. This will convert the uppercase characters in the Name field to mixed case.
Module 4 Manipulating Data 213 Generati ng Confi rmati on Letters 7. Click [OK]. 8. Repeat steps 3, 5, 6, and 7 for the fields Address and City. The fields State and Zip will use their existing formats. Export the fields in the order in which you want them to appear in the confirmation letter. 9. In the Available Fields list view, double-click State, Zip, Count and Amount to add them to the Selected Fields list box. 10. Click [OK] to close the Selected Fields dialog box. 11. Click the Export As drop-down list. Notice that ACL allows you to export your data to different formats. Select Word Merge File. 12. In the To text box enter Arconf. The Export dialog box now looks like this: 214 ACL for Windows 7 Workbook Generati ng Confi rmati on Letters 13. Click [OK] to execute the command. ACL creates the file Arconf.doc and displays the result. Viewing the Exported File You can now use a text editor or word processor to view the file. If you use Word to open the file, it will look similar to the following, after you have added tabs in the ruler to define the columns: You can now use the ACL data with your word processor merge file to create confir- mation letters or a table for a presentation. Exiting ACL To exit ACL now, select File from the menu bar and choose Exit.
Module 4 Manipulating Data 215 The Benford Command Lesson 4.11 The Benford Command The Benford command lets you perform digital analysis. Digital analysis is based on Benford's Law, which predicts the distribution of digits in many kinds of data, including financial reports, inventories, and other business records. Deviations from this predicted distribution may signal the presence of error, waste, abuse, or fraud in your data. There are three steps in digital analysis: 1. Preparing the data 2. Comparing digit frequencies 3. Selecting targets for further review The Benford command helps you complete all three of these steps. Opening Your Project To prepare for this lesson: 1. Open the Workbook.acl Project. For details on how to open an ACL Project and an input file definition, see Lesson 2.4: Overview Window on page 57. 2. Drag and drop Trans onto the (Open) button to open the default view of the Trans input file that uses the data file Trans.fil. Preparing Your Data When working with real data, you must review the field definitions and ensure that the data file is complete and correct. One type of error that may have a big impact on digital analysis results is accidental duplication. For example, if analyzing a file assembled from smaller separate files, some transactions may duplicate during assembly. In this lesson, you perform analysis on the Amount field in the Trans input file. If the field you want to analyze contains both positive and negative values, it is usually a good idea to perform separate analyses for each range of values by filtering out the other range. Otherwise, matching transactions in the Trans file, such as an entry for $143.00 and a cancellation for -$143.00, would show up as duplications. The field used in this lesson contains no negative values. Although it is not required in this example, another commonly used digital analysis option is to eliminate low-value items before performing the analysis. Mark Nigrini explains in Digital Analysis Using Benford's Law that you can filter out or delete low-value items (for example, invoices under $10.00) prior to analysis without distorting the results. Provided the items eliminated are from the range just below, but not including, some multiple of one, such as 0.10, 1.00, or 10.00, the remaining data 216 ACL for Windows 7 Workbook The Benford Command should still conform equally well to Benford's Law. In most cases, such low-value items are insignificant to an accountant or auditor. To eliminate low-value items you can: Delete the items from the file before performing the command. Create a local filter, such as Amount > = 10.00, in the If text box of the Benford dialog box. Comparing Digit Frequencies The Benford command offers analyses of 1-6 leading digits. In each case, the actual results are compared to the expected value, according to Benford's formula. A thorough analysis will often begin with one digit, to assess the overall fit of the data to Benford, and then move to two or even three digits to select specific targets for review. You have the option of applying bounds to the result. The bounds are calculated based on the total number of records in the data set, and the number of digit combinations to analyze (one digit yields nine bars on the graph, two digits yield 90 bars, and so on). The upper and lower bounds are placed so that, on average, no more than one of the resulting bars would lie outside of them purely by chance. If several bars exceed the bounds, this suggests a non-random variation to be investigated. To perform a two-digit digital analysis with bounds on a numeric field: 1. With the Trans file open, select Analyze from the menu bar and choose Benford. ACL displays the Benford dialog box. 2. Select Amount from the Benford On drop-down list. 3. In the Number of Leading Digits text box, enter 2. 4. Check the Include Upper and Lower Bounds check box. 5. Enter Amount>0 in the If text box. 6. Click [OK].
Module 4 Manipulating Data 217 The Benford Command You can see that each count shows an actual and expected value, a Z-statistic, and upper and lower bounds. Normally, ACL tells you the number of records with zero amounts that are bypassed, but in this case the added amount > 0 filter removed them first. Notice also that ACL warns you when the population may be too small for the test you are performing. Typical formatting such as dollar signs, commas, and decimals are ignored, and it is not necessary to sort the data. Note also that the full range of leading digits produced, from 10 through 99, appears in the command log. The Z-statistic measures how far a particular result is from the expected value. It is expressed in standard deviations, so that a Z-statistic of 0.500 represents one-half of a standard deviation, which is a very common result and therefore not significant. A Z-statistic greater than 1.96 suggests that the actual result is likely to occur by random chance fewer than one time in 20. A Z-statistic of 2.57 represents one chance in 100. So for a set of 90 digit combinations, obtaining several Z-statistics greater than 2.000, or even one above 2.500, would not be unusual. For one-digit or two-digit analyses, it can be very helpful to graph the results. Graphing significantly speeds up selection of targets for review because deviations appear in context. The graph of a two-digit analysis may require some formatting to make it more readable. For analyses using three digits or more, we recommend that you send the output to file. The total number of line items produced is too great to view easily in the command log or to produce a meaningful graph. Sorting and filtering are effective ways to identify targets from a file. Selecting Targets for Review A target is simply a subset of data that seems to deserve further investigation. A target in digital analysis is most often selected because it has exceeded the bounds, or else it has remained within bounds but has noticeably spiked above the general trend of the graph. 218 ACL for Windows 7 Workbook The Benford Command Because this file is relatively small at 327 records, the curves for the expected Benford value and the upper and lower bounds show a stepped pattern that reflects the integer values. The lower bound reaches zero for digit combination 19 and remains unchanged for all subsequent values. In this case, the graph remains within bounds for all 90 digit combinations, suggesting that there are no significant exceptions. However, these bounds are only approximate guides. Good judgment is necessary to interpret the result, especially if the file size is smaller than about 10,000 records. Criteria for Targets There are five positive spikes in the two-digit analysis that are large enough to be targets: they deserve some further investigation. The bars for 24, 36, 84, and 90 all exactly equal the upper bound. The bar for 12 does not quite reach the upper bound, but it is very distinct from the trend of nearby values. Product 080126008 appears five different times under digit combination 24, because the unit price for the product is $2.41 and purchases of 1 or 10 units are relatively frequent. As Benford's Law itself tells us, it is normal for purchases of 1or 10 units to be frequent. The same thing happens three times under digit combination 12, for quantities of 5, 51, and 513. This is somewhat more unusual. It might be advisable to conduct some further testing for product 080126008, to see what the typical order quantities are. Normally the same firm would not make frequent orders of 1 to 10 units, plus similarly frequent orders of 50 and 500. Product 052530155 appears three times under 12 for multiples of quantity 4. If quantities and product numbers are identical, one way to test for duplicates has is to check invoice numbers and dates: in each case, they are consistently different. The spike at 36 apparently occurred because of two purchases each for two products, which is not in itself unusual. The spike at 84 does not involve any kind of duplication. The spike at 90 involves a duplication of a product with a unit price of 3 cents, which is insignificant and highly unlikely to be a fraud. In this case, with 327 records, selection of targets for investigation was relatively straightforward. One slightly unusual result was obtained. The next step would be to filter the entire Trans file for product 080126008, demonstrating, in this example, that the range of order quantities is relatively normal.
Module 4 Manipulating Data 219 The Benford Command There are many ways to narrow down the selection, including the following: Employing More Leading Digits The Benford command allows analyses of up to 6 digits. If more digits are used, more combinations are generated and therefore each subset is smaller. If a data file of 10,000 records is analyzed using 3 leading digits, the largest resulting bar on the graph should contain an average of 43 records. Certain types of fraud are less likely to be caught as the number of digits is increased. For example, if the person attempting the fraud creates false invoices within a range that is just below some threshold, such as $4,926, $4,933, and $4,987, the three-digit test will not reveal any significant duplication. For this reason, a full digital analysis usually involves testing several different digit combinations from the same data. Drilling Down and Setting a New Filter You can drill down by double-clicking a specific bar on the chart. (See Graphing Command Results on page 307 for more details.) The new view has a filter limiting it to items with the relevant digit combination. For digit combination 57 it will take this form: ((LEADING(Amount,4) = "57")). You can add conditions to this filter to further limit which items appear in the view. For example, if your concerns involve only potential high-value errors or frauds, you may want to set the additional filter Amount > 5000. Be sure to follow the precise order of the steps. If you apply an additional filter criterion before running the Benford command, the result may be strongly distorted. In the above case, numerous items with initial digits 1-4 would be deleted and the data set might wind up with massive variations from the expected Benford values for that reason alone. However, after you have run the Benford command and selected a subset for investi- gation, you can safely apply additional filters as necessary. It may also make sense to filter by type of transaction or region, or even to classify the subset, for example, by product or employee code. ACL supports multiple drill-down, so you can graph the newly classified subset, select one bar or pie slice from the new graph, and drill down to view only the items it represents. Note: Note: for analyses involving more than 3 digits, the command is output to a file rather than the command log, to avoid unreasonably long results in the log. For example, 4 leading digits will produce 9,000 lines of output, and 6 leading digits will result in 900,000 lines. 220 ACL for Windows 7 Workbook The Benford Command Using Sorting & Filtering This example repeats the steps from the previous exercise. However, this time you will send the output to a file and sort by Z-statistic rather than graphing. You will also omit items of value less than 1.00. To perform a two-digit digital analysis with bounds on a numeric field, sending the output to a file: 1. Select Analyze from the menu bar and choose Benford. ACL displays the Benford dialog box. 2. Select Amount from the Benford On drop-down list. 3. In the Number of Leading Digits text box, enter 2. 4. Check the Include Upper and Lower Bounds check box. 5. Enter "amount > 0.99999999" in the If text box. 6. Click [Output] to display output options. 7. Select File. Enter Trans2 in the Name text box to name the file. 8. Click [OK] to execute the command. ACL will open the new Trans2 file once the command is complete. Verify that the command was executed correctly: there should be 90 records from 10 through 99. The next step is to sort the new file by Z-statistic: 1. Select Data from the menu bar and choose Sort. ACL displays the Sort dialog box. 2. Select Zstat from the Sort On list view. 3. Enter the file name Trans2sorted in the To text box. 4. Click [OK] to execute the command. ACL will again open the new Trans2sorted file. The highest Z-statistics are viewed by scrolling to the bottom of the sorted file. Because some records from Trans were omitted, the results are slightly different from the previous example. Once more, you can select targets for further investigation. The three largest Z-statistics belong to digit combinations that have already been investigated. The next largest, 2.111 for digit combination 15, has not; however, that combination is unusually low, not a positive spike. It is very difficult to discover any clues from records that are unexpectedly absent. The highest Z-statistic for a positive deviation that has not yet been examined is 1.689 for combination 32. Notice that this spike still falls within the upper and lower bounds. To isolate this group of records, you can use the LEADING( ) function on the Trans file.
Module 4 Manipulating Data 221 The Benford Command To isolate records with the digit combination 32 from the original transaction file: 1. In the Overview window, double-click the Trans input file definition to open it. 2. Click (Edit View Filter). The Edit View Filter dialog box appears. 3. Enter LEADING(AMOUNT,2)= '32' in the filter box. 4. Click [OK] to apply the filter. You will see eight records: The only duplicate invoice amount is $327.60, and the two duplicates relate to distinct product numbers, prices, quantities, and dates. There is nothing strange or suspicious about the result, especially given that it falls within bounds. Making the Most of Digital Analysis Digital analysis is not intended to replace older methods. Digital analysis using Benford's Law is simply a powerful way to survey large amounts of data and identify targets for further investigation. It works best in combination with other techniques. As with any use of statistics, it is important to exercise care and judgment in drawing conclusions. This lesson does not cover the full range of digital analysis: it focuses only on the proper use of the Benford command in ACL. If your data does not closely follow Benfords Law, it may be possible to perform a My Law type of analysis, substituting your own obser- vations of an historical pattern for the expected digit frequencies from Benford's formula. Other related techniques such as ratio testing and subset testing are also recommended. For further details on the Benford command, see Benford on page 129 of the ACL for Windows Reference Manual. For more information about digital analysis, see Digital Analysis Using Benford's Law, by Mark J. Nigrini, Ph.D, first published in May 2000. Both books are available from Global Audit Publications, a division of ACL Services Ltd. See the GAP book list at www.acl.com, or e-mail us at [email protected]. 222 ACL for Windows 7 Workbook The Benford Command Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit. 223 Module 5 CREATING APPLICATIONS In Module 5, you will find out how to create expressions, filters, and batches. You will learn how to use: Expressions and filters to create values, perform calculations and specify test conditions Batches to enter and store multiple commands that can then be executed as a single command Group to perform different tasks on sets of defined records in one pass of a file Loop to test the same record multiple times The Data Definition window to define and process a multiple-record-type file with fixed record lengths 224 ACL for Windows 7 Workbook Usi ng Expressi ons Lesson 5.1 Using Expressions Use expressions to enhance the capability of ACL commands by performing calcula- tions, manipulating data, and filtering data records with specific parameters. Opening Your Project To prepare for this lesson: 1. Open the Workbook.acl Project. For details on how to open an ACL Project and an input file definition, see Lesson 2.4: Overview Window on page 57. 2. Select Inventory and drag and drop it onto the (Open) button to open the of the Inventory input file that uses the data file Inventory.fil. What is an Expression? Expressions are text strings that you create to apply to data fields or records to perform a variety of tasks, and to test for true or false conditions. Expressions range from a simple field value multiplied by another field value, to a complex string of calculations. An expression can be a combination of data fields, computed fields, operators, constants, functions, and variables. Expressions can be logical, numeric, or conditional. You can save expressions so that you can quickly use the filter or calculation again in the current session or in future sessions. When you save an expression, it becomes part of the input file definition and, consequently, part of the ACL Project. An expression saved as a computed field can be added as a column to a view and appears in all field lists. The results of calculations can be displayed in this column. Expressions do not affect or change the original data. Expressions can also be stored in a Workspace for use in other ACL applications. For more information, see Workspaces on page 332 of the ACL for Windows User Guide. In this lesson you create an expression to perform a calculation. You also create and apply filters to display only the records that meet the filter condition. You then name and save filters and apply a global filter. Creating Expressions Most of the time, you will name the expressions you create so you can use them later. An expression is saved as a field called a computed field. A computed field is not actually part of the data fileit exists only in the input file definition. Although computed fields do not actually exist in data files, you can treat them just as you would physical fields. For example, you can use commands on a computed field.
Module 5 Creating Applications 225 Usi ng Expressi ons This lesson provides an example of an expression that performs calculations based on information in the Inventory input file. You will find that when the gross margin percentages are set at a minimum to calculate the sale prices of items in each product class, you can identify items that are selling with a margin lower than a minimum. Using Operators In this lesson you will use operators to build an expression in the Expression text box. The operator buttons and the functions they perform are as follows: To create an expression to identify items that are exceptions to the pricing policy: 1. Click (Edit File Definition) or select Edit from the file menu and choose Input File Definition to open the Input File Definition window. 2. Click the [Edit Fields/Expressions] tab. Then click (Add a New Expression). The field list area changes to let you define expression options. 3. In the Name text box enter Markup. 4. Click (Default Value Expression) to open the Expression Builder. Operator Evaluation parentheses unary minus (as in -14) logical NOT exponentiation multiply, divide and character concatenation add and subtract comparisons: greater than, less than, equal greater than or equal, less than or equal, not equal or & logical AND or | logical OR Note: ACL follows the standard rules of precedence when evaluating arithmetic expres- sions. 226 ACL for Windows 7 Workbook Usi ng Expressi ons To create the expression (SALEPR-UNCST)/SALEPR, which is the unit markup on each inventory item: 1. Click (Parentheses) to place parentheses in the Expression text box. 2. In the Available Fields list view, double-click SalePr to copy the field name to the Expression text box above. The field name appears inside the parentheses. 3. Click (Minus) to add it to the expression after SalePr. 4. Double-click UnCst in the Available Fields list view to copy to the Expression text box. 5. Move the cursor outside the parenthesis, to the right. 6. Click (Divide By) to add it to the expression. 7. Double-click SalePr.
Module 5 Creating Applications 227 Usi ng Expressi ons The expression is now complete and should look like this: 8. Click [OK]. The Default Value text box shows the new expression. 9. Click (Accept Entry) to add the expression to the input file definition. ACL displays MARKUP in the list of computed fields. 10. Close the Input File Definition window, and return to the view. 228 ACL for Windows 7 Workbook Usi ng Expressi ons Adding a Computed Field to the View Once you have created the expression and added it to the list of fields, you can add it to the view to see the gross margin percentage for each record. To add Markup to the view: 1. In the View window, click (Add Columns) to open the Add Columns dialog box. 2. Double-click Markup in the Available Fields list view to copy it to the Selected Fields box. 3. Click [OK] to return to the view. The field Markup appears as the far right column in the view, in which you can see the results of the calculations on each record.
Module 5 Creating Applications 229 Usi ng Expressi ons Working with Filters A filter is a special type of expression used to identify records meeting a certain set of criteria. The criteria are defined by the logical expressions you create. Filters may be temporary for the current session or named and saved in the input file definition as computed fields. In the Expression Builder window, expressions are listed as filters. Global and Local Filters Filters can be used as local or global filters. A global filter is applied to all views of an input file definition every time you execute a command from a menu or button. A global filter stays in place until you remove it or close the input file. A local filter is applied when a single command is executed for one occurrence only. Global Filters When you apply a global filter, it affects all processing in the input file. The conditions that the global filter uses remain in effect until you turn off the filter, apply another filter, or use a different input file definition. You can create and save a number of different filters, and then apply one to suit your needs at any time. When you apply a global filter, ACL hides or changes to highlight all records that test false, depending on the View Options settings in the Preferences. For more information on setting Preferences, see View Options on page 333. Local Filters You can apply a local filter with an ACL command to process only the records that match the filter condition. The filter is only applied for the duration of that command. All other records are excluded from processing. For example, you can use a local filter to extract items in inventory that have a high value, belong to a certain product class, or are located in a particular warehouse. Viewing Exceptions with Local Filters You can use a local filter with the COUNT command to quickly test for conditions in the input file. For example, you can look for items that have a negative or zero unit cost, negative or zero quantity on hand, or selling price less than cost price. When this type of data is present in an inventory input file, it indicates a potential problem. Note: The default preference hides filtered records. 230 ACL for Windows 7 Workbook Usi ng Expressi ons Creating a Filter for a Negative or Zero Unit Cost This is a local filter because it is applied for the single use of the command. The filter is named and saved so that you can retrieve and use it again. To create a local filter to search for a zero or negative unit cost: 1. Select Analyze from the menu bar and choose Count to open the Count dialog box. 2. Click [If] to open the Expression Builder. Any filters you have saved previously are listed in the Filters box. 3. In the Available Fields list view, double-click UnCst to copy the field name to the Expression text box. 4. Click (Less Than or Equal To) to add it to the expression. 5. Enter 0 (zero) in the Expression text box in which the cursor is blinking. The expression is now complete. 6. In the Save As text box, enter Negcost to name the filter.
Module 5 Creating Applications 231 Usi ng Expressi ons 7. Click [OK] to close the Expression Builder and return to the Count dialog box. The name of the filter expression appears now in the If text box. 8. Click [OK] to apply the filter to the input file and execute the command. ACL reports the result in the command log. 232 ACL for Windows 7 Workbook Usi ng Expressi ons ACL advises that three items have a unit cost that is less than or equal to zero. You can then investigate why the unit cost is less than or equal to zero. Creating a Filter for a Negative or Zero Quantity on Hand Unless reorder points have been ignored, or there is a problem with back orders, this may also indicate a problem in the data file. To create a filter to search for a negative or zero quantity on hand: 1. Select Analyze from the menu bar, and choose Count to open the Count dialog box. 2. Click [If] to open the Expression Builder. 3. In the Available Fields list view, double-click QtyOH to copy the field name to the Expression text box. 4. Click (Less Than or Equal To) to add it to the expression. 5. Enter 0 (zero) where the cursor is in the Expression text box. 6. Enter Stockout in the Save As text box to name the filter. 7. Click [OK] to return to the Count dialog box. The Stockout filter is now shown in the If text box. 8. Click [OK] again to execute the command with the filter applied. In the command log, ACL reports that four items are out of stock.
Module 5 Creating Applications 233 Usi ng Expressi ons Creating a Filter for a Sale Price Lower than the Unit Cost This last filter searches for items that have a sale price lower than the unit cost. This would indicate that there may be incorrect data in the Inventory file. To create the filter: 1. Select Analyze from the menu bar and choose Count. 2. Click [If] to open the Expression Builder. 3. In the Available Fields list view, double-click SalePr to copy it to the Expression text box. 4. Click (Less Than) to add it to the expression. 5. In the Available Fields list view, double-click UnCst. 6. Enter Loss in the Save As text box to name the filter. The Expression Builder now looks like this: 7. Click [OK] to return to the Count dialog box. The LOSS filter appears in the If text box. 8. Click [OK] to execute the command. ACL reports the result in the command log. 234 ACL for Windows 7 Workbook Usi ng Expressi ons Three items have a selling price lower than unit cost. Viewing Exceptions with a Global Filter To examine the items you identified in the last exercise as having a unit cost higher than the selling price, apply the LOSS filter as a global filter. A global filter stays in place until you remove it. To apply a filter globally: 1. Drag the Inventory input file definition default view out of the Overview window to open it. 2. Select Tools from the menu bar and choose Set Global Filter to open the Set Global Filter dialog box. Named filters are displayed in the list box. 3. Select the LOSS filter you just created. 4. Click [OK] to apply LOSS as a global filter. LOSS is shown in the Default Filter drop-down list in the view. The middle box of the status bar also indicates that LOSS is the global filter in effect. When you execute a command, the filter is reapplied and the? (question mark) beside the number of records shown in the status bar is replaced with the number of records found by the filter. The command actions are applied to the filtered records.
Module 5 Creating Applications 235 Usi ng Expressi ons Removing a Global Filter To remove the global filter: 1. In the View window, click (Remove Filter). 2. Click (Edit View Filter), or select Tools from the menu bar and choose Set Global Filter. Click [None] to turn off the currently applied filter. Click [OK] to close the Set Global Filter dialog box. Deleting a Named Expression Named expressions are computed fields. To see all the defined fields in the Input File Definition window, click (Edit File Definition) or select Edit from the menu bar, and choose Input File Definition to open the Input File Definition window. 236 ACL for Windows 7 Workbook Usi ng Expressi ons To delete a computed field: 1. In the Input File Definition window, scroll to the computed field that you want to delete and select it. 2. Click (Delete Fields) to delete the expression. A dialog box asks you to confirm that you want to delete the field. 3. Click [Delete] to delete the field and close the dialog box. Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit.
Module 5 Creating Applications 237 Usi ng Batches Lesson 5.2 Using Batches In this lesson, you will learn how to use batches to enter and store multiple commands that can then be executed as a single command. Opening Your Project To prepare for this lesson: 1. Open the Workbook.acl Project. For details on how to open an ACL Project and an input file definition, see Lesson 2.4: Overview Window on page 57. 2. Select the Ar input file definition and drag it out of the Overview window to open the default view of the Ar input file definition that is linked to the data file Ar.fil. What is a Batch? A batch is a series of ACL commands and prompts that you name and store in an ACL Project. When you run the batch, all of the commands in the batch are executed. Using batches saves you the trouble of executing each command separately. You can design a batch so that it executes automatically. Alternatively, you can design it to prompt you for information so that you can vary your responses to the prompts each time you run the batch. Why Use Batches? Batches streamline processing by letting you perform tasks automatically and repeatedly. Batches are very helpful if you repeat the same tasks on a regular basis. Batches are especially useful for developing and sharing standard applications, and for ensuring best practices are applied to data analysis. They are also useful because they automate tasks for less experienced users. Batches also allow you to process complex file structures and to undertake complex computations on data fields. Using Batches for Various Applications An application is a set of procedures intended to achieve a task. You create batches for applications. An application may refer to either a specific task or a series of tasks. For example, one application could be performing accounts receivable testing. See Appendix A: Common Uses for ACL for a list of suggested audit and analysis plans for various common application areas. 238 ACL for Windows 7 Workbook Usi ng Batches Creating a Batch There are four methods of creating batches. You can create and edit a batch using the: Batch window Batch Recorder View window Command log If you have procedures you want to process on a monthly basis (such as obtaining statistics, sampling accounts receivable transactions, and then stratifying), you can create a batch file to quickly provide statistics on the receivables and sample the data each month. When you create a batch, you must enter each command on a single line. When you run the batch, ACL processes the batch line by line, consecutively. If there are missing or incorrect parameters, the batch will process up until the point at which it reaches the error. ACL then prompts you to enter the information or display an error message. Using the Batch Window to Create a Batch When a Batch window is open, ACL enters commands you issue from the menu into the batch window. After saving and naming the batch, you can run it to execute the commands. To create a batch in the Batch window: 1. Select Edit from the menu bar and choose Batches. ACL displays the Batches dialog box. 2. Click [New]. ACL displays a new untitled Batch window. Notice that ACL displays BATCH MODE in the middle of the status bar.
Module 5 Creating Applications 239 Usi ng Batches Like an input file definition, a batch is called Untitled until you save it with a name. You will name the batch when you close the Batch window. Before you select commands to create the batch, you can enter a comment to describe the purpose of the batch by doing the following: 3. Click (Edit Batch Note) to display the Batch Notes window. 4. Enter This is an example of an AR sample batch. 5. Close the Notes window. Note: If you make an error while editing, you can undo your last edit by pressing CTRL+Z, or selecting Edit from the menu bar and choosing Undo. Edit the command Find and replace Group Else Loop Build New Dialog Edit batch note End 240 ACL for Windows 7 Workbook Usi ng Batches 6. Click (Statistics) or select Analyze from the menu bar and choose Statistics to display the Statistics dialog box. 7. Click the Amount field, then click [OK]. The Statistics command is now written in your batch. 8. Select Sampling from the menu bar and choose Sample. ACL displays the Sample dialog box. MUS and Fixed Interval are selected by default. 9. In the Interval text box enter 25000. 10. In the Start text box enter 234.
Module 5 Creating Applications 241 Usi ng Batches 11. Click the [More] tab to display the additional options. 12. Select Fields. 13. Click Extract Fields to open the Selected Fields dialog box. 14. Click [Add All] to copy all the available fields to the Selected Fields list box. Click [OK]. 15. Click the [Main] tab to return to the Main options. 242 ACL for Windows 7 Workbook Usi ng Batches 16. In the To text box enter Armonth. The Sample dialog box now looks like this: 17. Click [OK] to record this Sample command in the batch. 18. Close the Batch window. ACL prompts you to save the changes to the batch. 19. Enter in the text box to name the batch Arsample. 20. Click [OK] to name the batch and close the dialog box.
Module 5 Creating Applications 243 Usi ng Batches 21. In the Overview window, click (Expand) next to the Batches icon to expand Batches. Arsample is in the list. 22. Drag the batch name to the application workspace. ACL asks you if you want to run or edit the batch. 23. Click [Edit] to open the Arsample Batch window. 24. Close the Batch window. Run the Arsample Batch To run the batch: 1. Drag the Arsample batch icon from the Overview window to the application workspace. ACL asks you if you want to run or edit the batch. 2. Click [Run]. ACL runs the Arsample batch. The results appear in the command log. 244 ACL for Windows 7 Workbook Usi ng Batches Using the Batch Recorder Use the Batch Recorder to create a batch while you use ACL interactively. When you set the Batch Recorder on, ACL automatically records all commands and options as you select them and then issues the commands. The advantage of using the Batch Recorder is that ACL may prompt you to correct any mistakes while you enter the batch. If you enter the commands in a Batch window without using the Batch Recorder, ACL will not show error messages until you run the batch. When you set the Batch Recorder on, ACL automatically creates a SET LEARN ON entry in the command log. Similarly, when you turn the Batch Recorder off, a SET LEARN OFF entry appears in the command log. In this exercise, you create a batch that opens the Armonth input file, produces a control total on the amount field and then samples all the fields. To prepare for this exercise, drag the icon beside the Ar input file definition onto the application workspace. To use the Batch Recorder to recreate the accounts receivable sample batch: 1. Select Tools from the menu bar and choose Set Batch Recorder On. ACL displays the (Batch) icon with a moving pen on the status bar. The recorder now records all commands you enter in a batch, until you choose Set Batch Recorder Off from the Tools menu. 2. In the Overview window, double-click Armonth to open the input file. 3. Click to display the Statistics dialog box. 4. Select Amount, then click [OK]. ACL displays the result in the command log. 5. Select Sampling from the menu bar and choose Sample. The Sample dialog box opens. Leave the MUS and Fixed Interval options selected. 6. In the Interval text box, enter 25000. 7. In the Start text box, enter 234. 8. Click the [More] tab to display additional options. 9. Select Fields. 10. Click [Extract Fields]. ACL displays the Selected Fields dialog box. 11. Click [Add All]. Then click [OK]. 12. Click the [Main] tab to return to the Main options. 13. In the To text box, enter Armonth2.
Module 5 Creating Applications 245 Usi ng Batches 14. Click [OK]. ACL writes the Sample command to your batch, and displays the default view of Armonth2. The results of the commands appear in the command log. 15. Select Tools from the menu bar, and choose Set Batch Recorder Off. ACL now stops recording your actions. The Save As dialog box appears, prompting you to save the batch by entering a name. 16. Enter Arsample2 in the text box to name the batch. 17. Click [OK] to save the batch and close the dialog box. Run the Arsample2 Batch To run the batch: 1. To prepare, open the Ar input file again. 2. Click beside Batches in the Overview window to display a list of batches. 3. Double-click Arsample2. ACL asks you if you want to run or edit the batch. 4. Click [Run]. ACL asks you if you want to overwrite the Armonth2 file that was created by the Sample command. 5. Click [Yes] to overwrite the file. ACL displays the result in the command log. Creating a Batch from a View You can also create a batch from a view. ACL keeps track of all the steps you take to create a view and can recreate the steps as a batch. The data file must be one that was created using ACL. If you want to produce a report that lists the inventory items at a particular location each month, you can create a batch file from an existing view. The batch automatically processes a report to arrange it the same way you created the view. You can then run the batch each month to update the report. To create a batch file from a view: 1. Drag the Sampsize input file definition you created in lesson 4-8 into the application workspace to open it. (See Drawing an MUS Fixed Interval Sample on page 187.) 2. Select Tools from the menu bar, and choose Create Batch from File History. ACL asks if you want to save the default view under a different name. Click [Yes]. 3. ACL creates the batch, and then prompts you to name it. 4. Enter Sampsize2 in the text box. 5. Click [OK] to close the dialog box. 246 ACL for Windows 7 Workbook Usi ng Batches To see the new batch: 1. Click (Expand) beside Batches in the Overview window, and drag Sampsize onto the application workspace. 2. ACL asks you if you want to run or edit the batch. Click [Edit]. 3. The Sampsize2 batch window opens. The window shows the list of commands that produced the Sampsize2 input file. Close the Batch window. To run the batch: 1. Double-click Sampsize2 in the list of batches. ACL prompts you to either edit or run the batch. 2. Click [Run]. ACL asks if you want to overwrite the existing file. 3. Click [Yes]. ACL displays all of the commands you used to create the input file and the view in the command log. Using the Command Log to Create a Batch The final way to create a batch is to copy commands from the log and paste them in a new or existing batch file. Once you have issued a command, you can copy it from the command log and paste it into a Batch window, either to create a new batch or to edit an existing one. Editing a Batch You may want to change some of the commands or options the next time you run Arsample2. For example, you may want to change the sampling interval and the random start, based on the current months population of accounts receivable transactions. To change the interval and random start values in Arsample2: 1. Drag and drop the batch Arsample2 onto the application workspace. ACL asks you if you want to run or edit the batch. 2. Click [Edit]. The Arsample2 batch window opens to display its contents. 3. Double-click SAMPLE in the Batch window. Then click (Edit Command). The Sample dialog box opens. 4. Enter 39044 in the Interval text box. 5. Enter 194 in the Start text box. 6. Since all other options remain the same, click [OK]. ACL changes the parameters of the Sample command in the Batch window.
Module 5 Creating Applications 247 Usi ng Batches 7. Close the Batch window. ACL prompts you to save the changes to the batch. 8. Click [OK] to save the edited batch under the same name. In practice, you would run the edited batch to analyze a new file, perhaps one that contains the current months transactions. Here, however, you will re-run the batch using the same file to illustrate another method of running a batch. To re-run a batch using the menu bar: 1. Select Tools from the menu bar and choose Do Batch. 2. Click Arsample2, then click [OK]. ACL asks if you want to overwrite the Armonth input file. 3. Click [Yes]. ACL runs the edited batch, and displays the results in the command log. Running a Batch There are several different methods you can use to run a batch. You can only run one batch at a time, although one batch can call or start other batches. 248 ACL for Windows 7 Workbook Usi ng Batches To run a batch, use any of the following: Overview window Command log Menu bar To run the Arsample2 batch from the Overview window: 1. Double-click Arsample2. ACL prompts you to either edit or run the batch. 2. Click [Run]. ACL executes the commands in the batch and displays the results in the command log. Click [Yes]. To run the Arsample2 batch in the command log: 1. In the text box in the command log, enter DO BATCH Arsample2. 2. Click (Accept Entry) or press ENTER to run the batch. Click [Yes]. To run the Arsample2 batch from the menu bar: 1. Select Tools from the menu bar, and choose Do Batch to display the Do a batch dialog box. 2. Select the Arsample2 batch, and click [OK] to run the batch. Click [Yes]. To interrupt batch processing: Press ESC Click [Yes] to cancel the batch Running a Batch within a Batch ACL allows one batch to call another batch. If a batch includes the lines: DO BATCH_A DO BATCH_B DO BATCH_C As part of its commands, the batch executes as usual until it reaches the command DO BATCH_A. At that point, it executes the commands stored in BATCH_A. When this batch is complete, it returns to the original batch and executes BATCH_B. Similarly, BATCH_C is executed when BATCH_B completes. When BATCH_C is complete, the original batch continues.
Module 5 Creating Applications 249 Usi ng Batches Using Interactive Batches You can structure a batch so that ACL prompts for specific information when it is run, so that you do not need to edit the batch each month, or each time you run it. For example, if you want a batch to prompt for sampling intervals, random starts, department numbers, or report headers and footers, you can create an interactive batch that prompts for information while it is running. Interactive batches are ideal for standard applications. You can simply respond to the prompts with the appropriate values. Interactive batches also reduce batch maintenance by lowering the possibility of error caused by repeated editing. Using the Accept Command The Accept command is a special command you can use to make a batch interactive. The Accept command uses a prompt string to prompt you for a response. When a batch is running and ACL encounters an Accept command, it stops running and displays a prompt that you have defined. In the following exercise, you add the Accept command to specify the prompt that is displayed when the batch is run. It also tells ACL the name of the variable in which to store your response. The variables are SAM_INT and RAN_START. ACL stores the values you enter in these variables. To add the Accept command to the batch: 1. In the list of batches in the Overview window, double-click Arsample2. ACL asks you if you want to run or edit the batch. 2. Click [Edit]. 3. Edit the batch by typing the following additional information on two new lines below the line OPEN Armonth: ACCEPT 'Enter sampling interval:' TO SAM_INT ACCEPT 'Enter random start:' TO RAN_START The Batch window now looks like this: 250 ACL for Windows 7 Workbook Usi ng Batches 4. Close the Batch window. The dialog box prompts you to save the changes to the batch. 5. Click [OK] to replace the Arsample2 file with the new interactive version. Running the Batch You will define variables as the batch is running. To run the interactive batch: 1. Double-click Arsample2 in the list of batches in the Overview window. ACL asks you if you want to run or edit the batch. 2. Click [Run]. A dialog box prompts you to enter the sampling interval. This is the first Accept command prompt. Execution of the batch stops until you enter a response. 3. Enter 25000 and click [OK]. Another dialog box appears and this time prompts you to enter the random start. 4. Enter 234 and click [OK]. A dialog box asks if you want to overwrite the input file. 5. Click [Yes] to overwrite the Armonth2 file, which is now the old version. ACL reports the result in the command log. Using Dialog Boxes in Interactive Batches The Dialog Builder is an additional, more powerful option for building interactive batches. It lets you design your own batch dialog boxes that prompt for user input to perform a wide range of functions. You can select a full range of controls, including radio buttons and check boxes, to create a dialog box. You also have the freedom to customize the size and placement of each control.
Module 5 Creating Applications 251 Usi ng Batches For complete information on how to create dialog boxes, see Dialog Builder on page 153 of the ACL for Windows Reference Manual and online Help. The ACL for Windows Reference Manual and online Help contain complete information on the available options. Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit. 252 ACL for Windows 7 Workbook Groups and Loops i n Batches Lesson 5.3 Groups and Loops in Batches 5 The Group command greatly increases the power and flexibility of a batch. It executes a series of commands on each record in one pass of a data file. You can use the Group command to perform different tasks on sets of defined records in one pass of a file. The Loop command processes the same record many times. Using Loop creatively can dramatically improve and simplify your ability to process complex file structures. The Loop command operates only within a group. Both the Group and Loop commands are only available in a batch. Opening Your Project To prepare for this lesson: 1. Open the Workbook.acl Project. For details on how to open an ACL Project and an input file definition, see Lesson 2.4: Overview Window on page 57. 2. In the Overview window, drag and drop Inventory onto the (Open) button. The Inventory input file default view opens. Using Groups Using the Group command allows you to: Improve processing speed and efficiency Perform programming actions spanning a number of records Perform complex operations on a file while referring to information in prior records Process multiple-record-type files Process data in complex variable length record structures Creating Groups In this lesson, you use three types of groups: A simple group consists of a Group command followed by a set of ACL commands terminating with an End command. A simple group processes the commands sequentially on all records in one pass of the file. A simple conditional group consists of the Group command, a series of other commands, and the End command. Conditional statements issue each command only if the conditions specified in the group are true. Otherwise, ACL does not execute the command. Adding conditions enables your batch to deal with differing circumstances.
Module 5 Creating Applications 253 Groups and Loops i n Batches Nested groups are groups within groups that make it possible for additional groups of commands to be carried out while the original group is processing. You can place most commands in groups, as long as they do not depend on the output of a previous command in the group. The Sort, Accept, Index, and Do commands cannot be used in a group. To build a group into a batch do any of the following: Enter commands directly into a Batch window. Select and execute commands on the Data, Analyze, and Tools menus with the Batch window open. Copy commands from the command log, and paste them into the Batch window. Creating a Simple Group You can issue the Count, Statistics, Histogram, and Stratify commands individually to obtain control totals information for a large data file before beginning any specific data analysis project. It is simpler and faster, however, to use a simple group to process all four commands as a unit. Create a Group to Obtain Control Totals In this exercise, you use the Batch window to create a group that uses the Count, Statistics, Histogram, and Stratify commands. To insert commands in the Batch window, click command buttons, or choose commands from menus, and then set parameters in the command dialog boxes. You can also enter the commands directly in the Batch window. To create the group: 1. Select Edit from the menu bar and choose Batches to open the Batches dialog box. 2. Click [New] to open an Untitled Batch window. 254 ACL for Windows 7 Workbook Groups and Loops i n Batches 3. Click (Group) in the Batch window. ACL displays the Group dialog box. 4. Click [OK] to add the Group command in the Batch window. 5. Select Analyze from the menu bar, and choose Count to open the Count dialog box. 6. Click [OK] to add the Count command to the Batch window. 7. Click (Statistics), or select Analyze from the menu bar and choose Statistics to display the Statistics dialog box. The Statistics On list view displays the fields in the Inventory input file. 8. In the Statistics On list view, click the Value field. 9. Click [OK] to add the Statistics command with the command parameters to the Batch window. 10. Select Analyze from the menu bar, and choose Histogram to open the Histogram dialog box. 11. Select Value from the Histogram On drop-down list. 12. Enter 0 in the Minimum text box, and 100000.00 in the Maximum text box. Leave Intervals at the default of 10. 13. Click [OK] to add the Histogram command with the command parameters to the Batch window. 14. Click (Stratify), or select Analyze in the menu bar and choose Stratify to display the Stratify dialog box. 15. Select Value from the Stratify On drop-down list. 16. In the Accumulate Fields list view, click Mktval. 17. Enter 0 in the Minimum text box, and 100000.00 in the Maximum text box. Leave Intervals at the default of 10.
Module 5 Creating Applications 255 Groups and Loops i n Batches 18. Click [OK] to add the Stratify command with the command parameters below the Group, Count, Statistics, and Histogram commands in the Batch window. 19. Click (End) in the Batch window. The Batch window now looks like this: 20. Close the window. ACL asks you to name and save the batch. 21. Enter Invgrp1 and click [OK]. Running a Batch To run the Invgrp1 batch containing the group you have just created: 1. In the Overview window, select Invgrp1 in the list of batches. 2. Click to open the dialog box that prompts you to edit or run the batch. 3. Click [Run]. ACL runs the batch and displays the results. Note: If you include the Statistics command in your batch and do not specify minimum and maximum values in subsequent commands, the Command Log displays the minimum and maximum values generated by the Statistics command. 256 ACL for Windows 7 Workbook Groups and Loops i n Batches Scroll through the command log to examine the results of the commands. Notice that the results are listed by command number in the form COMMAND <3>, and so on. The Group command itself is considered number 1. ACL numbers each command in the group sequentially, starting at <2>. You may want to refer to the command log, or print a portion of it to document your work in this section. Creating a Conditional Group You can edit the batch you have just created to include a conditional group that only processes commands for records with a product class number less than 05. To edit the Invgrp1 batch to add the condition: 1. In the Overview window, double-click Invgrp1 in the list of batches. ACL asks you if you want to edit or run the batch. 2. Click [Edit]. The Invgrp1 Batch window opens. 3. Position the cursor to the right of the Group command. 4. Press the spacebar, and enter IF PRODCLS <"05". 5. Close the window. ACL asks you to save the changes. 6. Enter Invgrp2. Click [OK] to save the conditional group with the new batch name. To run the new group: 1. In the Overview window, double-click Invgrp2. ACL asks you if you want to edit or run the batch. 2. Click [Run]. ACL runs the batch and displays the result.
Module 5 Creating Applications 257 Groups and Loops i n Batches Using the Else Command in a Conditional Group You can use the Else command whenever the Group command contains an If test. The Else command instructs the group to perform an alternate task on records that do not meet the If test condition. In this exercise, the Else command tells the group what to do if a product class number is not less than 05. To add the Else command to the group in the Invgrp2 batch: 1. In the Overview window, double-click Invgrp2 in the batch list. ACL asks you if you want to edit or run the batch. 2. Click [Edit] to open the Invgrp2 batch window. 3. Position the cursor at the beginning of the line containing the End command. 4. Click (Else). ACL displays the Else dialog box. 5. Click [OK]. ACL adds the Else command to the batch. 6. Click (Total), or select Analyze from the menu bar and select Total to open the Total dialog box. 7. In the Total Fields list view, click Value. 8. Click [OK] to add the command to the batch and close the Total dialog box. 9. Close the Batch window. ACL prompts you to save the changes to the batch. 258 ACL for Windows 7 Workbook Groups and Loops i n Batches 10. Click [OK] to save the changes to the Invgrp2 batch. In this group, if records have a product class number that is 05 or above, the Else command instructs ACL to total their value. To see how the Else command affects the group, run the batch: 1. In the Overview window, click Invgrp2. 2. Click (Open). 3. Click [Run]. ACL runs the batch, and displays the results in the command log. As you can see, the group stratifies records with a product class number under 05, and then totals the Value field for records for the remaining class numbers. Using Multiple Else Commands in Groups You can use multiple Else commands to perform various procedures, provided If tests are included. A group can only have one Else containing no If test, and it must be the last Else in the group. In this exercise, you use Else to perform different tasks on different product class numbers.
Module 5 Creating Applications 259 Groups and Loops i n Batches To edit the batch to add Else instructions: 1. In the Overview window, double-click Invgrp2 to display the batch dialog box. 2. Click [Edit] to open the Invgrp2 batch window. 3. Typing each command on one line, change the batch to the following: GROUP IF ProdCls<"05" COUNT STATISTICS ON Value TO SCREEN NUMBER 5 HISTOGRAM ON Value MINIMUM 0 MAXIMUM 100000.00 INTERVAL 10 TO SCREEN STRATIFY ON Value ACCUMULATE MKTVAL MINIMUM 0 MAXIMUM 100000.00 INTERVAL 10 TO SCREEN ELSE IF ProdCls="05" TOTAL Value ELSE IF ProdCls="06" STRATIFY ON Value MINIMUM 0 MAXIMUM 100000.00 INTERVAL 10 ELSE IF ProdCls="07" TOTAL MktVal ELSE TOTAL Value END On records that have a product class between 01 and 04, ACL performs the Count, Statistics, Histogram, and Stratify commands 260 ACL for Windows 7 Workbook Groups and Loops i n Batches The additional Else commands accomplish the following: On records in which the product class is 05, ACL calculates only the inventory value. On records in which the product class is 06, ACL Stratifies on Value. On records in which the product class is 07, ACL totals the Mktval. For all remaining records, ACL totals the inventory value. You can see that the group has evolved into a complex set of procedures. 4. Close the window. ACL asks if you want to save the batch. 5. Enter Invgrp3, and click [OK] to save the group as Invgrp3. To run the edited version of Invgrp3: 1. In the Overview window, double-click Invgrp3. 2. Click [Run] to run the batch. ACL reports the results. 3. Scroll through the window to view the complete results of the group. First, ACL displays all four commands for items in product classes below 05. Next, ACL reports that 13 of 79 records met the test for command <6>. Then, ACL gives you a total for command <7>, which is equal to the total value of all items that did not meet the first test ProdCls < "05". The inventory value for product class 06
Module 5 Creating Applications 261 Groups and Loops i n Batches (command <9>) has been stratified, and the market value for product class 07 (command <11>) has been totalled. The inventory value for the remaining product classes (command <13>) has also been totalled. Creating a Nested Group A group within a group is called a nested group. Using a nested group lets you control which conditional tasks are performed on a record and further extends the power of groups. In this exercise: Commands <2> through <7> (Count through Else) are only executed if the product class is less than 05. Commands <4> and <5> are only executed if the value of the inventory is greater than 0. And because this second, nested group is inside the first group, commands <4> and <5> are also only executed for records in which ProdCls is under 05 and Value is greater than 0. Since command <5> also includes a test, it is only executed if ProdCls < "05" and Value >0 and ProdStat = "B". Finally, for records in which the product class is 05 or higher, commands <8> and <9> total the inventory value. To create a nested Group in the Invgrp3 batch: 1. Double-click Invgrp3. Then click [Edit] to open the batch. 2. Change the batch to the following (making sure each command is on one line): GROUP IF ProdCls<"05" COUNT GROUP IF Value>0 STATISTICS ON Value HISTOGRAM ON Value MINIMUM -10167.60 MAXIMUM 100800.00 INTERVAL 10 IF ProdStat="B" END STRATIFY ON Value ACCUMULATE Value MktVal MINIMUM -10167.60 MAXIMUM 100800.00 INTERVAL 10 ELSE TOTAL VALUE END 3. Close the Batch window. ACL asks you to save the changes. 4. Click [OK] to save the batch and close the dialog box. 262 ACL for Windows 7 Workbook Groups and Loops i n Batches To run Invgrp3: 1. In the Overview window, double-click Invgrp3. 2. Click [Run]. ACL displays the result in the command log. Using Variables in Groups Variables are similar to fields in ACL. Most fields are defined as having a certain position and field type or computed value in a record. As the data is processed, these fields take on a new value for each record in the file. Although they act like fields for the most part, variables are different in one very important way: their value only changes when explicitly altered, deleted, or when you exit from ACL. If you give a variable a value of seven, that value is retained until you explicitly change it to something else or quit the current ACL session. Automatic Variables ACL automatically creates variables when commands such as Count, Total, and Statistics are executed. These variables are named COUNTn, TOTALn, ABSn, and so on. The n is equal to one, unless the commands are issued within a group.
Module 5 Creating Applications 263 Groups and Loops i n Batches For variables created by commands with a group, n refers to the sequential line number. Blank lines are not assigned a line number. For example: <1> GROUP IF ProdCls<"05" <2> COUNT <3> STATISTICS InvOH <4> HISTOGRAM InvOH <5> END ACL uses the line numbers of each command to create a unique variable to store its result. The outermost Group command is considered line 1, and each subsequent line containing a valid command or comment is given a sequential line number. In the above example, ACL would create the variables COUNT2, STATISTICS3, and HISTOGRAM4. By comparison, executing the Count command without using a group produces the variable COUNT1, because it is the only command being executed. User-Assigned Variables You can also assign values to variables of your choice using the Assign command. The Assign command is most often used to carry information from one record to subse- quent records, or to retain cumulative totals for use during processing. As with all variables, they retain their value until you explicitly change or delete them, or quit the ACL session. For example, if there are only supposed to be two outstanding invoices per customer in a file, you will need to extract details of any additional ones in order to follow up. To keep track of the outstanding invoices in the file, use variables as follows: COUNT=1 OLD_CUST='CustNo' GROUP IF CustNo<>OLD_CUST COUNT=1 OLD_CUST=CustNo ELSE COUNT=COUNT+1 EXTRACT RECORD IF COUNT>2 TO Extra_Invoices END For more information, see Variables on page 321 of the ACL for Windows User Guide and online Help. Note: Variables whose names begin with an underscore are not deleted when you quit ACL. They are saved in the ACL Project and restored the next time you open that Project. 264 ACL for Windows 7 Workbook Groups and Loops i n Batches Using Loop You use Loop to process complex files. A common example of a type of file Loop would be useful for is a COBOL data file that contains Occurs or Occurs Depending On clauses. Use Loop within a Group to process individual records until its test encounters a record for which the test is false. The syntax for the Loop command is: GROUP LOOP WHILE test ACL commands END END The commands between Loop and End are executed repeatedly for the current record as long as the test specified is true. When processing encounters a false value, Loop stops and the Group processes the next sequential command or advances to the next sequential record. Since you can only use Loop in a Group, and Group can only be used in batches, Loop is only available for use within batches. Using the OFFSET( ) Function with Loop Use the OFFSET( ) function with Loop to adjust the starting position of a field being evaluated within the current record. The syntax for the OFFSET( ) function is: OFFSET(fieldname,N) N is any valid ACL numeric expression, variable or constant. The combination of Loop and OFFSET( ) is particularly useful when you are processing mainframe data files that contain repeated blocks of information. COBOL data files that contain Occurs or Occurs Depending On clauses, for example, have a set of fields that occur either a fixed or varied number of times. It is more effective to define one set of generic field definitions that you use to process all occurrences. For more information, see Loop on page 237 of the ACL for Windows Reference Manual and online Help. Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit. Note: The Loop While test must eventually yield a false value, or the Loop will remain in an infinite loop.
Module 5 Creating Applications 265 Worki ng wi th Mul ti pl e-Record-Type Fi l es Lesson 5.4 Working with Multiple-Record-Type Files 5 The data files used in previous lessons in this workbook have just one record type, which means that all lines, or records, in the file contain the same type of information. Some files, however, consist of more than one record type. The records in a multiple-record-type file contain different types of data, such as customer name, invoice details, and invoice summary records. Multiple-record-type files may also be report files which contain titles, column headings, subtotals and totals, and other types of records. These multiple-record-type files can also have record lengths that are fixed or variable. In fixed length files, all records are the same length. In variable length files, line lengths vary in several ways. There are three common types of variable length file: CR/LF files, in which the end of each record is indicated by a carriage return, a line feed, or a carriage return/line feed combination IBM variable length files Custom files, in which the length of each record is either stored in a field in the record or is not stored in the record ACL recognizes CR/LF files and IBM variable length files. Custom files must be defined by the user. For more information on variable length files, see Chapter : Variable-length Files in the ACL for Windows User Guide and online Help. Steps in Processing Multiple Record Types There are three main steps in processing multiple record types: 1. Create an input file definition. 2. Specify the records by creating a filter for each. 3. Define fields for each record type. Opening Your Project To prepare for this lesson: 1. Open the Workbook.acl Project. For details on how to open an ACL Project and an input file definition, see Lesson 2.4: Overview Window on page 57. 2. In the Overview window, select Input File Definitions, and then click (New). ACL displays the Welcome screen of the Data Definition Wizard. Click [Next]. 3. On the Select Data Source screen, choose Disk. Click [Next] to open the Select File to Define dialog box. 266 ACL for Windows 7 Workbook Worki ng wi th Mul ti pl e-Record-Type Fi l es 4. Select Report.txt and advance through the Wizard to the File Format screen, where Print Image (Report) File is automatically selected. 5. Instead of Print Image (Report) File, select Other file format, then click [Next] to open the File Properties screen. 6. On the File Properties screen, choose Skip to Finish, and then click [Next] to dismiss the Wizard. In this lesson you use the Input File Definition window. Click [Finish]. 7. Click [OK] to save the input file as Report. The Input File Definition window opens, displaying the Report.txt data file. Reading Report Files A report file is an example of a multiple-record-type file. In this lesson, you learn how to process report files by creating an input file definition and defining filters for the record types. You then filter the records for each record type to define the fields. Using the filters, you process the data for one record type at a time, ignoring the rest of the infor- mation in the report, such as headings and subtotals. A report file, sometimes called a print spool file, is usually an electronic duplicate of a hard copy report.
Module 5 Creating Applications 267 Worki ng wi th Mul ti pl e-Record-Type Fi l es If the data you want to analyze is not available in its original format, or you want to process data from a relational database, you need to turn it into a flat sequential file. The easiest way to obtain a flat sequential file for this type of data is to generate a report file, which typically includes additional page formatting information. Creating a report file is a simple process in most minicomputer and mainframe environ- ments, as these systems typically spool their output to a file before printing. Make a copy of the spool file before it is deleted. The resulting file is usually a CR/LF file or, in some cases, a fixed record length file. Both file types are simple to process. In a PC environment, capturing the data can be slightly more challenging. If you are connected to a local area network (LAN), you can use the LAN print spooler the same way you would use a mainframe spooler. In a stand-alone environment, there are a number of public-domain, shareware, and utility programs that you can use to direct printer text to a disk file. You usually obtain a CR/LF file, which ACL can read directly, as illustrated in Steps in Processing Multiple Record Types on page 265. Understanding Record Types in a Report File Each line of the Report.txt file is a record. The record types are the different components of the report. For example, a page header, a column heading and a total line are all record types. To ignore all of the records that contain page formatting details, report titles, column headings, subtotals, and so on, you define a filter that includes a characteristic unique to only the data records. For example, most of the records consist of a Product Number Description, Quantity, Unit, and Amount. These records also have an Amount field with a decimal point character in a specific position. As long there is no decimal point character in the same position in any non-data records, you can define a filter using a decimal character to process only the data records. 268 ACL for Windows 7 Workbook Worki ng wi th Mul ti pl e-Record-Type Fi l es In this lesson, you are only interested in the data in the header and detail record types. You create a filter for each of these record types, and then define the following fields for each record type: You can see that there is no data in record 1. Record 2 contains the date, report title, and page number. Record 3 contains the time and the second line of the report title. Records 5 and 6 contain column headings. Record 7 is empty. Record 8 is the first data record. This is a header record that contains the product class and product class description information. You will return to this record later, as it contains some of the data you want to define. Record 10 is the first detail line. The detail lines contain the majority of the data with which you want to work. Notice that the data in each of the detail records 10 through 26 is consistent in its position within the record and its length. Record 28 is the total line for the first product class. If you want, scroll all the way to record 232 to see the report totals. Defining Filters and Fields for a Multiple-Record-Type File You process one record type at a time by creating a filter for a record type, and then applying the filter to the file. With the filter applied, you define fields for the filtered records. To begin, you distinguish the lines that contain information you want from formatting and total lines. To identify only data records, you can define a filter that includes a characteristic that is unique to the data records. For this example, all data records have an amount field with a decimal point in a certain position. Given that none of the page formatting records has Record Type Field Header Product Class Product Class Description Detail Product Number Product Description Quantity on Hand Unit Cost Extended Cost
Module 5 Creating Applications 269 Worki ng wi th Mul ti pl e-Record-Type Fi l es a decimal point character in the same position as the data records, no page formatting records will appear in the view that you create. Defining the Header Filter Notice that each of the header records has a title followed by a colon. Since none of the other lines contains colons, you can define a filter that tests for a colon to identify the header records. To define a Header filter: 1. Click the [Add a New Data Filter] tab to display the filter definition options. 2. In record 8, click the colon after Product Class, then click [Include]. 3. Click (Accept Entry). ACL asks you to save the filter. 4. Enter Header and then click [OK]. ACL asks you if you want to keep the filter active. 5. Click [No] because you still need to define a filter to identify the detail lines. Defining the Detail Filter To define the five columns of detailed inventory information, you need to identify a unique characteristic in the detail (data) lines. If you find that there is no single charac- teristic that uniquely identifies a record type, you can use a combination of character- istics. When you scanned through this file, you may have noticed that all of the detail lines in the report have a decimal point in the Unit Cost column and the Total Cost column. Either of these can be used as the characteristic of the filter. Look at the product number information on the left of the screen. Notice that the first ten spaces of the class total lines are blank. This is because the phrase Class Totals is indented to the right. Detail lines are only indented five spaces. You can use this as an optional second characteristic. To define a Detail filter: 1. Click the [Add a New Data Filter] tab to display the filter definition options. 2. In record 10, click the decimal in the Unit Cost field, then click [Include]. 3. Click (Accept Entry). ACL asks you to save the filter. 4. Enter Detail and then click [OK]. ACL asks if you want to keep the filter active. 5. Click [No]. Defining the Header Fields You are now ready to define the fields you want to use from the Report.txt file. First, you will define only fields from the header lines and ignore the other lines in the file. 270 ACL for Windows 7 Workbook Worki ng wi th Mul ti pl e-Record-Type Fi l es To define the two header fields: 1. At the top right of the Input File Definition window showing filter definition options, there is a drop-down list that displays all of the filters you have defined. Select Header from the Filters drop-down list to apply the Header filter to the records. All other records are highlighted. 2. In record 8, click on position 19. ACL enters 19 in the Start box. 3. Click in the Len. box and enter 2. 4. In the Name text box, type ProdCls. 5. Click (Accept Entry). A dialog box appears asking you to confirm if the infor- mation from this record type relates to subsequent records. 6. Click [Yes], as the Product Class and Description information pertains to the subse- quent detail records. 7. Still in record 8, click in position 25. ACL enters 25 in the Start box. 8. In the Len. box enter 19. 9. In the Name text box enter ClassDesc.
Module 5 Creating Applications 271 Worki ng wi th Mul ti pl e-Record-Type Fi l es 10. Click (Accept Entry). The Input File Definition window now looks like this: Defining the Detail Fields You will now define fields for the detail lines and ignore the other lines in the report file. To define five detail fields: 1. Select Detail from the filters drop-down list. ACL applies the Detail filter. All other record types are highlighted 2. With the Detail filter active, in record 10, the first detail line, click in position 6. ACL enters 6 in the Start box. 3. In the Len. text box enter 9. 4. In the Name text box, enter ProdNo to name the field. 5. Click (Accept Entry). ACL asks you to confirm if the information from this record type relates to subsequent records. 6. Click [No]. The information in detail lines constantly changes and does not need to be retained from one record to the next. 272 ACL for Windows 7 Workbook Worki ng wi th Mul ti pl e-Record-Type Fi l es 7. Define the remaining four fields for the detail lines, as follows: 8. The Input File Definition window now looks like this: Name Type Start Length Decimals ProdDesc ASCII 16 25 QtyOH NUMERIC 41 9 0 UnCst NUMERIC 50 12 2 ExtCst NUMERIC 62 12 2
Module 5 Creating Applications 273 Worki ng wi th Mul ti pl e-Record-Type Fi l es Saving the Input File Definition You have defined seven fields: two header lines and five detail lines. You are now ready to save the input file definition. To save the input file definition: 1. Close the Input File Definition window. ACL saves the input file as Report. Viewing Only Detail Records To use a filter to display only Detail records: 1. Click in the View window to make it active. 2. Enter Detail in the Edit View Filter text box in the view. 3. Click (Set Filter). All records except Detail records are hidden or highlighted, depending on whether the Hide Filtered Records option is selected in ACL Prefer- ences. 274 ACL for Windows 7 Workbook Worki ng wi th Mul ti pl e-Record-Type Fi l es You can now use any ACL command along with the Detail filter to process the data in the detail. Applying an Automatic Filter You can also use the Default Filter option to process all records in a file, each time you open it. To automatically format the default view each time you open it: 1. Click (Edit File Definition) select Edit from the menu bar and choose Input File Definition. 2. Double-click Detail in the list of defined fields and expressions. 3. Check the Default Filter check box to make Detail the default filter. ACL automati- cally activates this filter each time you open the default view, when you turn on this option. 4. Click (Accept Entry) to accept the entry and return to the Input File Definition window. The next time you open the Report input file, the Detail filter will be active. Processing Multiple Record Types with Static Conditional Fields When a field relates to a number of subsequent records, you can create a static condi- tional field to change the way the data is processed. In ACL, it is common to use static conditional fields when working with multiple-record-type files. Conditional Fields A conditional field is a field whose value is available only when a certain test is met. Any conditional field can be static. When an If test for a conditional field is true, ACL reads uses the data from the file to create a value. If the test returns false, the field has no value, and ACL supplies an empty value (blanks for character fields and zeros for numeric fields). Defining Static Conditional Fields A static conditional field is like a conditional field, except that, when an If test returns false, rather than resetting the value to zero, ACL uses the last valid value in the field until a new valid value is encountered. Use the following criteria to determine when to make a conditional field static: Make a conditional field static if the field relates to a number of subsequent records, such as header records in a report file.
Module 5 Creating Applications 275 Worki ng wi th Mul ti pl e-Record-Type Fi l es Do not make a conditional field static if is does not relate to subsequent records. Then, when an If test returns false, the field is filled with blanks or zeros, as appropriate. To create a static conditional field: 1. Click (Edit File Definition) on the button bar, or select Edit from the menu bar and choose Input File Definition. 2. Click the [Edit Fields/Expressions] tab. ACL displays the input file definition window showing the fields/expressions list. 3. Double-click a field name to display the data definition for that field. 4. To make the field conditional, enter a condition in the If text box, or click [If] and use the expression builder. 5. To make this conditional field static, check the Static check box. After you have defined a filter, you can apply it by selecting it in the field/filters drop- down list in the input file definition window. Select a filter that you want to apply to the fields you subsequently define. For more information about static conditional fields see Static Conditional Fields on page 155 of the ACL for Windows User Guide and online Help. Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit. Note: Instead of making individual fields conditional and static one at a time, you can create and apply a filter in the input fie definition window to have ACL automatically make all fields conditional, based on that filter. 276 ACL for Windows 7 Workbook Processi ng Mul ti pl e-Record-Type Fi l es Lesson 5.5 Processing Multiple-Record-Type Files The data file in this lesson contains three record typesHeader, Detail, and Trailer. While each record has its own fields, two of the fields are common to all of these record types. In this lesson, you define fields in each record type, and then create a batch to simulta- neously process more than one record type in the multiple-record-type file. Different commands are required for different header and detail records types. To process data from more than one record type, you use the Group command. Group lets you provide one set of processes for header records and a different set of processes for detail records. You can use Group to include as many record types as you require. Opening Your Project To prepare for this lesson: 1. Open the Workbook.acl Project. For details on how to open an ACL Project and an input file definition, see Lesson 2.4: Overview Window on page 57. 2. In the Overview window, select Input File Definitions and then click (New). ACL displays the Welcome screen of the Data Definition Wizard. 3. Advance to the Select Data Source screen and choose Disk. Click [Next] to open the Select File to Define dialog box. 4. Select the drive and subdirectory that contains the Workbook Data Files, and then click Invoice.fil. 5. Advance through the Wizard until you reach the File Properties screen. 6. On the File Properties screen, choose Skip to Finish and click [Next] to dismiss the Wizard. In this lesson you use the Input File Definition window. Click [Finish].
Module 5 Creating Applications 277 Processi ng Mul ti pl e-Record-Type Fi l es 7. Click [OK] to save the input file as Invoice. The Input File Definition window opens displaying the Invoice.fil data file. The Invoice file contains the details from invoices for products sold. Notice that the Invoice file contains three different record types. The letter in position 7 indicates the type of record: H is a header record, D is a detail record, and T is a trailer record. The pattern of a header record, followed by one or more detail records and a trailer record, continues throughout the file, as follows: Header record Detail records Trailer record Header record Detail records Trailer record (and so on) 278 ACL for Windows 7 Workbook Processi ng Mul ti pl e-Record-Type Fi l es Creating an Input File Definition Usually, you use the record layout for the data file to determine each of the record types in the file, and the fields contained in each record type. For this lesson, however, the information is provided for you in the following table: In the first exercise of this lesson, you define the common fields, including the invoice number. In the next three exercises, you create filters for each of the three record types. Finally, you define data fields for each of the three record types. Defining the Common Fields The Invoice Number and Record Type fields are common to all record types in the data file. The other fields are different for each record type. All records are the same length. Header Records Record Type H Detail Records Record Type D Trailer Records Record Type T Invoice Number Record Type Customer Number Purchase Order Number Order Date Shipping Date Invoice Date Invoice Number Record Type Product Number Unit Price Quantity Ordered Quantity Shipped Total Extended Price Invoice Number Record Type Invoice Due Date Total Amount of the Invoice Before Taxes Sales Tax Payable Total invoice Amount Invoice Date Located at the top of an invoice. Each detail record represents one line in the body of an invoice and one product sold. Located at the bottom of an invoice.
Module 5 Creating Applications 279 Processi ng Mul ti pl e-Record-Type Fi l es To define the invoice number field: 1. Click (Add a New Data Field) on the [Edit Fields/Expressions] tab. The top half of the Input File Definition window displays the field definition options. 2. In the Start text box, enter 1 to specify the byte location in which the field starts. 3. In the Len. text box, enter 6 to set the length of the field. 4. Check that ASCII is the field type in the Type drop-down list. 5. In the Name text box, enter InvNo. 280 ACL for Windows 7 Workbook Processi ng Mul ti pl e-Record-Type Fi l es 6. Click (Accept Entry) to add the InvNo field. The screen changes, displaying the Invno field at the top of a list view. Defining the Header Fields You need to define the header data filter, and then you define the fields for the header records. You use group logic in a batch to determine whether to refer to fields in specific records. To define the header data filter: 1. Click the [Add a New Data Filter] tab. Notice that all records are highlighted.
Module 5 Creating Applications 281 Processi ng Mul ti pl e-Record-Type Fi l es 2. Click H at position 7 in the first record. 3. Click [Include]. 4. Click (Accept Entry). A dialog box appears asking you to save the filter. 5. Enter Header and click [OK]. A dialog box appears asking if you want to keep the filter active. 6. Click [Yes], as you are now going to define the fields with the filter. The filter drop-down list in the upper right of the window should display Header. In the data, you will notice that the header records are displayed normally, and the rest of the records are highlighted. To define the fields: 1. Click (Add a New Data Field). Notice that the If text box displays Header. 2. In the Start box enter 8. 3. In the Len. box enter 6. 4. Verify that ASCII is the field type in the Type drop-down list. 5. In the Name box enter CustNo. 6. Click (Accept Entry). 282 ACL for Windows 7 Workbook Processi ng Mul ti pl e-Record-Type Fi l es 7. ACL asks you if the information from this record type relates to subsequent records. Click [No]. ACL only asks you this the first time you define a field in a data filter. For the next four header fields you enter, you will not see this dialog box. 8. Following steps 1-6, define the remaining Header fields as described in the following table: You have now defined the customer number, purchase order number, order date, shipping date, and invoice date in the Header records. Defining the Detail Fields You need to define the detail data filter in order to then define the fields for the detail records. To define the detail data filter: 1. Click the [Add a New Data Filter] tab. 2. Click D at position 7 in the second record. 3. Click [Include]. 4. Click (Accept Entry). A dialog box appears asking you to save the filter. 5. Enter Detail and click [OK]. A dialog box appears, asking if you want to keep the filter active. 6. Click [Yes]. The filter drop-down list in the upper right of the window should display Detail. In the data, you will notice that the detail records are displayed normally, and the rest of the records are highlighted. Now you define five Detail fields unique to this record type. One of the fields is ASCII, and the other four are numeric data types. The fields are product number, unit price, quantity ordered, quantity shipped, and total extended price. Name Type Format Start Length PO ASCII 14 9 OrdD DATE YYMMDD 23 6 ShipD DATE YYMMDD 29 6 InvD DATE YYMMDD 35 6
Module 5 Creating Applications 283 Processi ng Mul ti pl e-Record-Type Fi l es To define the Detail fields: 1. Click (Add a New Data Field). The If text box shows Detail. 2. Add the following to the formatting text boxes: 3. Click (Accept Entry). 4. ACL asks you if the information from this record type relates to subsequent records. Click [No]. 5. Define the remaining fields as described in the following table: You have now defined all the fields for the Detail records. Defining the Trailer Fields You need to define the trailer data filter before defining the fields for the trailer records. To define the trailer data filter: 1. Click the [Add a New Data Filter] tab. 2. Click T at position 7 in the fourth record. 3. Click [Include]. 4. Click (Accept Entry). A dialog box appears asking you to save the filter. 5. Enter Trailer and click [OK]. A dialog box appears, asking if you want to keep the filter active. 6. Click [Yes]. Name Type Start Length ProdNo ASCII 8 9 Name Type Start Length Decimals Price NUMERIC 17 7 3 OrdQty NUMERIC 24 4 0 ShipQty NUMERIC 28 4 0 Total NUMERIC 32 9 2 284 ACL for Windows 7 Workbook Processi ng Mul ti pl e-Record-Type Fi l es To define Trailer fields: 1. Click (Add a New Data Field). The If text box shows Trailer. 2. Add the following to the formatting text boxes: 3. Click (Accept Entry). 4. ACL asks you if the information from this record type relates to subsequent records. Click [No]. 5. Define the remaining fields as described in the following table: Saving the Input File Definition You have now defined all the fields for all the record types in the data file. The next step is to save the input file definition. To save the input file definition, close the Input File Definition window. The input file definition is saved as Invoice. You can see that the field names are also the column headings. The columns are arranged according to the position of the fields in the input file. There is a mixture of data in some of the fields because you are displaying data from various record types in the view. Data from different record types appears together because ACL treats different record types as overlapping fields. In fact, much of the data in the view is incorrect. If you were to start processing this input file without specifying the record types you want to work with, the results would be wrong. When you work with multiple-record-type files, you must always specify which record type you want ACL to process. Name Type Date Format Start Length DueD DATE YYMMDD 8 6 Name Type Start Length Decimals TotGoods NUMERIC 14 9 2 Taxes NUMERIC 23 9 2 InvTot NUMERIC 32 9 2
Module 5 Creating Applications 285 Processi ng Mul ti pl e-Record-Type Fi l es Creating a Batch to Process the Three Record Types To ensure that the total value of goods in the Detail lines of the invoice agrees with the total of the invoice before taxes, you need to check the totaling (or footing) of the invoices. The following batch processes all three record types together. It also lists the exceptions, including the invoice number and the customer number, for reference. To create the group, you must first define required variables and establish their initial values using the Assign command. The MCUST variable stores the customer number. The MTOT variable totals the detail lines and carries the total forward for comparison to the total in the Trailer record. It is important to assign the desired number of decimal places to numeric variables to prevent rounding. In this example, if you designated MTOT with no decimal places, every record would meet the condition IF MTOT<>TOTGOODS, since MTOT would be rounded and TOTGOODS would have two decimal places. ACL reads each record, first testing to see if it is a Header record. If it is, ACL stores the customer number in the MCUST variable. It also resets MTOT, the invoice total counter, to zero. Each Header record implies a new invoice to total. If the record is a Detail type, the total of the record is accumulated in the MTOT variable. ACL adds the total of each consecutive Detail record to the MTOT variable until it encounters a Trailer record. If a record is a Trailer record, ACL compares the total in the MTOT variable with the TOTGOODS field in the Trailer record as part of the LIST command. If the two amounts are different, ACL lists them, along with the customer number from the MCUST variable and the other specified fields. The entire process begins again with the next record. Summary of Batch Processing This batch accomplishes the following: For each invoice, ACL stores and carries forward the customer number from the header record. ACL sums the total of the TOTAL detail lines for the invoice. ACL compares the resulting amount to the total in the TOTGOODS trailer record, and reports any differences. To create a group to process the Header, Detail, and Trailer records in the Invoice file: 1. In the Overview window, click Batches. 2. Click (Open) to open an Untitled batch window. 3. Using any of the methods that you prefer, create the following batch. 286 ACL for Windows 7 Workbook Processi ng Mul ti pl e-Record-Type Fi l es 4. Close the Batch window. ACL prompts you to save the changes. 5. Enter Multirec to name the batch. 6. Click [OK] to save the batch and close the dialog box. Running the New Batch To run the batch to process the different record types: 1. In the Overview window, Click beside Batches to display the list of batches. 2. Double-click Mulitrec, and click [Run] to run the batch. The batch runs, and ACL displays the results. If ACL displays a dialog box that reports an error in the batch, you can edit it. Double-click the batch name in the Overview window, and click [Edit] on the dialog box. Correct the error, and then close and save the batch. Try running the batch again.
Module 5 Creating Applications 287 Processi ng Mul ti pl e-Record-Type Fi l es 3. The command log should now look like this: Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit. 288 ACL for Windows 7 Workbook Processi ng Mul ti pl e-Record-Type Fi l es 289 Module 6 COMMUNICATING RESULTS In Module 6, you will find out how to format reports and graph command results. You will learn how to: Use the View window to create a report Preview a report Save the formatted view Display a Histogram Create graphs of Histogram, Stratify, Classify, and Age command results Use the Notify command to generate e-mail from within a batch to notify you, or others, of the results of the batch 290 ACL for Windows 7 Workbook Formatti ng Reports Lesson 6.1 Formatting Reports The presentation of your analysis is important. You can use the ACL formatting features to make your reports easier to understand and review. You can produce reports in print or, for use on World Wide Web pages, HTML (HyperText Markup Language) format. All ACL reports are based on views. To format a view, you use a mixture of commands, formatting options, and occasionally, functions. Some formatting features apply only to a specific view; others can be set globally for all views and reports. You can define as many different views as you want. Each of these can be used as the basis for a different report. Not all ACL commands generate output that can be formatted or is subject to global formatting. Commands that generate output that can be formatted include Report, Summarize, Histogram, Sample, Classify, and Stratify. Opening Your Project To prepare for this lesson: 1. Open the Workbook.acl Project. For details on how to open an ACL Project and an input file definition, see Lesson 2.4: Overview Window on page 57. 2. From the Overview window, drag and drop Ap_trans onto (Open) to open the default view of the Ap_trans input file that is linked to the data file Ap_trans.fil. Using the View to Create a Report The Report command layout options include header, footer, line spacing, font size, presorting on key fields, and creating a summary report. You can also limit the data included in the report by setting local filters. Formatting the View When you format fields in the view to create a report, you can change number formats, column widths and column titles. You can also specify whether ACL should total amounts for numeric fields. You can save the formatted view with a name that indicates that this is a report view. The formatting you do affects only that view in the input file definition. Note: When you use the Modify Column dialog box to format the column title, column width, numeric format, and totals suppression, you only change the format in that particular view. Other views of the same input file definition remain unchanged.
Module 6 Communicating Results 291 Formatti ng Reports Page Width Indicator The Page Width indicator displays, by default, a dotted line on the right side of the view to indicate the page width. To turn off or on the display of the page width indicator: 1. Select Edit from the menu bar and choose Preferences. 2. Click the [View Options] tab. 3. To turn this option off, uncheck the Show Right Edge of Page check box. 4. Click [OK] to accept the change for the current session. . The title font can be changed to a different font from the data font Page width indicator 292 ACL for Windows 7 Workbook Formatti ng Reports When the Show Right Edge of Page check box is checked, you can instantly see what portion of the data in the view ACL will print. ACL does not print data that is outside the width of the page. Page Orientation The Print Setup orientation is set to portrait by default. If you have a wide report, you may want to set the orientation to landscape. You can see how much data is outside the width of the page by looking at the Page Width indicator in the view. To change the Print Setup orientation to landscape: 1. In the View window, click (Report), or select Data from the menu bar and choose Report. ACL displays the Report dialog box. 2. Click [Setup] to display the Page Setup dialog box. 3. In the Orientation area, select the Landscape. Click [OK]. 4. Click [OK] again to close the Report dialog box. The Print dialog box appears. 5. Click [OK] to print the report, or [Cancel] to return to the view in landscape format. The Page Width indicator moves to the right in the view and displays in the appro- priate place for a landscape page width. For more information, see View Options on page 333. Editing Margin Variables Margin values can be set in either inches or centimeters. For example, 100 specifies a margin of one inch. The default setting is 1/2 inch (0.5) on all sides of printed output. The margins are measured from the edge of the print area, which is typically 1/4 to 1/3 inch from the edge of the paper. If you prefer to display measurements in metric, you can change the system setting by choosing Regional Settings in your Windows Control Panel. To change the margins of all printed output: 1. Select Edit from the menu bar and choose Preferences. 2. Click the [Print Options] tab.
Module 6 Communicating Results 293 Formatti ng Reports To change the margins for your report, enter a number in any of the Left, Top, Right, and Bottom Margin text boxes. See Lesson 5.2: Using Batches on page 237, for details about creating and running batches. Headers and Footers ACL automatically prints the date, time, and Global Page Title that you specify in Prefer- ences at the top of your report. To customize the headers and footers for your reports: 1. In the View window, click (Report) or select Data from the menu bar and choose Report to display the Report dialog box. 2. In the Header text box, enter ABC Company. ACL automatically centers this infor- mation at the top of each report page. Headers and footers can be as long as you require, and can contain multiple lines. Use the Header and Footer scroll bars to move up or down, in order to see each line of a header or footer of more than five lines. If you do not specify a header, ACL prints the information specified in the Global Title Page box in Preferences. 3. In the Footer text box, enter Accounts Payable Transactions. ACL automati- cally centers this information at the bottom of each report page. You can highlight and change the Report header or footer information in the text boxes at any time you want. Note: If you consistently use margin settings that are different from the defaults, you can create a batch that sets the margins for you by assigning the desired values to the variables: Left Margin, Top Margin, Right Margin, and Bottom Margin. You can then execute the batch when you first open an ACL Project. Note: All ACL command dialog boxes have an Output options tab. One of the options allows you to add headers and footers. If you click the Output tab in the Report dialog box, you see the optional Header and Footer text boxes. These text boxes are linked to the Header and Footer text boxes found in the Main Report options. If you enter a header or footer in one location, ACL automatically changes the header or footer in the other locations. 294 ACL for Windows 7 Workbook Formatti ng Reports Previewing the Report ACL lets you preview your report before you print it. 1. In the View window, click (Report) or select Data from the menu bar and choose Report to display the Report dialog box. 2. Click [Preview] to show the preview of your report, including what the header and footer will look like when printed. To change the display of the report preview, do the following Click [Zoom In], or pause your cursor over the preview page of your report (your cursor changes to a magnifying glass with a plus sign inside) and click the area of the page you want to enlarge. The [Zoom In] button changes to [Zoom Out]. Pause your cursor over the maximized preview section of your report. ACL changes your cursor to a magnifying glass with a minus sign inside. Click the preview, or [Zoom Out] to minimize your report to one page on the screen. The [Zoom Out] button changes to [ZoomIn]. Click [Next], [Previous], and [Last page] to jump to the following, previous, or last page of your report, respectively. If you are not happy with the way your report looks, you can reformat it by returning to the Report dialog box. Note: If the Preview button is grayed out, it is probably because a default printer has not been set up on your system.
Module 6 Communicating Results 295 Formatti ng Reports 3. Click [Close] when you are ready to return to the view. Printing the Report If you are happy with the way your report looks, you can print the report. To make sure you are connected to the printer, and that the print options are set correctly, you can click the Setup button in the Report dialog box. The Page Setup options you set are saved with the report. The Page Setup options for setting up your printer are identical to those for any Windows application. 1. Click [OK] to return to the Report dialog box. 2. In the Report dialog box, click [OK]. ACL displays the Print dialog box. 3. Specify all pages, or a page range, and click [Print] to print your report. Saving the Report in HTML Format You can save a report in HTML (HyperText Markup Language) format for use in World Wide Web pages. All Web browsers can read files in HTML format. This allows you to prepare your ACL reports to be distributed or published on the Web. ACL generates HTML files in HTML 3.2 format. To produce a report in HTML format, do the following: 1. In the Report dialog box, click the [Output] tab to display output options. 2. Click File to specify output to a file. 3. Click the File Type drop-down list, and select HTML Text File as your output. 4. In the Name text box, enter ABC Report to name the HTML output file. 5. Click [OK] to create the HTML file. Using Do Report to Generate Reports from a Batch You can also issue a Do Report command in command mode to generate a report. For more information, see Do Report on page 172 of the ACL for Windows Reference Manual and online Help. Line Spacing Reports are single spaced by default. Note: Since most ACL report output is in table format, a Web browser that supports tables, such as Netscape 3 or higher, Internet Explorer 3 or higher, etc., is required to view the output. 296 ACL for Windows 7 Workbook Formatti ng Reports To change the report spacing, in the Report dialog box, select Double Spaced or Triple Spaced from the drop-down list. The View window does not reflect the line space setting. You can only see the spacing when you preview or print the report. Key Fields If you want the report to be sorted, it is a good idea to check the Presort check box in the Report dialog box, even when the fields in the view appear to be sorted. To specify key fields in order to be able to perform a presort: 1. In the View window, double-click the Vendor Number column heading. The Modify Column dialog box appears. 2. Check the Sort Key Column check box in order to designate the Vendor Number as a key field. 3. Select Sort Ascending. 4. Click [OK] to close the Modify Column dialog box. 5. Double-click the Invoice Amount column heading. The Modify Column dialog box appears. 6. Check the Sort Key Column check box in order to designate the Invoice Amount as a key field. 7. Select Sort Descending. 8. Click [OK] to close the Modify Column dialog box.
Module 6 Communicating Results 297 Formatti ng Reports For more information, see Using the Sort Command on page 130. Break Column When you define a sort key field, you have the option of also formatting that field as a break column. By defining a break column, ACL prints a subtotal line for all numeric columns on the report each time there is a change in the contents of the break column. For example, if your location field is a break column, each time your location changes, ACL subtotals all numeric columns for that location. To format the Vendor Number column as a break column so that a subtotal line will print each time the value of the column changes: 1. Double-click the Vendor Number column title to display the Modify Column dialog box. 2. Check the Break Column check box. 3. Click [OK] to close the Modify Column dialog box. You can also designate a break column by doing the following: 1. Move the column that you want to designate as a break column to the far left of your view by clicking the column heading and dragging it to the far left. 2. Drag the key field marker (the bold black line at the far left of the columns in the view) to the right of the column to specify it as a break column. To create a report showing the sorted key fields, as well as the break column: 1. In the View, click (Report). The Report dialog box appears. 2. Check the Presort check box. 3. Click the [Output] tab. 4. Select Print. 5. Click [OK] and then click Print. Your report will now print. You will notice that your report is sorted by the Vendor Number in ascending order. The Invoice Amount has been sorted in descending order. Once all invoices for a single vendor have been listed, ACL prints a subtotal for that vendor. This is because you desig- nated the Vendor Number column as a break field. Note: Break columns cannot be numeric or date field type columns. 298 ACL for Windows 7 Workbook Formatti ng Reports Saving the Formatted View You can save formatted views with a new name, so that it is easy to identify the view used to produce a report. 1. Close the View window. ACL asks you to save the changes to the view. 2. Enter a new name, such as Sorted_Report, and click [OK]. Creating a View Normally, you create reports based on an existing view you formatted and saved under a new name. However, you can base a report on a completely new view. To create a new view, either: In the Overview window, click Views and then click (New); or Select Window from the menu bar and choose Open View. In the Select View dialog box, click [New]. ACL displays the Add Columns dialog box. You can double-click fields in the Available Fields list view to select and move them to the Selected Fields list box, or click [Add All] to add columns to the view. Fields appear in the view in the order that you select them. Setting Page Breaks You can have ACL create a page break each time a break column changes value. Page 1 Produced with ACL by: ACL Services Ltd
Module 6 Communicating Results 299 Formatti ng Reports To print a subtotal for the break column, and then print details for the next value on a new page: 1. Open the Sorted_Report view of the Ap_trans input file. 2. Double-click the Vendor Number column title to display the Modify Column dialog box. 3. Check the Page Break check box to turn on the option. 4. Click [OK] to close the Modify Column dialog box. 5. Click (Report). The Report dialog box appears. 6. Click [OK]. Your report will print with each vendor number on a separate page. The numeric fields for each vendor number will also be subtotaled and printed. Suppressing Totals By default, ACL prints totals for all numeric fields on reports. To suppress the total for a numeric column when you print a report: 1. Double-click the Invoice Amount column heading to display the Modify Column dialog box, or click the column title and then click (Modify Column). ACL displays the Modify Column dialog box. 2. Check the Suppress Totals check box to suppress totals for the numeric field. 3. Click [OK]. Summarizing By default, a report includes detail lines, as well as subtotals, for each key field you specify. You can use the Summarize option to produce a summarized report that contains totals and subtotals for each key field, but no detail lines. With Summarize off, the result output to your screen would be similar to the report shown under Break Column on page 296. To use Summarize to prevent the detail lines from being displayed: 1. Double-click the column heading for Vendor Number to display the Modify Column dialog box. 2. Click the Page Break check box to de-select the Page Break option, so that all records appear continuously on the page. 3. Click [OK] to close the Modify Column dialog box. 300 ACL for Windows 7 Workbook Formatti ng Reports 4. Double-click the column heading for Invoice Amount to display the Modify column dialog box. 5. Click the Suppress Totals check box to de-select this option, so that the totals will be displayed. 6. Click [OK] to close the Modify Column dialog box. 7. Click (Report). The Report dialog box appears. 8. Check the Summarize check box. Also ensure that the Presort check box is already checked. 9. Click [OK] to execute the command. Click Print to print the result. You can see that only the Invoice Amount subtotals for each Vendor Number are displayed. The detail lines for every record associated with a given Vendor Number are not shown. Page 1 Produced with ACL by: ACL Services Ltd
Module 6 Communicating Results 301 Formatti ng Reports Using a Filter in a Report As with other ACL commands, you can use the If button in the Report dialog box to specify a condition or local filter for a report. You can also apply a global filter to the view, and then apply a local filter for a specific report. As with all local filters, the condition affects only the contents of the report. It does not affect the view. To use a filter to limit the records printed: 1. Click (Report) to open the Report dialog box. 2. Click the If text box. 3. Enter the expression INVOICE_AMOUNT > 1000.00. 4. Click the Summarize check box to de-select it. 5. Click [OK] to execute the command. Click Print to print the results. Notice that data is only shown for invoice amounts over $1,000.00. Suppress Duplicates You can create more readable presentations of your analysis by choosing not to display duplicates in your reports. You can only suppress duplicates on report break columns. Page 1 Produced with ACL by: ACL Services Ltd
Vendor Invoice Invoice Invoice Product Quantity Unit Number Number Date Amount Number Cost 10025 237936 31/01/2000 56,767.20 080102618 3,379 16 10025 56,767.20 3,379 10134 74841 12/11/2000 18,883.34 030302303 458 41 10134 78025 30/09/2000 1,823.68 010551340 278 6 10134 20,707.02 736 10534 58724783 31/05/2000 4,324.00 030324883 460 9 10534 4,324.00 460 10787 594181 01/12/2000 2,429.64 052204515 306 7 10787 591533 31/05/2000 1,217.16 030321683 828 1 10787 3,646.80 1,134 10879 9515157 30/09/2000 1,440.00 010119040 180 8 10879 1,440.00 180 11247 6572043 15/10/2000 1,847.10 060112356 131 14 11247 6571899 19/01/2000 1,315.68 024140032 48 27 11247 3,162.78 179 Subtotal of break column Detail lines 302 ACL for Windows 7 Workbook Formatti ng Reports For more information, see Specifying Break Columns on page 182 of the ACL for Windows User Guide and Formatting Columns in a View on page 183 of the ACL for Windows User Guide. You can use the Suppress Duplicates feature so that only the first instance of a break field, such as Vendor Number, appears in the report. To see what the report looks like when the Suppress Duplicates check box is unchecked 1. Click (Report) to display the Report dialog box. 2. Delete the filter you specified earlier on the Invoice Amount field. 3. Click [Preview]. Your report looks similar to the following: You can see that the same Vendor Number is repeated with each detail line. 4. Click [Close]. To Suppress Duplicates on Vendor Number field: 1. Double-click on the Vendor Number column heading to display the Modify Column dialog box. 2. Check the Suppress Duplicates check box. 3. Click [OK]. 4. Click (Report) to display the Report dialog box. Page 1 Produced with ACL by: ACL Services Ltd
Module 6 Communicating Results 303 Formatti ng Reports 5. Click [Preview]. Your report now looks similar to this: Notice how much easier it is to read your report when the vendor number is not repeated with each description line. Blank if Zero In a numeric column, you can have ACL display zero values as blank. This option allows you to highlight only the relevant data in numeric fields. For this exercise, close the Ap_Trans input file, and open the Inventory input file from the Overview window. You can see many zeros in the Quantity On Order column of the Inventory input file: Page 1 Produced with ACL by: ACL Services Ltd
Vendor Invoice Invoice Invoice Product Quantity Unit Number Number Date Amount Number Cost 10025 237936 31/01/2000 56,767.20 080102618 3,379 16 232195 14/11/2000 965.77 080938998 323 2 230592 30/09/2000 850.58 010102710 142 5 234056 30/09/2000 486.00 010226620 45 10 239215 30/09/2000 278.04 010155160 28 9 10025 59,347.59 3,917 10101 4516050 31/07/2000 486.64 080935428 11 44 4517604 30/10/2000 154.00 093788411 110 1 4514742 15/10/2000 50.40 010155150 6 8 10101 691.04 127 10134 74841 12/11/2000 18,883.34 030302303 458 41 78025 30/09/2000 1,823.68 010551340 278 6 71073 29/09/2000 883.00 030303343 100 8 70936 14/02/2000 561.20 052484405 115 4 70075 09/04/2000 467.40 090081001 3 155 10134 22,618.62 954 304 ACL for Windows 7 Workbook Formatti ng Reports To have ACL display zero values as blank: 1. Double-click the column title that contains zeros, such as the Quantity On Order column in the Inventory input file. 2. In the Modify Column dialog box, check the Blank if zero check box. 3. Click [OK]. Notice that the records with a zero value now display blank. Suppressing Blank Detail Lines When you do not want ACL to print blank lines in a report, check the Suppress blank detail lines check box. ACL will remove the excess white space. For this exercise, close the Inventory input file, and open the Ar input file from the Overview window. You must first specify your key field and break column and create a multiline view: 1. Double-click the Cust No column heading to display the Modify Column dialog box. 2. Check the Sort Key Column check box to specify Cust No as a key field. 3. Check the Break Column check box to designate Cust No as a break column. 4. Check the Suppress Duplicates check box to select this option. 5. Click [OK]. 6. Create a multiline view, leaving the Cust No field on the first line, and moving all other fields to the second line.
Module 6 Communicating Results 305 Formatti ng Reports This makes the report easier to read. However, because the Suppress Duplicates option is on, ACL does not print the Cust No multiple times. Instead it inserts a blank line where the Cust No should be. For details on how to create a multiline view, see Constructing Multiline Views on page 74. To create the report without blank detail lines showing: 1. Click (Report) to display the Report dialog box. 2. Check the Presort check box. 3. Click [Preview] to see what the report looks like before you turn on Suppress blank detail lines: 4. Click [Close] to return to the view. 5. Click (Report) to display the Report dialog box again. 6. Check the Suppress blank detail lines check box. Page 1 Produced with ACL by: ACL Services Ltd Cust Number Trans Trans Invoice Due Ref Amount Type Date Date No 051593 1,189.11 IN 23/09/2000 22/03/2000 213567 (73.40) CN 22/10/2000 21/11/2000 213912 051593 1,115.71 056016 1,070.92 IN 30/09/2000 30/10/2000 213674 736.74 IN 30/09/2000 29/12/2000 213675 (736.74) PM 03/12/2000 29/12/2000 213675 (1,070.92) PM 03/12/2000 30/10/2000 213674 056016 0.00 065003 874.97 IN 31/08/2000 29/11/2000 213248 1,280.20 IN 02/09/2000 01/12/2000 213277 945.40 IN 02/09/2000 01/12/2000 213296 1,189.11 IN 04/09/2000 03/03/2000 213354 540.19 IN 04/09/2000 03/12/2000 213385 418.27 IN 04/09/2000 03/12/2000 213386 1,189.11 IN 04/09/2000 03/03/2000 213387 306 ACL for Windows 7 Workbook Formatti ng Reports 7. Click [Preview]. Your report now looks similar to this: Notice how much more concise and easy to read your report is when the blank lines are not displayed. Suppress Blank Detail Lines is particularly useful: When there may be blank data lines, such as extra address lines When there are many report fields, and you want to save space by reducing the repetitive output of break fields Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit. Page 1 Produced with ACL by: ACL Services Ltd Cust Number Trans Trans Invoice Due Ref Amount Type Date Date No 051593 1,189.11 IN 23/09/2000 22/03/2000 213567 (73.40) CN 22/10/2000 21/11/2000 213912 051593 1,115.71 056016 1,070.92 IN 30/09/2000 30/10/2000 213674 736.74 IN 30/09/2000 29/12/2000 213675 (736.74) PM 03/12/2000 29/12/2000 213675 (1,070.92) PM 03/12/2000 30/10/2000 213674 056016 0.00
Module 6 Communicating Results 307 Graphi ng Command Resul ts Lesson 6.2 Graphing Command Results You can create graphs from the results of the Histogram, Stratify, Classify, and Age commands. Setting Graph Output ACL displays character-based output for all ACL commands by default, except for the Histogram command. When you execute the Histogram command, the display automatically defaults to graph. To display graphs of the results from the Stratify, Classify, and Age commands, do either of the following: Click the [Output] tab in the command dialog box and select Graph. Double-click the command result in the command log. ACL stores your output setting for the duration of the session. The next time you start ACL, the output option for that command is returned to the default setting. Displaying a Histogram Use the Histogram command to get a graphical overview of a file. Histograms display a vertical bar graph representing the distribution of records over the values of a field or expression. A histogram is the graphical equivalent of categorized data. Profiling the Input File Open the inventory file: 1. In the Overview window, click beside Inventory, in the list of input file definitions, to see all of the views with which this input file is associated. 2. From the Overview window, drag and drop Inventory onto (Open). This opens the default view of the Inventory input file that is linked to the data file Inventory.fil. It is a good idea to execute the Statistics command before running a Histogram or Stratify command. When you run Statistics first, ACL automatically displays a maximum and minimum value for the data in the Histogram and Stratify text boxes. Note: If you open a view located under its associated input file definition, ACL automati- cally opens the associated input file. If you open a view from the list whose corresponding input file is not currently open, ACL warns you that the view may not match the current input file. 308 ACL for Windows 7 Workbook Graphi ng Command Resul ts To execute the Profile command: 1. Select Analyze from the menu bar and choose Profile. ACL displays the Profile fields dialog box. 2. In the Profile Fields list view, click Value. 3. Click [OK]. ACL displays the result in the command log. Graphing Numeric Data Using the Histogram Command To display a graph of Histogram results: 1. Select Analyze from the menu bar and choose Histogram. 2. Select the Value field name from the Histogram On drop-down list. You can generate histograms for character or numeric fields. ACL automatically fills in the Minimum and Maximum text boxes because you have already profiled the data. You can change or accept the values. The Histogram dialog box looks like this:
Module 6 Communicating Results 309 Graphi ng Command Resul ts 3. Click [OK]. By default, ACL draws the result in a 3-D bar graph similar to this: You can see at a glance how the values are distributed in the file. You can easily determine that most of the inventory value is in the first interval. Graphing Character Data Using the Histogram Command You can use the Histogram command on a character field to get a graphic view of the distribution of inventory items by location. 1. Select Analyze from the menu bar and choose Histogram. ACL displays the Histogram dialog box. 2. Select the character field Loc from the Histogram On drop-down list. 3. Click [OK]. ACL clearly shows the distribution of items in each location. Command description Grid lines Graph Type Graph Properties Legend Properties Axis Properties Format Data Label Properties Show/Hide Legend Print Graph Edit Command Copy to Clipboard Rotate Pie Graph Show/Hide Axis Copy to .bmp File 310 ACL for Windows 7 Workbook Graphi ng Command Resul ts Multiple Histograms and Stratifications If you are working with a file that is sorted on a key field or break column, you can generate a separate histogram or stratification for each key value in the file. For example, to produce histograms for each product class, you first sort the file by product class. Then in the Histogram dialog box, click the More tab, and click Break to specify the product class field as a break field. ACL creates a graph for the first product class. To create graphs of subsequent product classes, go to the command log and double-click each product class for which you want a graph. For detailed information on how to use break fields, see Break Column on page 297. Changing the Interval To focus on a particular range of data, you can use free intervals in the Histogram or Stratify command. To display a graph of Histogram results with free intervals: 1. Select Analyze from the menu bar and choose Profile. 2. In the Profile Fields list view, click Value, and then click [OK]. ACL displays the result in the command log. 3. Select Analyze from the menu bar and choose Histogram. 4. Select Value from the Histogram On drop-down list.
Module 6 Communicating Results 311 Graphi ng Command Resul ts ACL automatically fills in minimum and maximum values. You can specify a different number of even intervals, or any number of intervals of any size. 5. Select Free, and in the list box enter: 10 1000 5000 12000 20000 6. Click [OK]. ACL displays the result in a 3-D bar graph like this: When you adjust the intervals of the population with which you are working, you can concentrate on a specific distribution of values. Graphing Stratify, Classify, and Age Results For Stratify, you should first execute the Profile command, so that ACL will provide maximum and minimum values for you. You can follow these instructions in order to graph the Stratify, Classify, or Age command results, but for this example you use the Classify command results. To graph the Classify command results: 1. Select Analyze from the menu bar, and choose Classify to display the command dialog box. Notice that the largest number is in the 1,000.00 to 4,999.99 interval. 312 ACL for Windows 7 Workbook Graphi ng Command Resul ts 2. Select Loc from the Classify On drop-down list. 3. Click the [Output] tab to display the output options. 4. To execute the command, select Graph and click [OK]. ACL displays the results in a graph as follows: Editing Graph Properties ACL provides numerous options to manipulate graphs containing your results. You can change the graph format, labels, and grid display. You must first create the default graph type before you can change its properties. To select the fields to graph: 1. Select Analyze from the menu bar and choose Classify. 2. In the Classify On drop-down list, select Loc. 3. In the Accumulate Fields list view, select the Mktval. Then CTRL+CLICK the QtyOH and Value fields. 4. Click the [Output] tab and select the Graph. 5. Click [OK] to execute the command and display the graph. 6. Click (Format Data) to display the Format Data dialog box. 7. Double-click Count in the Available Fields list view to add it to the Selected Fields list view. The Format Data dialog box now looks like this:
Module 6 Communicating Results 313 Graphi ng Command Resul ts 8. Click [OK] to display the graph. Changing Graph Types You can choose to display graphs in 2-D or 3-D bar, 2-D or 3-D stacked, 2-D or 3-D pie graph, 3-D layered, or line graph formats. Only options that apply to the data in your graph are available. Options that do not apply to the data in your graph are grayed out. 314 ACL for Windows 7 Workbook Graphi ng Command Resul ts To change the graph format of the Histogram example above: 1. In the graph window, click (Graph Type). ACL displays the Graph Type dialog box. 2. For example, try clicking the 3-D layered graph button. 3. Click [OK]. ACL displays the Classify results in a 3-D layered graph. Note: When your results contain a single item, ACL grays out the stacked and 3-D layered options, and enables the 2-D and 3-D pie charts. When your results contain multiple items, these options are available, but the 2-D and 3-D pie charts are not. 2-D pie graph 2-D bar graph 3-D bar graph 3-D pie graph 3-D layered graph 2-D stacked graph 3-D stacked graph Line graph
Module 6 Communicating Results 315 Graphi ng Command Resul ts 4. To change the display again, click (Graph Type). 5. In the Graph Type dialog box, click the line graph button. 6. Click [OK]. ACL displays the same Classify result in a line graph. Changing Graph Properties To change the graph properties: 1. Click (Graph Properties). 2. Click the [Global Font] tab. 316 ACL for Windows 7 Workbook Graphi ng Command Resul ts 3. You can change the font, font style, color and background. In the Options tab you can hide the gridlines, axis, and legend. Changing Legend Properties To change the legend properties: 1. Click (Legend Properties). 2. Click the [Legend Attributes] tab. 3. Using the Legend Attributes, Font, and Data Series tabs, you can change the border style, font, and appearance of the data series. Changing Axis Properties To change the axis properties: 1. Click (Axis Properties). 2. Click the [Axis Scale] tab. .
Module 6 Communicating Results 317 Graphi ng Command Resul ts Using the Axis Style, Axis Scale, and Font tabs, you can change the appearance, scale, orientation and font of the axis. Formatting Data To format the data: 1. Click (Format Data). 2. Click the [Data] tab. 3. Remove Count, Market Value, and Quantity on Hand from the Selected Fields list box. 4. Select the [Options] tab. 5. Change the orientation of the labels to 0. 6. You can choose to change the font of the labels. 7. Select the [Data Series] tab. 8. Select Inventory Value at Cost from the Field drop-down list. 9. Click the color bar next to the Solid option button to open the color palette. Choose a new color for the Inventory Value at Cost field. Click [OK]. 10. Click [OK] again to accept all of the new settings. ACL displays graphs on one page. If there is a large amount of data, it may take a long time to draw the graph on the screen or it may be difficult to read. You can reduce the amount of data in the graph by displaying only some of the fields. Try this using the Histogram command. 318 ACL for Windows 7 Workbook Graphi ng Command Resul ts For more practice, click (Graph Type) to change the graph type to a 3-D pie. Change the graph properties. Changing Graph Labels To change graph labels: 1. Select the label text at the bottom of the Graph window. The Label Properties button is activated. 2. Click (Label Properties). 3. You can change the orientation, font, and border appearance of the label. Graphing Drill Down Graphing drill down works in 2-D and 3-D graphs featuring pie segments, bar charts, or line graphs. By double-clicking the mouse on a particular segment or bar, you cause a new filter to be attached to the existing file view (which is of the graph as a whole). The new filter narrows the view down to only the data supporting that particular segment, and brings the view to the top, leaving the graph in the background. You can view a different segment by clicking it. To return to the top-level view of the graph as a whole, you must edit the filter directly.
Module 6 Communicating Results 319 Graphi ng Command Resul ts Exploding Pie Segments You can explode a pie graph by pulling individual pie segments away from the whole. This can be done by selecting a segment and choosing Explode Pie from the graph pop-up menu or the default pop-up menu. You can also click and drag the segment away from the rest of the pie. Note: You can use the drill-down feature to simultaneously retrieve data from a number of graph items, such as bars or pie chart wedges. You can use CTRL+CLICK to select multiple individual items or SHIFT+CLICK to select a range of adjacent items. On a pie chart, SHIFT+CLICK selects wedges in a clockwise direction. Multiple Drill-Down Selections 320 ACL for Windows 7 Workbook Graphi ng Command Resul ts To explode a pie graph: 1. Right-click a segment of the pie chart to select it. 2. Choose Explode Pie from the pop-up menu. Alternately, you can: 1. Click the segment of the pie you want to separate and hold down the left mouse button. 2. Drag the segment away from the pie. Saving the Graph as a Bitmap You may want to use the graph as a bitmap in another program. To save the graph as a bitmap (.bmp) file: 1. Click (Save Graph as Bitmap). 2. In the Save Graph As dialog box, select the location you want to save it to and name the .bmp file. Copying the Graph to the Clipboard You may want to use a copy of the graph in another application. To copy the graph to the clipboard: 1. Click (Copy Graph to Clipboard). You can then paste the graph into a presen- tation or another program. For example, the previous Classify graph may look like this when you paste it into Microsoft Word for Windows TM :
Module 6 Communicating Results 321 Graphi ng Command Resul ts Using the Command Log to Graph You can use the results in the Command Log to create graphs of existing data or change the command specifications. You can tell which ACL command results can output to a graph by the line <<<Graphable Data>>>, which ACL displays under the command line. To redraw a graph, do one of the following: In the command log, double-click the result of a graphable command. ACL immediately redraws the default graph for that command. Click the command line (the line beginning with @). ACL displays the command in the command text box. You can either modify the command in the text box, and then click to accept it; or click to display the command dialog box in which you can modify the command. Graphing a View ACL lets you graph certain kinds of data directly from the view: A single character or date column with one or more numeric columns Multiple numeric columns graphed against their record number This feature lets you quickly view your data without having to process it using an ACL command. 322 ACL for Windows 7 Workbook Graphi ng Command Resul ts To graph data from a view: 1. Click and drag the mouse to select a valid data range from the view. 2. Then, click [Graph Selected Data]. When the graph appears, you can modify the graph type, appearance and properties using the buttons on the left side of the graph. All valid graphing options are displayed with color buttons. Invalid options are grayed out. Because a view-based graph is not based on data from ACL commands, it does not have as many features as a graph produced from data output. Character or date data is not sorted and appears in the same order as it does in the view. Graph drill-down is not available when graphing from a view. When you need greater control over graphs, create them from your data output instead. Exiting ACL If you want to exit ACL now, select File from the menu bar and choose Exit.
Module 6 Communicating Results 323 The Noti fy Command Lesson 6.3 The Notify Command E-mail can be generated within batch jobs to alert a user of results. The e-mail can include text, generated strings based on expressions, or attachments of analysis results.The Notify command appears on the File menu. Choosing it causes the Notify dialog box to appear. Using the Notify Command As Notify is primarily intended to be used in a batch, mastering the command syntax is very important. Notify supports cc, bcc, and attachments. The password in the command line is an encrypted sequence of up to 64 characters. 324 ACL for Windows 7 Workbook The Noti fy Command The dialog box allows input for six different fields, but depending on your system, only four or five of these are required: Sender (required) Password (required for some systems) Mailbox path (required) To (required) Subject Text (required) This is an example of a Notify message sent to an external e-mail address. It includes an attachment and is password-protected. NOTIFY USER "[email protected]" PASSWORD "8456B52AD40CC450D53DAAD521FD624F1D2CBCB089B9AB73753B7B69475 E5F23" MAILBOX "smtp.internet.com" ADDRESS "[email protected]" SUBJECT "Exceptions were found in Clients data." MESSAGE " The Test batches were run on the clients system. Exceptions were found." ATTACHMENT "C:\sample data\gltrialbal.fil" There can be more than one recipient in the To: field, depending on the system. Lotus cc:Mail and Microsoft Exchange support multiple recipients, separated by commas. SMTP does not.
Module 6 Communicating Results 325 The Noti fy Command The subject field defaults to Notify if you leave it blank. It is normally preferable to specify a subject. Although the password you enter here is encrypted in the dialog box and in any batch jobs, the Notify command should be used with caution. It is possible to copy and paste the encrypted password from the batch job it appears in, using it in another batch job to send unauthorized mail. For this reason, ACL strongly advises that any mail sent from within a batch job be sent from a separate account, perhaps entitled ACL, so that imper- sonation is impossible, and unauthorized use is made less attractive. Accessing Notify Using the Command Log and Batch Files You can create a Notify command in the command log, as a single command of the form: NOTIFY USER username <PASSWORD xxxx> MAILBOX pathname ADDRESS recipient MESSAGE message If your command does not include the required items above, an error message appears noting the first missing item. The dialog box then appears, prompting you for the missing information. You can also include Notify in batch files. It executes just as it would from the Command Log, as it is a standard batch command. Note: Notify is not intended for use as a full-scale mail system. It is a send-only utility with a very limited range of adaptation, and may not be able to deal with some mail formats. It is advisable to test the precise message syntax and attachment types you will be using in the command log beforehand to verify that messages will arrive intact. Also, be aware that system responses concerning nondelivery of your messages may not reach you consistently. Note: Some of the failure modes for Notify, such as an invalid password or address, cause an unattended batch to pause. 326 ACL for Windows 7 Workbook The Noti fy Command 327 Module 7 CUSTOMIZING ACL In Module 7, you will find out how to customize ACL. You will learn how to: Select options and then turn them on and off Restore factory default preferences Set Interface, Input File, View, Command, Date, Numeric, Print, and Application Font options 7 328 ACL for Windows 7 Workbook Setti ng Preferences Lesson 7.1 Setting Preferences ACL offers a variety of customization options. In this lesson, you learn how to set up ACL to match your skills, level of experience, and personal preferences. Some preferences affect the options and commands available in the ACL menus, the display of information on your screen, or the appearance of the ACL application screen. Other preferences control the display of dates and how documentation prints. For example, if you turn off the Show Button Bar preference, ACL does not display the button bar at the top of the application screen. Selecting Options To display the Edit ACL Preferences dialog box: 1. Select Edit from the menu bar and choose Preferences. The first time you open the Preferences dialog box, ACL displays the [Interface Options] tab. 2. You can click any of the following eight tabs to display the associated preference settings: Interface Options Input File Options View Options Command Options Date Options Preference file name
Module 7 Customizing ACL 329 Setti ng Preferences Numeric Options Print Options Application Font Options Turning Options On and Off To turn options on or off, click the check box beside the preference name. Some options require that you enter a setting or select an option from a drop-down list. An (empty check box) indicates the option is off. A (checked check box) indicates the option is on. ACL stores your preferences in a file. You can see the file name at the bottom of the Preferences dialog box. When you have finished selecting options, click one of the following: [OK] to set the preference settings for the duration of the current session only [Cancel] to cancel any changes made to preference settings [Save] to save all of your current preferences to use in future ACL sessions [Factory] to set all preferences to the default settings For more information, you can click [Help] to display online Help. To use command mode to set preferences, see Set on page 309 of the ACL for Windows Reference Manual. Restoring ACL Factory Default Preferences You can restore the settings to the factory defaults at any time. To reset the ACL Preferences to the factory defaults: 1. Select Edit from the menu bar and choose Preferences. 2. Click [Factory]. ACL asks if you want to set all preferences to their default settings. 3. Click [Yes]. The sections that follow describe each of the preference options. Factory default prefer- ences are preselected with a . Note: When you click Factory, ACL does not reset the button bar to its default configu- ration. 330 ACL for Windows 7 Workbook Setti ng Preferences Interface Options Click the [Interface Options] tab to display the options. Show Button Bar This option displays the button bar at the top of the application screen. If you turn this option off, ACL does not display the button bar on your application screen. Show Tooltips This option displays yellow, pop-up notes that describe the function of buttons. The notes appear when you position the cursor over any of the buttons on the ACL button bars. If you turn this option off, the tooltips are not displayed. Include Filters in Field Lists Filters are normally excluded from field lists. Select this option when you want to include filters in field lists. Because filters are actually implemented as logical fields, you can use this option to have filters appear in field lists, so that you can apply commands to them. Warn Before Overwriting Files This option displays a warning before ACL overwrites an existing file. If you turn this option off, ACL overwrites files without prompting you for approval. Note: This preference was formerly called Include Logicals in Field Lists. Note: This preference was formerly called Set Safety On.
Module 7 Customizing ACL 331 Setti ng Preferences This option can also be set in batch mode. By turning this option off, you can avoid interruptions while executing a batch that is designed to overwrite existing files. Command Mode Syntax SET SAFETY ON|OFF Beep(s) Upon Task Completion This option indicates the number of beeps that sound when ACL completes a task. This notification is especially useful when you expect a task to take a long time. To change the number, enter a number from 0 to 255 in the text box (the default is 0). Input File Options Click the [Input File Options] tab to display the options. Automatically Profile on Open If you turn this option on and you open an ACL Project or change a filter, ACL automat- ically executes the Profile command on all numeric fields in your data file. ACL retains the information and uses it to provide the minimum and maximum values for histograms and stratifications, as well as for sample populations, if required. This option is turned off by default. Turning it on may slow down ACL when you open a large file. Open View Window This option automatically opens the View window when you select or create an input file. If a default view exists, ACL opens it. Otherwise, ACL opens another available view, 332 ACL for Windows 7 Workbook Setti ng Preferences or creates a default view if no others exist. If you turn this option off, you must open a View window each time you require one. Delete Data File with Input File Definition If you turn this option on, ACL automatically deletes the linked data file when you delete an input file definition. You can use this option to quickly remove unwanted files from your hard disk, but it will prevent you from accessing the data in the future, therefore, selecting this option is not recommended. Dont Share Input File Layouts If you turn this option off, ACL creates a new input file definition when you execute a command that creates an ACL data file as output, such as Sort or Extract. ACL shares the same input file definition whenever possible if this option is turned on. Exact Character Comparisons With this option off by default, ACL compares character fields or expressions that are not of equal length, based on the shortest character field or expression. For example, AB is considered equal to both ABC and ABLMNOP. If you turn this option on, ACL compares character fields or expressions based on their full length. Two strings must be the same length for ACL to deem that they are equal. Display Format on Open If you turn this option on, ACL automatically displays the current input file definition and computed field definitions when you open a new input file. The results appear in the command log. Enable Client/Server If your organization also uses ACL for OS/390 Version 7, you can take advantage of ACLs powerful client/server capabilities. ACL for OS/390 Version 7 can be configured to run as a server, providing direct access to data residing on your OS/390 platform from the ACL for Windows user interface. Note: To prevent accidental deletion of field definitions, the default setting for this option is Dont Share Input File Layouts.
Module 7 Customizing ACL 333 Setti ng Preferences Max RAM (MB) This option specifies the maximum amount of memory you want ACL to use. The default of 4 megabytes (MB) is adequate for most purposes.If you want to sort or classify very large files, you can specify a larger number, from 1 MB to 64 MB. When you change this number, you must save your preferences, exit, and restart ACL for the new setting to take effect. If you specify too small a number, commands such as Sort and Index execute more slowly than usual. You must restart ACL for changes to take effect. In general, you should not exceed 25% of the amount of RAM installed on your system. Buffer Size (k) This option specifies the size of the data block read. The default is 33 kilobytes, the recommended buffer size for most applications, but you can enter a number from 5 to 255. Changing the buffer size may result in slight performance improvements in certain enviroments. Change this setting on the advice of ACL technical support only. The new buffer size takes effect the next time you open a new file. Sort Order This option indicates the sort sequence for character fields. The default is ASCII, which ACL signifies with the System Default option. Character sequences vary, depending on the language used. The Sort Order drop-down list offers a variety of options, including Custom, which allows you to define your own sort order. Characters you enter are sorted in the order they appear. Characters that do not appear in the text box are sorted according to the default ASCII sort sequence. For example, typing AaBbCc... causes uppercase and lowercase letters to sort together before any other characters. Any remaining characters are sorted in the same order that they appear in the Windows Character Map. View Options Click the [View Options] tab to display the options. 334 ACL for Windows 7 Workbook Setti ng Preferences Hide Filtered Records This option is on by default. ACL displays only the records that match the filter condition in effect. If you turn this option off, all records in the current input file are shown. If a filter is active, the records that do not match the filter condition are highlighted. If only a few records meet the filter condition, it is best to turn this setting on. Show Grid Lines This option displays grid lines in views. If you are formatting a view for a report, you may want to turn this preference off. Test Column Widths Even if width of column(s) is the only thing you change in a view, this option prompts you to save or discard your work when you close the View window. If you turn this option off, and the only changes to a view are column-width changes, ACL discards the changes. Show Right Edge of Page ACL displays a dotted line in the View window to indicate the right margin. The margin is based on a standard page width of eight and one-half inches. For more information, see Page Width Indicator on page 291.
Module 7 Customizing ACL 335 Setti ng Preferences Display Invalid Data as Blanks or Zeros When this option is off, ACL accepts all invalid characters in a field. If you turn this option on, ACL replaces invalid character data with blanks, and invalid numeric data with zeros, from the first invalid character to the end of the field. This option affects all fields except text fields: ACL automatically replaces invalid data with blanks in text fields. Redraw Seconds This option displays the maximum amount of time in seconds that ACL takes to redraw the view. If redrawing takes longer than the specified amount of time, ACL interrupts processing and displays a message. The default is 10 seconds. Global Page Title Whatever you enter in this text box displays below the page number at the top of each printed page. By default, ACL uses your company name, but you can enter a different designation or leave it blank. Command Options Click the [Command Options] tab to display its options. Note: Authorized group licensed versions of ACL have customer-specified text in the Global Page Title that cannot be modified. 336 ACL for Windows 7 Workbook Setti ng Preferences Autoexecute Commands This option is turned on by default. ACL immediately executes commands without showing the command dialog box. Rather, ACL uses the default settings to execute the command and display the result. Some commands cannot be autoexecuted. For this feature to work on commands that create output files, the Automatic Output Filenames option must also be turned on. Automatic Output Filenames If you turn this option on, ACL suggests a name for any file a command creates. The name contains the command name and an incremental number starting at 01. You can accept the default name, or enter a more descriptive name. Time Stamp Commands If you turn this option on, ACL records, in the command log, the time and date of each command you issue. Use Output File This option, which is turned on by default, causes ACL to automatically check the Use Output File check box in command dialog boxes that create files. When a command creates an output file, ACL opens the output file so that you can use it right away. If you turn this option off, the Use Output File check box in command dialog boxes are not checked, and ACL writes to the same file after executing the command. You can always check or uncheck the Use Output File check box in any command dialog box. Show Group Tests in Log When a batch has run, this option displays the group results of If, While, For, and Next tests beside the respective commands in the command log. More than one test in a group can apply to each command. If you turn this option off, ACL does not display the group tests when you run a batch. Intervals This option indicates the default number of intervals for a stratification or histogram. Enter a number from 1 to 255. The default is 10. If you change the setting, the new setting becomes the default until you change it or reset it.
Module 7 Customizing ACL 337 Setti ng Preferences Error Limit The Error Limit option specifies the default maximum number of sequence errors that ACL processes using the Sequence or Verify commands. The default is 10. Date Options Click the [Date Options] tab to display its options. Day, Month, Year You can change the D, M, or Y character in the Day, Month, or Year text boxes to characters that match your usual format. ACL globally displays the characters you specify in every alpha date format representation. Date Display Format ACL globally displays the format you specify in every date field. This does not affect the date formats ACL can read, only the way they are displayed. To change the way ACL reads date information, see Date on page 11 of the ACL for Windows Reference Manual. You can Choose an option from the Date Display Format drop-down list to control how ACL displays the date in views, reports, and other output. Start of Century Date Many data files use two digits to represent the year, and the year used to denote the earliest date in the last century may vary from one set of data files to the next. The 338 ACL for Windows 7 Workbook Setti ng Preferences two-digit year that indicates the oldest record in the last century is often called the start of century date or the pivot date. The start of century date applies to two-digit year date fields only, and does not affect data that uses four digits to represent the year. ACL can read four-digit year dates to 9999. The default setting is 40. To change the start of century date, enter a two-digit number from 1 to 99. ACL does not accept a zero value. For example, if you choose to set 1940 as the separating year, enter 40 in the Start of Century text box. ACL then treats years 40 to 99 as 1940 to 1999, and years 00 to 39 as 2000 to 2039. The following table illustrates possible Start of Century dates. When working with data files that use a different pivot date, you can use an expression to create a computed field that correctly interprets the two-digit year, or converts it to a four-digit year. Aging Periods You can change the default periods used for the Age command to match your chosen format. You can always change the age periods in the Age command dialog box. The default is 0, 30, 60, 90, 120, and 10000. Abbreviations for month names This option sets the default abbreviations for MMM format month names. Month names must be three characters long, in the correct order starting with January, and separated by a comma. Use this option when you want to read or display MMM format month names in a language other than English. The months must be entered in the correct order, starting with January. Start of Century Date Years Display as dates 60 60 to 99 00 to 59 1960 to 1999 2000 to 2059 40 40 to 99 00 to 39 1940 to 1999 2000 to 2039 05 05 to 99 00 to 04 1905 to 1999 2000 to 2004
Module 7 Customizing ACL 339 Setti ng Preferences This option affects the way ACL reads dates from an input file. Numeric Options Click the [Numeric Options] tab to display the options. Stop on Numeric Overflow This option terminates processing when a numeric overflow (such as division by zero) occurs. Verify Data The Verify Data preference automatically checks the validity of data. With this option turned off by default, ACL does not test for data validity, which improves processing speed. If you turn Verify Data on, ACL automatically verifies data when you use an input file. You can choose to have ACL stop processing when it encounters invalid data, or replace invalid data with blanks, so that processing continues. 340 ACL for Windows 7 Workbook Setti ng Preferences Blank Invalid Data This option is only available if the Verify Data option is turned on. If you turn Blank Invalid Data on, ACL automatically replaces invalid data with blanks or zeros (as appro- priate) for the entire field that has any invalid data in it. ACL adds an entry to the error log. ACL displays the message: Invalid data encountered in file, values zeroed. See file ERROR.LOG. The error log is stored in the ACL working directory. You can view or print the error log in your text editor or word processor. Expression Field Width This option indicates the default field width for numeric computed fields or ad hoc numeric expressions (for which ACL cannot determine the maximum width). The default is 12 characters, based on the default application font in ACL. Decimal Place Symbol ACL uses a period as the default decimal place character. To change the default setting, enter a new character in the text box. Thousands Separator ACL uses a comma as the default thousands separator. To change the default setting, enter a new character in the text box. List Separator ACL uses a comma as the default list separator, which is used primarily to separate function parameters. To change the default setting, enter a new character in the text box. Default Numeric Format Choose a default numeric format from the drop-down list. Note: When you use $ (dollar characters) in the default numeric format, ACL uses them globally, formatting even ACL generated numeric columns such as Count or Classify with $. It is, therefore, not recommended that you select $ as the numeric format.
Module 7 Customizing ACL 341 Setti ng Preferences Print Options Click the [Print Options] tab to display the options. Print File History with Last Result This option includes the file history as the last page of output when you print the command log with the Last Result option selected. Include Report History with Reports This option includes the report history as the last page of a printed report. Include Field Definitions in File History If you turn this option on, ACL includes a description of the input file definition and computed fields as part of the file history. Include View Note in Report History If you turn this option on, ACL includes the notes associated with the view, as well as the file history, in printed reports. Note: This option was formerly called Print File History with Reports. 342 ACL for Windows 7 Workbook Setti ng Preferences Left, Top, Right, and Bottom Margins The Left Margin, Top Margin, Right Margin, and Bottom Margin text boxes set the margins for all printed output. The values are in 100 ths of an inch. The default value of 50 specifies a half-inch margin. Application Font Options Click the [Application Font Options] tab to display the options. Fixed-Width Font ACL uses fixed-width fonts to display information in the Command Log, Batch, and Workspace windows. You can change the fixed font used in these windows by clicking the Fixed Font drop-down list and selecting one of the fonts. By default, ACL uses the Courier New font to display fixed ASCII text on screen. Proportional Font The default is Arial. Choose from the drop-down list to change the font for data that appears in views, notes, and reports. Language Version The default is Standard. The options in this drop-down list let ACL properly read and display local language characters. To change the option, select one of the options from the Language Version drop-down list. Note: You can also adjust your Windows settings for metric measurements. 343 Module 8 TROUBLESHOOTING DATA ERRORS Module 8 shows you how to identify and use invalid data using ACL. You will learn how to: Recognize invalid data Verify and dump data Handle improper data Handle incomplete and inconsistent data Correct faulty data 344 ACL for Windows 7 Workbook Troubl eshooti ng Data Errors Lesson 8.1 Troubleshooting Data Errors ACL provides different commands, functions, and preferences for identifying and handling data errors. Data Errors Files may contain data errors, such as blanks, missing numbers, or inconsistent data that were not detected when the file was created. What are Data Errors? There are four common types of data errors: Invalid data in the field. This is data that is technically incorrect, such as blanks in a Packed field. Improper data is technically correct but not logically correct for the context. Examples of improper data are incorrectly sorted data when the application requires that it be sorted or duplicate data. Incomplete data is missing information, such as missing invoice numbers in a file. Inconsistent data is data that varies between fields or between files, such as an invoice with no corresponding customer master file. In this lesson, you will use the Badfile input file, as it contains examples of the above data errors. Opening Your Project To prepare for this lesson: 1. Open the Workbook.acl Project. For details on how to open an ACL Project and an input file definition, see Lesson 2.4: Overview Window on page 57. 2. In the Overview window, drag and drop Badfile onto the (Open) button. The default view for the Badfile input file opens.
Module 8 Troubleshooting Data Errors 345 Troubl eshooti ng Data Errors At first glance, you can see that there are data errors. What is Invalid Data? Invalid data is technically incorrect for the field definition. This might include characters in a numeric field, or blank spaces in an ASCII field. You can use the CLEAN( ) function and Display Invalid Data as Blanks or Zeros to remove the invalid data from the file. Verifying Data To check for data validity errors in the input file, use the Verify command. Verify ensures that data in a file conforms to the input file definitions and reports any errors encoun- tered. For example, Verify uses the input file definition description to check that only character data is in character fields. To verify all of the defined data fields: 1. Select Analyze from the menu bar and choose Verify. The Verify dialog box appears. 2. Click [Verify Fields] to display the Selected Fields dialog box. The Available Fields list view displays all defined fields for the Badfile input file. 3. Click [Add All] to copy all the available fields to the Selected Fields list box. Improper data Incomplete data Inconsistent data Invalid data 346 ACL for Windows 7 Workbook Troubl eshooti ng Data Errors 4. Click [OK] to close the Selected Fields dialog box. The Verify dialog box now looks like this: 5. Click [OK] again to execute the command. The verification result appears in the command log. You can see that five validity errors were found. ACL identifies the record numbers and field names. You can use this information to analyze the file errors.
Module 8 Troubleshooting Data Errors 347 Troubl eshooti ng Data Errors CLEAN( ) Function The CLEAN( ) function finds and removes the first invalid character in a string, and replaces it and all characters to the right of it with blanks. The syntax of CLEAN( ) is: CLEAN(string<,extra_invalid_characters>) The optional second parameter, extra_invalid_characters, allows you to specify additional character values that are considered invalid for the purposes of the test. The values for this parameter must be surrounded by matching single or double quotes. For example, if the Name field contains invalid data, you could define a new computed field with the value CLEAN(NAME). Whenever you refer to this new field, the invalid data is removed. For further details on this function, see CLEAN( ) on page 37 of the ACL for Windows Reference Manual. Display Invalid Data as Blanks or Zeros Preference Use the Display Invalid Data as Blanks or Zeros option to correctly display data automatically, without the use of CLEAN( ). This is also useful for some variable length files. When this option is turned on, ACL replaces invalid character data with blanks and invalid numeric data with zeros, from the first invalid character to the end of the field. This option affects all fields except text fields: ACL automatically replaces invalid data with blanks in text fields. When this option is turned off (as it is by default), ACL accepts invalid characters The Display Invalid Data as Blanks option is most useful with variable length data files, because it allows ACL to display them correctly. For example, if you have a variable length file in which the last field is a description that is 0 to 40 bytes long (terminated by a CR, LF, or CRLF), you can use this option to remove any irrelevant information when the actual length is less than 40. 348 ACL for Windows 7 Workbook Troubl eshooti ng Data Errors You can see in the command log that records 17 and 18 in Badfile contain invalid data. To turn on the Display Invalid Data as Blanks or Zeros option to remove the invalid characters from the input file: 1. Select Edit from menu bar and choose Preferences. 2. Click the [View Options] tab. 3. Check the Display Invalid Data as Blanks check box to turn on this option. 4. Click [OK] to close the Preferences dialog box. You can see that records 17 and 18 now display the valid data. Note: Although the characters and may appear to most users as invalid data, they are recognizable ASCII characters, and are therefore valid in ACL. Invalid data
Module 8 Troubleshooting Data Errors 349 Troubl eshooti ng Data Errors The invalid data, and all data after that, is displayed as blanks (If the Product Number field was a numeric field instead of a character field, the invalid data would be displayed as zeros). What is Improper Data? Improper data is data that is technically valid, but not correct for the context. For example, blanks or letters in a part number field that is defined as an ASCII field type. Negative amounts in a numeric field that should contain only positive amounts are also considered improper. In Badfile, both InvoiceNo and ProdNo are defined as character fields, but should contain only numbers. If the data was not entered correctly when the file was created, these fields might include characters other than numbers or blanks. Handling Improper Data Now that you have determined that there is improper data, you can use some ACL functions to fix the data. INCLUDE( ) Function The INCLUDE( ) function allows you to include only the data you want in a character field. The syntax of INCLUDE( ) is: INCLUDE(string,characters_to_include) The INCLUDE( ) function includes all proper data. It includes all data that conforms to the characters_to_include string, and shifts all valid characters to the left side of the field. INCLUDE( ) fills the rest of the field with blanks. Remember when working with non-numeric fields that ACL is case sensitive. For further details on this function, seeINCLUDE( ) on page 51 of the ACL for Windows Reference Manual. EXCLUDE( ) Function With the EXCLUDE( ) function, you can exclude specific characters from a character field. EXCLUDE ( ) removes specified characters and replaces them with blanks, maintaining the original record length. EXCLUDE( ) is the opposite of the INCLUDE( ) function. The syntax of EXCLUDE( ) is: EXCLUDE(string,characters_to_exclude) For further details on this function, seeEXCLUDE( ) on page 44 of the ACL for Windows Reference Manual and online Help. 350 ACL for Windows 7 Workbook Troubl eshooti ng Data Errors To use the Count command to test for the presence of valid, but inappropriate, ASCII characters in the Product Number field: 1. With the Badfile input file definition open, select Analyze from the menu bar and choose Count. 2. Click the If text box and enter the expression EXCLUDE( CLEAN( Prodno), "0123456789") <> " ". 3. Click [OK]. The command log tells you that one of the records met the test. In other words, one record contains improper ASCII characters in the Product Number field. What is Incomplete Data? Incomplete data contains gaps or is missing some type of information. You can use the Gaps command to test for gaps or missing items. For more information on using the Gaps command to test for data errors, see Lesson 3.6: Testing for Sequences, Duplicates, and Gaps on page 107. You may recall that the Gaps command is valid for character or numeric fields. To check for gaps in the InvoiceNo field: 1. Select Analyze from the menu bar and choose Gaps. 2. In the Sequence On list view, click InvoiceNo. 3. Check the Presort check box. 4. Click [OK] to execute the command. ACL displays the result. As you can see from the result, two records have gaps.
Module 8 Troubleshooting Data Errors 351 Troubl eshooti ng Data Errors To determine which records contain the gaps or duplicates, you need to set a filter in the view. To set a filter to find which records contain gaps: 1. In the View window, click the filter text box and enter InvoiceNo=" "(with a space between the double matching quotes). 2. Click (Set Filter). 3. ACL displays the view with only the record that meets the filter conditions. Record 12 has a blank InvoiceNo field. 4. Click (Remove Filter) to view all records again. Another example of incomplete data is in the Product Number Column. A quick glance at the view shows you that there are two blank entries in the Product Number column for records 3 and 8. You can also use the Count command to count the number of records that contain blank values in a field. To count records with blank values in the ProdNo field: 1. Select Analyze from the menu bar and choose Count. 2. In the If text box, enter ProdNo=" "(matching quotes separated by a space). 3. Click [OK]. ACL displays the result, showing that two of the records contain blank entries in the ProdNo field. 4. If you now set a filter to find these two records, as you did with InvoiceNo, you will find that records 3 and 8 have blank fields. What is Inconsistent Data? Inconsistent data is data for which comparable or matching data does not exist in another field or file. You often find inconsistent data by comparing data in two separate files. For example, a customer master file record may not exist for an invoice entry in a transaction file. You can use the Join command and the Unmatched Records option to 352 ACL for Windows 7 Workbook Troubl eshooti ng Data Errors identify data that is inconsistent between files. You can also create a relationship between the files to identify inconsistent data. For more information on using the Join command, the Unmatched Records option, and the Relations command, see Lesson 4.7: Joining, Relating, and Merging Data on page 164. You can also use computed fields to verify data. For example, in Badfile, the Total field should equal the Price multiplied by OrderQty. To test this relationship, you can create an expression to perform this calculation. You can then compare the result with the value in the Total field. To check the Total field: 1. In the View window, click (Add Columns). 2. Click [Expr] to display the Expression Builder. 3. In the Available Fields list view, double-click the Price field. 4. Click (Multiply). 5. In the Available Fields list view, double-click the OrderQty field. 6. In the Save As text box enter ConTotal. 7. Click [OK] to close the Expression Builder. 8. Click [OK] to close the Add Columns dialog box and execute the command. ACL adds ConTotal to the far right of the view. By setting a filter, you can now search the file for the first record (if any) in which the amount in the control total field differs from the amount in the Total field by more than .01. The .01 amount allows for any rounding of the values in the two fields. To set a filter to determine which records contain inconsistent data: 1. In the View filter text box in the View window, enter ABS(TOTAL-CONTOTAL)>.01 2. Click (Set Filter).
Module 8 Troubleshooting Data Errors 353 Troubl eshooti ng Data Errors 3. ACL displays the view of all records that meet the filter conditions (records 2 and 14). For these two records, the amount in the control field differs from the amount in the Total field by more than .01. Dumping Data When you encounter invalid data in the file, the Dump command can give you useful information. Dump displays the contents of a specified file or the current record in hexadecimal (HEX), ASCII and EBCDIC formats. You can display the entire contents of a specified file, or you can display only the selected record in your current view. You can dump any file at any timethe file does not need to be open. Simply specify the full file name.To use the Dump command: Select Tools from the menu bar and choose Dump. The currently selected record is displayed in the Dump window. This integrated window lets you specify Dump parameters in the top of the window. ACL displays the results in the bottom of the window. The default Vertical format displays each type of data side by side. Because the Dump command is an interactive command, ACL displays the results only in the Dump window. The results do not appear in the command log. Choosing the Record Number to Dump The Record option button is selected by default to dump the contents of the current record. To display a different record in the Dump window: 1. In the View window, click the desired record number. OFFSET column 354 ACL for Windows 7 Workbook Troubl eshooti ng Data Errors 2. ACL should automatically update the information in the Dump window, but to ensure that it does, you may want to click [Refresh]. ACL shows the results of the record dump. Dumping an Input File The Record option button is selected by default to dump the contents of the current record, however, you can also dump an entire input file. To display an input file in the Dump window: If you know the name of the file, enter it directly in the File text box. Otherwise, select File to display the Select file to dump dialog box, select a file (in this case select Badfile.fil) and click [Open]. ACL displays the results of the file dump. Changing Dump Options You can choose to dump from a different starting byte, and specify the column width, direction, and data formats you want to display. The options you choose remain selected until you change them or exit ACL. The Skip Bytes option lets you bypass a specified number of bytes before the dump of the file or record begins. To change dump options: 1. In the Skip Bytes text box, enter 5 as the number. The default number of Skip Bytes is zero. 2. Click [Refresh]. The Offset column in the lower part of the window shows the new starting byte for that row of data. Input file name
Module 8 Troubleshooting Data Errors 355 Troubl eshooti ng Data Errors 3. Check the Horizontal check box to display hexadecimal, ASCII, and EBCDIC data, one under another, in the bottom half of the window. Whether you are dumping a specified file or the current record, you can dump horizontally or vertically (as by default). The Columns text box lets you change the width of the output. 4. Enter 20 as the number of data bytes you want ACL to display on each line in the Columns text box. The default is 16 for vertical, 64 for horizontal. Leave the HEX, ASCII, or EBCDIC check boxes checked to display data in hexadecimal, plain text, and IBM EBCDIC format. 5. Click data in the bottom half of the window. ACL displays the position number of the data byte that you clicked. 6. Click [Refresh] to update the display after you change Dump options. You can also press ENTER. The Dump window now looks similar to this: To search for a string using the Find text box: 1. Click [Find] to display the Dump Find dialog box. You can use the Find option to search for hexadecimal, ASCII, or EBCDIC strings in the file or record. 356 ACL for Windows 7 Workbook Troubl eshooti ng Data Errors 2. Enter what you want to locate in the Find text box. 3. Leave the ASCII option button selected, as it is by default, or select the EBCDIC or HEX option button. 4. You can check the Ignore case check box to find either an uppercase or lowercase string specified in the Find text box. Leave this option off, as it is by default, to find a string with the case you specify. 5. In the Search from area, Top is selected by default to search from the start of the file. Select Cursor to have ACL search from the cursor position. If you selected Record instead of File in the Dump window, ACL will search only the record. 6. Click [Find]. ACL highlights the first occurrence of the string in the Dump window. ACL changes the default to Cursor. Click [Find] again to jump to the next occur- rence, and so on. ACL displays the message No match found when there are no more occurrences of the string. 7. Click [Close] when you have finished. You will recall from the results of the Verify command that there is a problem with record 2 in the Total field. To specify a dump of the invalid data, you must first find out the field location. To determine the location of the Total field in the input file: 1. Select Edit from the menu bar and choose Input File Definition. 2. In the defined fields list view, you can see that Total starts at position 62 and is 14 bytes long. From this you know that the invalid data is between positions 62 and 75. 3. Double-click Total. When you have finished locating the Total field, close the Data Definition window.
Module 8 Troubleshooting Data Errors 357 Troubl eshooti ng Data Errors To use Dump to review the contents of the invalid record: 1. Display the default view of Badfile. 2. In the Record number column, click record 2. 3. Select Tools from the menu bar and choose Dump. ACL displays the Dump dialog box with Record selected. 4. Check the Horizontal check box. This format is easier to view than a columnar (vertical) listing. Notice that ACL changes the column width from 16 to 64, as this is the default width of a horizontal dump format. Notice that all fields in record 2 are displayed in hexadecimal, ASCII, and EBCDIC formats. The Offset rows mark the byte position in the record: in the first row by increments of ten, and in the second row by increments of one. The ASCII row displays the data in each field in readable format. You can reference the Offset and ASCII rows to locate the position of the field in the input file. You know from using the Data Definition window that the Total field lies between positions 62 and 75, and in fact the character data BADREC appears within positions 69 to 74. 5. Click the View window again to display the default view of Badfile. Notice that in record 2 of the Extended Price column, which represents the Total field, ACL displays negative zeros. Correcting Faulty Data Once you determine the correct values for the invalid, improper, incomplete, or incon- sistent data, you can create computed fields to store the correct values. To create a conditional expression to correct the invoice numbers: 1. Select Edit from the menu bar and choose Input File Definition. 2. In the Input File Definition window, click the [Edit Fields/Expressions] tab, and then click (Add a New Expression) to show the define expression options. 3. In the Name text box, enter CInvNo. 4. In the Default Value text box, enter InvoiceNo. 5. Click (Insert a Condition). ACL displays the Add a Condition and Value dialog box. 6. In the Condition text box, enter INVOICENO=' ' (pressing the spacebar six times between quotes). 7. In the Value text box, enter '214236'. 358 ACL for Windows 7 Workbook Troubl eshooti ng Data Errors 8. Click [OK] to add the condition and value. 9. Click again to add a second condition. 10. In the Condition text box, enter INVOICENO='014239'. 11. In the Value text box, enter '214239'. 12. Click [OK]. ACL displays the two conditions in the Condition list box, and their corresponding values in the Value list box: 13. Click (Accept Entry). 14. Close the Input File Definition window. To add the CInvNo field to the view: 1. Click (Add Columns) in the View window. 2. Double-click CInvNo to move it to the Selected Fields column. 3. Click [OK]. ACL displays CInvNo as the last column in the view. You determined previously that the value of InvoiceNo should be 214236 for record 12 and 214239 for record 19. If you look at records 12 and 19 in the CInvNo column, you can see that ACL has recalculated the values as specified in the conditional expression you defined. You will now use the CInvNo column instead of the InvoiceNo column as your Invoice Number column.
Module 8 Troubleshooting Data Errors 359 Troubl eshooti ng Data Errors To use the Gaps command to check the CInvNo field for gaps: 1. In the View window, click the CInvNo column to select it. 2. Select Analyze from the menu bar and choose Gaps. ACL displays the results, telling you that there are no data sequence errors. You can use the techniques in this lesson to create similar computed fields to store the corrected values of any fields that contain faulty data. Exiting ACL If you want to exit ACL now or change to a different file, save your changes with a new name. 360 ACL for Windows 7 Workbook Troubl eshooti ng Data Errors 361 Module 9 USING THE DIALOG BUILDER Module 9 shows you how to create your own dialog boxes to use with the interactive batches you create in ACL. You will learn how to: Plan and create a batch dialog box Add controls Edit an existing dialog box Run a dialog box in a batch 362 ACL for Windows 7 Workbook Desi gni ng Batches Usi ng the Di al og Bui l der Lesson 9.1 Designing Batches Using the Dialog Builder The Dialog Builder lets you design custom dialog boxes that prompt for input and selec- tions in interactive batches. These dialog boxes allow for quick input of select or specific information and help streamline the batch process. Use the Dialog Builder to perform all of the functions of multiple Accept commands, and in place of commands that limit what a user can enter. Unlike the Accept command, the Dialog Builder lets you select a full range of controls, including radio buttons and check boxes. You also have the freedom to customize the size and placement of each control. The Dialog Builder offers you the flexibility and control to design highly sophisticated and personalized batches to suit your particular needs. Planning a Batch Dialog Box The power of this feature makes it essential that you have a firm understanding of your files, and that you take the necessary care to plan your batch before using it. Think about creating a batch dialog that matches your objective. The time you spend planning the batch may save you time and effort later. Some of the issues you should consider before you create a batch dialog box are: What will the batch do? Will it contain custom dialog boxes, and if so, what information will they collect? Where and how will the information be used? What errors can occur, and how will they be handled? Who will run the batch? Creating a Batch Dialog Box To use the Dialog Builder in a batch: 1. Click (Overview). 2. Click the (Batches) icon, and then either: Click (New) to create a batch, or Double-click the batch in which you want to use the Dialog Builder. ACL asks you if you want to edit or run the batch. Click [Edit] to change the batch.
Module 9 Using the Dialog Builder 363 Desi gni ng Batches Usi ng the Di al og Bui l der ACL displays the Batch window. If you are creating a new batch, design the batch first. Before you use the Dialog Builder, determine its most efficient use in your batch. Then, when you have an existing batch and know your objective, open the Dialog Builder. 3. In the Batch window, click (Build New Dialog). ACL displays the Dialog Builder, which is called User Dialog until you save it with a new name. Dialog Controls and Variables Using Dialog Builder controls, you can add text and check boxes, option buttons, drop-down and Project-item lists to dialog boxes. Note: You can change the size and position of the [OK] and [Cancel] buttons, but you cannot delete them. They are integral to the dialog box. Build New Dialog Text Edit Box Radio Buttons Check Box Drop-down list Project item list Snap to grid Delete 364 ACL for Windows 7 Workbook Desi gni ng Batches Usi ng the Di al og Bui l der The controls, with the exception of Text, generate variables that can replace command parameters such as file names, field names, and variables. The table below lists the controls and their variables. Adding Text Messages The text control allows you to create messages or labels that prompt or inform. To create a text message: 1. Click (Text). When you move into the definition area, your cursor changes to a (box with a plus). 2. Click in the Dialog Builder where you want ACL to position the upper left corner of the control. ACL displays the Text dialog box. 3. Enter up to 63 characters, including spaces, in the Label text box. For example, enter Enter the Department:. Control Default Variable Name Variable Content Edit Box EDIT1 Text (entered) Check Box CHECKBOX1 T or F Radio Button RADIO1 1, 2, ...n Drop-down list DROPDOWN1 Text (entered or selected) Document Item List ITEM1 Text (selected document item name) ACL displays this text in the control.
Module 9 Using the Dialog Builder 365 Desi gni ng Batches Usi ng the Di al og Bui l der 4. Click [OK]. ACL adds the text control with the label to the Dialog Builder. You can click and drag the control handles to resize the text control to the size you want. Adding Text Boxes Text boxes capture text input and assign it to a character variable. The contents of the variable then become parameters in ACL commands. For example, you can create a dialog box that prompts for a cutoff date in an Age command. Or, you can create a dialog box that prompts for the name of a file to which information will be extracted. You can also create default text that prompts for infor- mation such as a cutoff date in YYYYMMDD order. To create a text box using the Edit Box control: 1. Click (Edit Box). When you move into the definition area, your cursor changes to a . 2. Click in the Dialog Builder where you want ACL to position the upper left corner of the control. ACL displays the Edit Box dialog box. ACL grays out the options that do not apply. 3. In the Variable text box, replace the default name, EDIT1, with a meaningful variable name that you can remember and use later in the batch. ACL increases the variable number of the selected option by one each time. For example, the Variable text box displays EDIT1 for the first edit box, EDIT2 for the second edit box, and so on. Note: If you want any control to have default text, enter it in the Default Text text box. 366 ACL for Windows 7 Workbook Desi gni ng Batches Usi ng the Di al og Bui l der For more information, see the Accept command under Interactive Batches on page 319 of the ACL for Windows User Guide and online Help. 4. Click [OK]. ACL adds the edit box control and any default text to the Dialog Builder. Adding Check Boxes The check box control generates a logical variable. When the person using the batch selects the check box, the variable takes the value T for true. Leaving the check box unselected generates the value F for false. To add a check box: 1. Click (Check Box). When you move into the definition area, your cursor changes to a . 2. Click in the Dialog Builder where you want ACL to position the upper left corner of the control. ACL displays the Check Box dialog box. 3. In the Variable text box, enter a meaningful name. ACL uses this variable name to create a logical variable when you run the batch. 4. In the Label text box, enter a label for the control. This is the text that will be displayed next to the check box. 5. If you want the check box to be checked by default, select the Checked option. When the user checks the check box, ACL sets the variable to true. When the check box is unchecked, ACL sets it to false. 6. Click [OK]. ACL adds the check box control to the Dialog Builder.
Module 9 Using the Dialog Builder 367 Desi gni ng Batches Usi ng the Di al og Bui l der Adding Option Buttons The radio button control allows you to create a set of option buttons in the dialog box. The numeric radio button variable contains an integer corresponding to your button selection. For example, if you select the third in a set of option buttons, then RADIO1 = 3. To add a radio button control: 1. Click (Radio Buttons). When you move into the definition area your cursor changes to a . 2. Click in the Dialog Builder where you want ACL to position the upper left corner of the control. ACL displays the Radio Button dialog box. 3. In the Variable text box, enter a meaningful name. This creates a numeric variable when you run the batch. ACL assigns the value 1, 2, 3, etc., depending on whether you choose the first, second, or third radio button. 4. In the Label text box, enter a label for the control. 5. Click [Add] to add the label to the bottom of the Label List text box. 6. Once you have clicked Add, you can also click any of the following: [Insert] to place the label above the highlighted label in the Label List text box [Replace] to replace the highlighted label in the Label List text box with the label you enter in the Label List text box [Delete] to remove the highlighted label from the Label List 368 ACL for Windows 7 Workbook Desi gni ng Batches Usi ng the Di al og Bui l der [Set Default] to make the label the default 7. Click [OK]. ACL adds the Radio Button control, with the label from the label list, to the Dialog Builder. Adding Drop-down Lists The drop-down list control generates a character variable containing the text of the selected drop-down item. Create drop-down lists so that you can select from a restricted list of items. Such items include file or field names, or any other text that you want to include as an option. To add a drop-down list control: 1. Click (Drop-down List). When you move into the definition area your cursor changes to a . 2. Click in the Dialog Builder where you want ACL to position the upper left corner of the control. ACL displays the Drop-down List dialog box.
Module 9 Using the Dialog Builder 369 Desi gni ng Batches Usi ng the Di al og Bui l der 3. In the Variable text box, you can replace the DROPDOWN1 variable with a meaningful name. 4. Type a custom label in the Label text box, then click [Add] to add the label to the drop-down list that will appear in the custom dialog box. 5. You can also click: [Insert] to add the label above the highlighted label in the Label List [Replace] to replace the highlighted label in the Label List with the label you enter in the Label text box [Delete] to remove the highlighted label from the Label List [Set Default] to make the label the default 6. Click [OK]. ACL adds a drop-down list control to the Dialog Builder. Adding Project-Item Lists Use the Project Item List control to create lists of ACL Project items, from which you can choose one. This control generates a character variable named ITEM1, which contains the text of the item you select. You can add various categories of items to the Category List including: Character, numeric, logical, or date fields Character, numeric, logical, or date variables Input file definitions Batches Views 370 ACL for Windows 7 Workbook Desi gni ng Batches Usi ng the Di al og Bui l der Workspaces Indexes To add a Project-item list: 1. Click (Project Item List). Your cursor changes to a when you move into the definition area. Click in the Dialog Builder where you want to position the upper left corner of the control. ACL displays the Project Item List dialog box. 2. Enter a meaningful name in the Variable text box. 3. Select an item from the Category drop-down list. 4. Click [Add] to add the category to the bottom of the Category List. 5. Once you have clicked [Add], you can also click: [Insert] to place the category above the highlighted category [Replace] to replace the highlighted category in the Category List with the category you chose from the Category drop-down list [Delete] to delete the highlighted category 6. When you have added all of the categories you want to the Category List, click [OK]. ACL adds the Project Item List to the Dialog Builder. Default variable name ACL displays these items in the batch file.
Module 9 Using the Dialog Builder 371 Desi gni ng Batches Usi ng the Di al og Bui l der The six controls look similar to the following: Saving the Dialog Builder in the Batch When the Dialog Builder has all of the elements required for your batch process, save it with a meaningful name, and then close the batch. To name the Dialog Builder: 1. Double-click in the gray area of the Dialog Builder box. ACL displays a User Dialog box. You can change the width and height of the Dialog Builder, as well as give it a new title. 2. In the Title text box, replace User Dialog by entering a meaningful name for the Dialog Builder. 3. Click [OK]. ACL renames the Dialog Builder. Now that you have entered all of the controls you want and given the Dialog Builder a meaningful name, save the Dialog Builder in the batch. 1. Close the window. ACL asks you if you want to save the dialog settings. Project item list Text Edit box Check box Drop-down list Radio buttons 372 ACL for Windows 7 Workbook Desi gni ng Batches Usi ng the Di al og Bui l der 2. Click [OK]. ACL displays the Dialog Builder function string in the Batch window similar to this: 3. Close the batch window. ACL asks if you want to save the changes to the batch. 4. Enter a new name for the batch in the text box. 5. Click [OK] to save the batch. For more information, see Dialog Builder on page 153 of the ACL for Windows Reference Manual. Editing an Existing Dialog To edit or delete the controls of an existing dialog box: 1. In the Overview window, double-click an existing batch or drag the icon of an existing batch onto the application workspace. ACL displays a dialog box asking if you want to edit or run the batch. Note: The Dialog Builder command must be one long line in the batch, but to make it easier to view, the string has been wrapped to multiple lines in the example on page 368. Dialog Builder command
Module 9 Using the Dialog Builder 373 Desi gni ng Batches Usi ng the Di al og Bui l der 2. Click [Edit]. ACL displays the Batch window. 3. Double-click the Dialog Builder command (the line beginning with DIALOG) in the Batch window. Then click (Edit Command). ACL displays the Dialog Builder: To change or delete a control, do any of the following: Click a control to display its handles. Drag the handles to resize the control. You can also click and drag the dialog box handle to resize the dialog box. Click the control and drag it to another position. Double-click a control to edit the control specifications in the dialog box, and then click [OK] to save the changes. Select a control and click (Delete) to remove a control. 4. When your dialog box is complete, close the window. ACL displays the message: Save changes to dialog? 5. Click [OK] to save the changes. ACL updates the Dialog Builder command line in the Batch window. 6. Close the Batch window. ACL prompts you to save changes to the batch. Click [OK]. Control handles Delete Resize handle 374 ACL for Windows 7 Workbook Desi gni ng Batches Usi ng the Di al og Bui l der Running the Dialog in a Batch To run the batch: 1. Double-click the name of the batch in the Overview window. ACL asks you if you want to edit or run the batch. 2. Click [Run] to execute the batch. ACL displays the Dialog Builder for user input at the point in the batch in which you created it. For example, during the running of a batch, a dialog similar to the following could display for user input: With a dialog box like the one above you can enter a department name, select a checkbox, select items from a drop-down list, or select various option buttons. Dialog boxes allow you to quickly input a wide range of information. 375 Appendix A COMMON USES FOR ACL This appendix offers a list of potential uses for ACL. The following pages contain recom- mended audit and analysis plans for various common application areas. The list is not exhaustive, but is designed to get you started. Ultimately, you are limited only by your imagination. Audit/Data Analysis Applications Stock/Inventory Calculate total of stock balances Calculate totals by product category Select monetary unit samples of inventory Generate exception reports, including negative values, quantities or costs, extension errors, and so on Select items from perpetual stock records for test counts Report transactions after period end Prepare aged schedules of stock items Report months of stock on hand from usage history Report variations between test counts and perpetual records Debtors/Accounts Receivable Calculate total of customer balances Summarize product balances by customer Select monetary unit samples of balances or transactions Identify accounts with credit balances Prepare aged customer analysis Generate exception reports, including balances over credit limits, unusual terms or limits, large balances, and so on Select sample of accounts for confirmation Report transactions after period end Report duplicates in a sequence of invoices Report slow-to-pay accounts Report inter-company transfers 376 ACL for Windows 7 Workbook Creditors/Accounts Payable Calculate total of creditor balances Summarize produce balances by creditor Select monetary unit samples of balances or transactions Identify accounts with debit balances Prepare aged payables analysis Generate exception reports, including aged invoices, large balances or amounts, and so on Report transactions after period end Report duplicate payments Report missing check numbers Report unauthorized large purchases Report payments made to accounts or addresses other than those registered in the suppliers ledger Report payments made after the due date Wages and Salaries/Payroll Calculate total of payroll files Summarize to produce totals by employee Report high value totals or transactions Select monetary unit samples of balances or transactions Recalculate gross and net pay Generate exception reports, including duplicate names, pay rates or hours that are too high or too low, and so on Report former employees still on payroll Report master file changes detected by comparison to prior-period data Fixed Assets Calculate total of fixed asset ledger balances, gross and depreciated Calculate total of tax categories Report fixed asset disposal for review Recalculate depreciation and report errors Select assets for physical inspection
Appendix A Common Uses for ACL 377 Generate exception reports, including high values, unusual depreciation rates, or lives, and so on Report fixed asset additions and disposals General Ledger Calculate total of general ledger accounts Select monetary unit samples of balances or transactions Report transactions after period end Prepare trial balance Compare opening balances to prior period closing balances Summarize accounts into financial statement headings Generate exception reports, including unusual dates, invalid accounts, unusual journal entry sources, unusual amounts for given sources, and so on Purchases Summarize transactions by account debited Select monetary unit sample of transactions Generate exception reports, including refunds, high values, and so on Report transactions after period end Report duplicate items Sales Summarize transactions by account credited Select transactions for manual inspection Generate exception reports, including credit notes, high values, and so on Report transactions after period end Report duplicate items Long Term Work in Progress Report accounts with credit balances Report transactions after period end Report duplicate items Report new contracts for review Report contracts in which balance exceeds authorized amount Report completed contracts and remaining work in progress 378 ACL for Windows 7 Workbook 379 Appendix B ODBC ACCESS ACL gives you the ability to access ODBC databases. What is ODBC? ODBC (open database connectivity) is a standardized application programming interface (API) technology that allows applications to access multiple third-party databases (called heterogeneous databases). ODBC includes the following. ODBC Driver Manager A dynamic link library (DLL) provided by Microsoft that loads ODBC drivers on behalf of an application. ODBC driver A dynamic link library (DLL) that implements ODBC function calls and interacts with a target data source. ODBC-enabled application An application that is inherently ODBC-compliant; ODBC compliance cannot be added to an existing application. Also known as a front-end or ODBC client application. ODBC Access Use the ODBC option only after correctly loading the ODBC drivers. If you can read ODBC data with another software package, you know it is correctly installed and therefore ACL can access your ODBC data. Before you start ACL, make sure your ODBC data default directory is set correctly. ODBC sets the default directory to where your driver looks for its data. To set the default directory, open your computers Control Panel and double-click ODBC. Select the data source directory from which you want to convert data. If you need assistance with ODBC drivers, contact your companys systems administrator. Converting an ODBC File Open an ACL Project, if you have not already done so. To convert an ODBC file: 1. Click (Overview) to display the Overview window. 2. Click (Input File Definitions). 3. Click (New). ACL displays the Welcome screen of the Data Definition Wizard. Click [Next]. 380 ACL for Windows 7 Workbook 4. Select ODBC. 5. Click [Next]. The Select Data Source dialog box appears. 6. Choose the type of ODBC data source you are using from the File Data Source list box on the [File Data Source] tab. The Server drop-down list displays all possible sources of ODBC data for which you have installed drivers. If you can not find the data source you are looking for, check the options on the [Machine Data Source] tab. If no options are shown, ODBC may not be installed. Contact your systems admin- istrator for assistance.
Appendix B ODBC Access 381 7. Select the MS Access option and Click [OK]. ACL displays the Select Database dialog box. 8. Select Sample.mdb to make it appear in the Database Name text box. Click [OK]. Note: If you want to read data from a dBASE-compatible database (for example, dBASE, FoxBase TM or Clipper TM ), select Disk as your data source, rather than ODBC. ACL processes dBASE and dBASE-compatible files more efficiently from disk. 382 ACL for Windows 7 Workbook The Select Table dialog box appears. 9. Select the file you want to convert from the Select Table dialog box. The Select Table dialog box lists all sets of data in the directory you selected. 10. Click [Next]. ACL displays the Save As dialog box. 11. Select the directory and enter a name. 12. Click [Save]. ACL displays the Select Fields dialog box. Note: By default, the Select Table dialog box lists Tables and Views available, however, you can view other available types by checking the appropriate check boxes in the Types area of the dialog box.
Appendix B ODBC Access 383 The default is to select all Available fields and list them in the Selected fields list box. You can click [], [], [Clear All], or [Add all] buttons to change the selection to only those fields you want to convert. 13. In the WHERE text box, enter a condition if you want to limit the records converted. This is a Structured Query Language (SQL) statement that lets you select the records to be imported. For example, enter Country ='Canada' to select only those records with Canada in the Country field. You must enter the condition in single quotes. ACL displays an error message if you enter double quotes. 14. Click [Next]. A box reports the ODBC conversion progress. The message flashes quickly for small ODBC files. However, the greater the size of the file, the longer it takes to convert. 15. ACL prompts you to save the input file. Click [OK]. When the conversion is complete, ACL displays your data in the View window. You can now use the data as you would any other ACL data file. For more information, see Defining Data Fields on page 42. Note: To see how much space is required for an ODBC file, enter a condition in the WHERE text box and click [Apply]. The Disk Space area shows the Available space on your local disk and the Required space for the file with the condition applied. If you leave the WHERE text box blank and click [Apply], the Required line displays the required space for the whole file. Note: ODBC databases are read one record at a time. The database is imported into ACL as a flat, fixed length, sequential file. The data file does not change. 384 ACL for Windows 7 Workbook Any changes to the database after you import it are not included in the ACL file. ACL does not refresh the data file every time you open it. ACL takes a snapshot of the data. If you need current information, click (Refresh from Source File) in the Input File Definition window to refresh the file from the current ODBC database. If ACL displays a column title with blank data fields, it indicates that a field type was not converted. You may also notice some numeric fields default to two decimal places. For example, ACL does not convert variable length and custom field types, as there is no consistent way to properly convert them. If an ODBC numeric field is set as a floating decimal field, ACL sets a default of two decimal places. Choose Edit from the menu bar and select Input File Definition to change the decimal setting in the Edit Fields/Expressions options. Updating an ODBC File To update an ODBC database table, you do not need to import the database again. Simply click (Refresh from Source File) 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. Refresh from source file 385 Appendix C GLOSSARY This section contains an alphabetical list of ACL terms and their meanings. More infor- mation on each term, along with practical examples of its use in ACL, is included in the appropriate sections of this workbook. 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 previously issued. Ad Hoc Field/Expression An unnamed field or expression used for temporary calculations and not saved as part of an input file definition. See also Expression on page 389. Age The number of days between two specified dates. You can calculate the age of a trans- action by subtracting one date from another date. Append A process of adding the output records from a file created by an ACL command to the end of an existing file. Append can be used to replace Merge in many situations. See Merging on page 394. Application Workspace Not to be confused with a Workspace, which is a type of file, the application workspace is the area where you work with your data. This area is blank until you open a data file. See also Workspace on page G-18. Argument An expression or field value of any type, used in a test. 386 ACL for Windows 7 Workbook 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 389. 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 previously issued. Batch A series of ACL commands named and stored in an ACL Project. You can design a batch to execute repeatedly and automatically, or to prompt you 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 transmitting 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. Button Bar The button bar provides fast access to commonly used commands and options. You can customize the number and order of icons in the button bar to suit your needs. Canned Applications When starting ACL, you can include optional command line parameters to automati- cally load a Project, initialize variables or start a batch. In this way, you can create an icon in Windows, which, when double-clicked, automatically performs a complex routine task.
Appendix C Glossary 387 Character A letter, digit, or other symbol used to represent data. Character data is normally used to represent text strings or date information. Character String A sequence of characters. See also Character on page 387. Column A column is a defined field or expression that is displayed vertically in the View window. View columns display the fields you define and format from the data file. Column Headings The titles shown at the top of each column in the View window are called column headings. ACL automatically gives the column headings the same name as the fields in the data file, until you give them a new title. Command Log An electronic log that records each command you issue and its results, from the time you open an ACL Project until you close the Project. Each Project you create in ACL has its own log. 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 395. Condition A test that returns a true or false value. Conditional Field A field whose value depends on a condition. 388 ACL for Windows 7 Workbook See also Conditional Computed Fields on page 144 of the ACL for Windows User Guide and Static Conditional Fields on page 155 of the ACL for Windows User Guide. Constants Any date, numeric, string, or logical value that does not change as ACL processes a record. COUNTn A special ACL variable created automatically by specific ACL commands, such as the Statistics command. COUNTn contains the number of records in the file, on which that command was previously issued. CR File A file in which the end of a record is indicated by a carriage return (CR). This is the standard means of separating line files on Macintosh-compatible computers. CR/LF File A variable record length file in which the end of a record is indicated by a carriage return (CR) and a line feed (LF) character. Data File A file in which computer-based data and information is stored. Also referred to as a source file. The data file is not actually stored as part of an ACL Project, but links to the Project by way of the input file definition. ACL does not alter the data file in any way. Data Types See Field Types on page 390. Default View A view that displays defined data fields in the order in which they appear in the data file. 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.
Appendix C Glossary 389 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 386. 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 be used only in a group, never on its own. END An ACL command that closes or finalizes a group of commands. End can be used only in a group, never on its own. End of File Abbreviated as EOF. Indicates the end of a set of data. As a parameter, EOF executes the command one additional time after the end of file has been reached. Expression A set of operators 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 ACL Project. Ad hoc, unnamed expressions can be used only for a single calculation and are not saved as part of the input file definition. See Computed Field on page 387, Extract on page 389, Filter on page 390, Global Filter on page 391, and Local Filter on page 393. 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 396. 390 ACL for Windows 7 Workbook Field Definition A field definition identifies and describes the format of the data in a file. Computer files can have many fields for the same record. Typically, each record in a file contains the same fields. Field Types The types of data readable by ACL. Because data types usually apply to the fields of input data records, they are commonly called field types. ACL supports most field types, including those found in specific applications such as SAP. 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 391. 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 know as a logical type. See also Global Filter on page 391 and Local Filter on page 393. 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 397. 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 lets you control decimals and rounding. Fixed-point numbers display and calculate values exactly as they are stored. For example, you can display a fixed-point number stored as 1.11 only as 1.11. In other words, if the stored value is 1.1111, ACL will display the number as 1.1111.
Appendix C Glossary 391 Function A routine that accepts zero or more parameters, performs a calculation, and then returns a value. GAPDUPn A special ACL variable created automatically by specific ACL commands, such as the Sequence, Gaps, or Duplicates command, that contains the number of gaps and/or duplicates in the file on which that command was previously 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 390. 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 previously 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 let you print a file history and other information when you print a report, a view, or the Last Result window. See also File History on page 390. 392 ACL for Windows 7 Workbook 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 397. Also a command that performs an action if a condition is true, such as: IF TOTAL>1000000. 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 Data File on page 388 and Input File Definition on page 392. Input File Definition Describes the structure, contents, and layout of a data file, links the data file to the ACL Project and includes field names, field definitions, and field types. ACL provides some information for you, such as the file type, character type, media type, the number of records, and the record length. Interactive Batch A batch that prompts you for information while the batch is running. See also Batch on page 386.
Appendix C Glossary 393 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 Join command lets you combine the fields of two files with different structures into a third file, and can identify matched or unmatched records in one or both files. Key Field A sort field. When sorting a file, the key field is the field(s) you tell ACL to use to create the sort order. Legacy File Older data files generated primarily on mainframe computers that have no internal data definition. You must create an input file definition for them. See also Input File Definition on page 392. 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 390 and Global Filter on page 391. Log File A cumulative record of all ACL commands issued, followed by their results, from previous ACL sessions to the point the log was last cleared. ACL automatically creates a log file specific to the Project created, and time and date stamps each entry. See alsoCommand Log on page 387 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 previously issued. 394 ACL for Windows 7 Workbook Materiality Level In sampling, the maximum extrapolated dollar value that is acceptable to confirm a hypothesis. Maximum Tolerable Tainting In MUS sampling, the dollar amounts may be only partially in error. The amount of error for a specific item is called the error tainting. For example, a $100 item that is totally in error has a 100% tainting, whereas a $100 item that 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. 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 previously 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 385. 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 previously 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 previously issued. Monetary Unit Sampling (MUS) Abbreviated as MUS. In sampling, a method of selecting records in which the likelihood of selection is proportional to the value of a field. The greater the value of the field, the more likely that field will be selected.
Appendix C Glossary 395 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 391. 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 397. ODBC ODBC Open database connectivity is a standardized API (application programming interface) technology that allows applications to access multiple third-party databases (also called heterogeneous databases). Operators Mathematical and logical symbols used in building expressions. The operators in ACL include: See also Expression on page 389. 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. () - ^ * / + < > = >= <= <> NOT AND & OR | 396 ACL for Windows 7 Workbook See also Computed Field on page 387. 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 397. Project A file that contains all ACL file definitions (views, reports workspaces, and batches). The file containing the data to be analyzed is not part of the Project, but is linked to the Project by way of the input file definition. The Project file name uses the extension. acl. Temporary Projects use the extension. ac. See also Input File Definition on page 392. Random Seed The starting value for random record sampling. See also Record Sampling on page 396. 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 389. Record Sampling In sampling, a method of selecting records in which 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.
Appendix C Glossary 397 Ruler The ACL ruler is used as a guide to defining fields, because it marks the byte position of each field in the data file. SAMPINTn A special ACL variable created automatically by specific ACL commands, such as the Size command, that contains the sample interval based on data given to the command. SAMPSIZEn A special ACL variable created automatically by specific ACL commands, such as the Size command, that contains the sample size based on data given to the command. Scope Parameter A statement that can be included in an ACL command to limit how much of a file is processed, or to limit the execution of a command or batch. Examples are: If, While, Next, and First. Scope parameters can be used separately or in conjunction with each other. Secondary File The second file you open, if you have two files open at once. You can only have one secondary file open or set at a time. A primary and a secondary file are used in Join and Merge operations. The secondary file is the second file you use in Join and Merge opera- tions. See also Primary File on page 396. 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, in which the values in one record relate to subsequent records. 398 ACL for Windows 7 Workbook A static conditional field is a conditional field that is processed differently. When an expression returns false, ACL uses the last valid value in the field until a new valid value is encountered, rather than resetting the value to zero. Status Bar The status bar displays the name of the ACL Project with which you are working, the name of the currently open input file, and the number of records in that file. Tainting In sampling, the amount of error for a particular item. UELn A special ACL variable created automatically by specific ACL commands, such as the Evaluate command, that contains the upper error limit of the data set on which the command was previously 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 ACL Project. Some commands automatically create variables when they are executed. You can use these ACL generated variables, or variables you create yourself, when processing other ACL commands. A variable retains its value until it is changed, deleted, or until you quit ACL. View The display of data in a file according to the way you have defined the files 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 387. 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 397.
Appendix C Glossary 399 White Space The white area surrounding text. ACL uses the available white space in a report to ensure that your data is fully displayed. Workspace A file that stores field definitions which are portable across a number of data files. Usually, these are computed fields that refer to the current environment, but they can also be unique field names and descriptions. Using a workspace file allows you to extend your current input file without having to define extra fields. WRITEn A special ACL variable created automatically by specific ACL commands, such as the Sequence, Gaps, or Duplicates commands, that contains the number of data sequence errors encountered; up to the maximum number specified in your preferences. 400 ACL for Windows 7 Workbook 401
Index A Accept command, about 249 ACL exiting 27 file name extensions 30 getting started with 16 Projects 30 versions, compatibility 5 See also Installing ACL ACL application screen 6, 17, 27 ACL Client/Server System about 332 ACL for OS/390 client/server 332 ACL for Windows Reference Manual about 2 ACL for Windows User Guide about 2 Add Columns button 68 Age command about 156 filters, using 158 graphing output 311 AGE( ) function, about 161 Aging Periods preference 157 Appending files, about 125 Application Font Options preference 342 Application workspace 21 Applications batches 237 ASCII characters about 8 FIND( ) function, using to locate 197 in date fields 50 Assign command, using in groups 263 Automatic Profile on Open preference 105 B Batch applications, about 237 Batch Recorder 244 Batch window 238, 372 Batches about 237 and Accept command 249 and Else command 257, 258 avoiding interruptions while executing 331 creating 238 dialog boxes for user input 374 editing 246 generating reports 295 groups, creating 253 interactive, creating 250 loops, using 264 multiple-record-type files 285 Overview window contents 58 printing 89 running 247, 250, 255 safety 331 within batches 248 Benford command 215 bounds, calculating 216 digit frequencies, comparing 216 leading digits 219 making the most of digital analysis 221 preparing data 215 selecting targets for review 217 Z-statistic 217 Benfords Law 215 Bitmap files, graphs 320 Blanks invalid data, displaying 347 Bounds, calculating in Benford command 216 Breaks page 298 Button bar customizing 20 default settings 19 displaying 330 overview 18 quick reference 19 tooltips, displaying 330 C Case changing 211 Century, setting the start of 55 Character fields exporting 126 Characters excluding from string 349 Check boxes creating 366 Classify command about 143 graphing output 311 CLEAN( ) function, about 347 Clear Log File dialog box 82 Client/Server. See ACL Client/Server Clipboard exporting format 128 Columns about 64 add columns hot key 70 adding to view 68 break, creating 297 changing column format in view 72 changing column titles in view 71 changing width in view 73 deleting. See removing from view de-selecting in view 70 headings 65 modifying in view 70 modifying using Modify Column dialog box 74 moving in view 67 removing from view 67 width changes, saving 334 width, expressions 340 Command log about 79 changing display 80 402 Index clearing 80 comments 80 date and time stamp 336 displaying 79 file history, displaying 84 Graphable Data option 321 printing 82 Show Group Tests in Log 336 Command mode syntax 84 for Loop command 264 in command log 80 Set Safety 331 Commands 257 Accept, about 249 Age 156, 311 Assign 263 Benford 215 Classify 143, 311 Count 97 Create Batch from File History 245 Do Batch 247 Dump 353 Else 258 Evaluate 180, 183, 194, 196 Export 123 Extract 114 Group, in batches 254 Group, multiple-record-type files 276 groups, entering 253 Histogram, about 307 Index, about 137 issuing from command log 84 Join, about 164 Loop, about 264 Merge, about 178 Notify 323 number, displaying in group 256 Profile, about 104 reissuing 84 Relations, about 173 Sample 180, 183 Search, about 135 Size 180, 184, 185 Sort, about 130 Statistics, about 102 Stratify 311 Summarize, about 146 Total, about 99 Verify, about 94 Computed fields about 224 adding to view 228 Conditional groups, about 252 indexes, creating 141 Conditional fields static 274 Conditions using with Verify command 95 Confirmation letters, generating 201 Contacting ACL 3 Control totals, obtaining 253 Controls dialog box 363 Conventions, file naming 30 Conversion utility 11 Converting data 11 Count command 97 CR/LF files 265 Create Batch from File History command 245 creating from the view 290 Custom installation option, about 6 Cutoff date 157 D Data access 8 converting 11 downloading 11 dumping 353 exporting 127 faulty, correcting 357 fields 9 file types 8, 11 obtaining dBASE file 12 obtaining from tape 13 processing 10 relational database 8 sources, identifying 9 types that ACL reads 11 verifying 345 Data Definition Wizard defining files 34 Data errors, four types of 344 inconsistent data 344, 351 Invalid data 344, 345 Data errors, types 344 Data files dBASE file 12 definition of 8 delimited 12, 124, 127 flat file 8 flat sequential file, about 11 ODBC, about 12 report 266 text file 12 Data source 380 Data Source dialog box 62, 380 Date fields Day, Month, Year option 337 defining 46, 50 displaying 52, 53 preference 53 quotes in 124 Date format 51 changing 55 Day, Month, Year option 337 dBASE 12 exporting to 127 files, defining 34 Decimal places setting 73 Default Numeric Format preference 340 Default settings, restoring 329 defined 266 Defining data fields 34, 40, 42 data relations 171 Delete data file with input file preference 332 Delimited files 12, 124, 127 Detail lines suppressing 299 Detail records filtering 273 Dialog boxes Batch user dialog 371 batches, interactive 374 Clear Log File 82 creating 365 Data Source 380 Edit Graph Properties 314 Font 66 List 24 Index 403
Modify Columns, formatting views 290 Print Documentation, about 89 Radio buttons, creating 367 Save Graph As 320 Select View Fonts 66 Text 24 text box, creating 364 User dialog box 371 Dialog Builder check box control 366 controls, editing 372 controls, resizing 373 text control, adding 364 Digit frequencies, comparing in Benford command 216 Digital analysis basis in Benfords Law 215 bounds, calculating 216 making the most of 221 performing using Benford command 215 selecting targets for review 217 three steps of 215 Z-statistic 217 Display Invalid Data as Blanks or Zeros preference 335 Do Batch command 247 Dont Share Input File Layouts option 332 Draw seconds option 335 Drop-down lists creating 368 Dump command 353 Dumping data 353 Duplicates suppressing in reports 301 Duplicating input file definitions 61 E EBCDIC characters about 8 FIND( ) function, using to locate 197 in date fields 50 Edit box control, adding 365 Edit boxes creating 363 Editing batches 246 graph properties 312 input file definitions 47 margin values 292 Else command conditional groups 257 multiple, in groups 258 E-mail, create using Notify command 289 Enable Client/Server preference 332 Evaluate command 180, 183, 194, 196 Excel file 127 EXCLUDE( ) function, about 349 Excluding characters from string 349 Export command 123 Exporting data about 127 Expression Field Width preference 340 Expressions changing 74 defined 224 deleting 235 field width, setting 340 FIND( ) function, using 197 operators, using 225 Extensions, about 41 Extract command 114 F Faulty data correcting 357 Field definitions include in file history 341 Fields about 9 computed 224 defining for multiple record type files 280, 282, 283 numeric, defining 45 overlapping, defining 45 removing from view 67 shifting 48 File extensions, about 41 File History Print File History with Last Result preference 341 File history displaying 84 Include field definitions 341 File naming conventions 30 Files CR/LF files 265 joining, about 206 print, about 12 variable length 265 Filters Age command 158 automatic in report files 274 creating 114 definition of 229 global, applying 234 global, compare to local 229 global, removing 235 header records 269 local, about 229 in reports, using 301 working with 229 FIND( ) function, about 197 Finding character strings 197 Fixed-point arithmetic, about 14 Flat files defined 8 Flat sequential file, defined 11 Floating-point arithmetic, about 14 Font changing size 91 dialog box 66 fixed, changing 342 global, changing 342 proportional 342 selecting, in view 66 Format numeric, changing 72 Formatting Blank Invalid Data preference 340 blank lines, suppressing in reports 304 break columns, creating 297 column width changes, saving 334 columns 70 display invalid data as blanks or zeros 347 404 Index duplicates, suppressing in reports 301 filters, using in reports 301 grid lines, showing 334 headers 293 hide filtered records 334 invalid data, display blanks or zeros 335 line spacing 295 margin values, setting 292 margin, right edge 334 margins, changing 292 Modify Columns dialog box, using 290 numeric 73 numeric, default 340 page breaks, creating 298 reports 290 saving view 298 subtotals, displaying 297 summaries, displaying 299 totals, suppressing in reports 299 views 290 width, expression fields 340 zeros, display as blanks 303 Functions AGE( ), about 161 CLEAN( ), about 347 EXCLUDE( ), about 349 INCLUDE( ), about 349 OFFSET( ), about 264 PROPER( ), about 211 VERIFY( ), about 95 G Global font, changing 342 Global filter, applying 234 Global filters compare to local 229 removing 235 Graph properties, changing 314 Graphable Data command log 321 Graphs Age output option 311 Classify output option 311 command log output 321 Histogram command output 309 properties, editing 312 saving as bitmap files 320 Stratify output option 311 Grid lines, showing 334 Group command in batches, using 254 multiple-record-type files 276 Group test results displaying 336 Groups command number, displaying 256 commands, entering 253 conditional 252, 256 control totals, obtaining 253 in batches 253 loops, using 264 multiple-record-type files 276 nested, creating 261 simple, defined 252 variables, automatic 262 variables, using 262 H Header fields, defining 269 Header record type, defining 276 Header records filters, using 269 Headers customizing 293 Hide Filtered Records preference 334 Histogram command free intervals, using 310 graph output 309 multiple histograms, creating 310 Histogram command, about 307 I IBM variable length files, about 265 Improper data 349 Improper data, defined 349 Include Report History with Reports preference 341 Include View Note in Report History 341 INCLUDE( ) function, about 349 Incomplete data 350 defined 350 error messages 344 Inconsistent data, defined 351 Index conditional, creating 141 Index command about 137 Indexes opening 142 Overview window contents 58 Input file definitions create using Data Definition Wizard 34 dBASE files 34 defined 34 deleting 62 duplicating 61 editing 47 multiple-record-type files 278 new, creating 62 notes, using 87 Overview window contents 58 renaming 62 saving 273 Installing ACL custom option 6 system requirements 5 typical option 6 Workbook data files 5 Interactive batches, creating 249 Invalid data 344 display as blanks or zeros 340 display blanks or zeros 335 error messages 344 remove, using CLEAN( ) 347 J Join command about 164 Joining files, procedure 206 K Key fields break columns, creating 297 Duplicates command 108 gaps testing 110 Index 405
presorting 296 Summarize command 146 L Language option, about 342 Last result print file history with last result preference 341 Line spacing, changing 295 List views, using 26 Local filters creating 229 Loop OFFSET( ) function, using 264 Loop command about 264 Lotus 1-2-3 files, exporting 127 M Margin showing right 334 Margins changing 292 Memory requirements for ACL 5 Menu bar, about 17 Merge command about 178 Microsoft Word merge files, using 127 Modify Columns dialog box formatting views 290 Monetary unit sampling about 182 fixed interval 184 selection 183 Size command, using 184 top stratum cutoff 189 Multiple-record-type files batch processing 285 defining 278 filters, applying 268 Group command, using 276 processing 276 report file 266 Multiple-record-type files, processing 274 N Negative values formatting 73 Nested groups creating 253, 261 Notes copying and pasting 88 file history 341 input file definition 87 printing, about 89 Project, about 86 view, about 88 Notify command 323 e-mail, generating 289 Numeric format 73 format, default 340 Numeric fields, defining 45 Numeric format, changing 72 O ODBC accessing 379 ODBC, about 12 OFFSET( ), about 264 Open View Window preference, about 331 Opening index files 142 Operators summary 225 Other Fields option Summarize command 146 Output Automatic Output Filenames preference 336 Global Page Title preference 335 graphing 307 page orientation 292 previewing 294 print file history with last result preference 341 Use Output File check box 336 Overlapping fields, defining 45 Oversampling selection order 191 Overview window description of 58 icons 59 Overwriting files warning 330 Overwriting files warning 330 P Page breaks, creating 298 Page orientation, changing 292 Page width indicator, turning on or off 291 Pivot date. See Start of Century date 337 Preferences Application Font Options 342 autoexecuting commands 100 Automatic Output Filenames 336 Automatic Profile on Open 105 Command Options tab, about 335 Date Options tab 337 Display Invalid Data as Blanks or Zeros 335, 347 Enable Client/Server 332 Expression Field Width 340 Global Page Title 335 Hide Filtered Records 334 Include Report History with Reports 341 Include View Note in Report History 341 Interface Options tab, about 330 naming files automatically 119 Numeric Options tab, about 339 Open View Window 331 options, turning on and off 329 page width indicator, turning on or off 291 Print Documentation dialog box option 91 restoring default 329 setting 328 Show Grid Lines 334 Show Group Tests in Log 336 Suppressing Blank Detail Lines 304 Test Column Width 334 Time Stamp Commands 336 Verify Data Automatically 95 406 Index View Options tab, about 291, 333 Warn Before Overwriting Files 330 warn before overwriting files 330 Primary file, defined 164 Print Documentation dialog box, about 89 Print files 266 Print files, about 12 Printing about 89 batches 89 Classify command results 145 Command Log 90 log files 82 notes, about 89 print file history with last result preference 341 Projects 89 report history with reports 341 sample parameters 189 views 77 Profile command about 104 automatic execution 331 numeric fields 150 Project notes, about 86 Projects, about 30 PROPER( ) function, about 211 Proportional font, changing 342 Q Quotes, around date fields 124 R Radio Button dialog box, about 367 RAM default setting, and Classify command 143 Record types, about 267 Records definition of 8 filtered, displaying 334 header type 276 multiple-record-types 276 view, displaying 64 Relations command about 173 Removing 67 columns from view 67 Report files automatic filters 274 blank if zero 303 blank lines, suppressing 304 break columns, creating 297 detail fields, defining 271 detail records in 273 duplicates, suppressing 301 filters, header records 269 filters, using 301 header fields, defining 269 header records, using filters 269 line spacing 295 multiple-record-type 266 page breaks, creating 298 page orientation 292 page title, global 335 presorting 296 previewing 294 printing 295 record types, about 267 subtotals, displaying 297 summarizing 299 totals, suppressing 299 Report files, about 266 Reports 290 batch file 295 formatting 290 history, printing 341 sorting 296 Resizing controls in Dialog Builder 373 windows 22 Rounding, preventing unnecessary 14 S Sample command 180, 183 selection methods 183 selection order 191 Sample selection methods, about 183 Sampling oversampling 191 subsampling 191 Save Graph As dialog box 320 Search command about 135 Find Literal option 140 Secondary file, defined 164 Select View Fonts dialog box 66 Separators numeric format 73 Set Safety syntax 331 Shift Fields button 48 Shifting fields 48 Show Grid Lines preference 334 Show Right Edge of Page preference 334 Simple group defined 252 Size command 180, 184, 185 about 184 Sort compare Index 137 multiple fields 133 order, about 333 sequence, verifying 132 single field, ascending order 131 Sort command, about 130 Sorting key fields 296 Spool file, defined 266 Start of Century date, about 337 Start of Century option 55 Starting position field, adjust using OFFSET( ) 264 Static conditional fields, about 274 Statistics command, about 102 Statistics, obtaining descriptive 203 Status bar, about 21 Stratify command graph output option 311 graphing output 311 intervals, specifying 154 Subtotals suppressing 299 Summarize command, about 146 Suppressing blank lines in reports 304 duplicates in reports 301 subtotals in reports 299 totals in reports 299 zeros in reports 303 Suppressing Blank Detail Lines preference 304 System requirements installing ACL for Windows Index 407
Version 7 5 T Tape files, using 13 Test Column Width preference 334 Text box, adding to dialog boxes 364 Text boxes creating 365 Text control, adding to dialog boxes 364 Text file, defined 12 Time Stamp Commands preference 336 Total command, about 99 Totals suppressing in reports 299 Troubleshooting data errors 344 Typical installation option, about 6 U Uppercase converting to lower 211 Use Output File option, about 336 User dialog box 371 Utility, conversion 11 V Variable length files about 265 Variables automatic, in groups 262 in groups, using 262 Verify command, about 94 Verify Data Automatically preference 95 VERIFY( ) function, about 95 Verifying data, about 345 View adding and deleting rows 74 adding computed fields 228 automatic open preference 331 blanks or zeros, invalid data 335 closing 78 columns, defined 64 columns, removing 67 customizing 65 fonts, selecting 66 format, saving 298 global filters, using 234 grid lines, showing 334 invalid data, display as blanks or zeros 347 local filters, using 229 margin, displaying 334 multiline, constructing 74 notes, about 88 records 64 View Options tab, Edit ACL Preferences 291 Views column width changes 334 formatting 290 Overview window contents 58 printing 77 reports, creating 290 W Warn Before Overwriting Files preference 330 Windows buttons, displaying 23 Command Log 79 maximizing 22 minimizing 22 moving 22 resizing 22 scrolling 24 working with 22 Word merge files, using 127 WordPerfect merge files, using 128 Workbook data files, installing 5 Workspaces Overview window contents 58 Z Zeroes invalid data 347 Z-statistic 217 408 Index Global Help Desk The Americas +1-604-669-4997 +1-604-689-4209 @ [email protected] Europe, Middle-East, and Africa +32-2-642-22-90 +32-2-642-22-91 @ [email protected] Asia and Pacific Rim +65-6299-3365 +1-604-689-4209 @ [email protected]
(Premier Reference Source) Zakariya Belkhamza, Zakariya Belkhamza, Syed Azizi Wafa - Measuring Organizational Information Systems Success - New Technologies and Practices (2012, IGI Global) PDF
[Ebooks PDF] download Design for Manufacturability-How to Use Concurrent Engineering to Rapidly Develop Low-Cost, High-Quality Products for Lean Production, Second Edition David M. Anderson (Author) full chapters