Debugging ACL Scripts.

Slides:



Advertisements
Similar presentations
Creating Data Entry Screens in Epi Info
Advertisements

Microsoft Office Illustrated Fundamentals Unit K: Working with Data.
Chapter 11 Describing Process Specifications and Structured Decisions
COMPUTER PROGRAMMING I Essential Standard 5.02 Understand Breakpoint, Watch Window, and Try And Catch to Find Errors.
Why care about debugging? How many of you have written a program that worked perfectly the first time? No one (including me!) writes a program that works.
Chapter 3: Editing and Debugging SAS Programs. Some useful tips of using Program Editor Add line number: In the Command Box, type num, enter. Save SAS.
VA. ACL USER’S GROUP Functions Intermediate to Advanced April 21, 2009 Kimberly M. Taylor, CPA, CISA Chesterfield County, VA.
Describing Process Specifications and Structured Decisions Systems Analysis and Design, 7e Kendall & Kendall 9 © 2008 Pearson Prentice Hall.
Programming Types of Testing.
CHAPTER 1: AN OVERVIEW OF COMPUTERS AND LOGIC. Objectives 2  Understand computer components and operations  Describe the steps involved in the programming.
Concepts of Database Management Sixth Edition
Programming Logic and Design, Third Edition Comprehensive
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Python Programming Chapter 1: The way of the program Saad Bani Mohammad Department of Computer Science Al al-Bayt University 1 st 2011/2012.
XP Chapter 3 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Analyzing Data For Effective Decision Making.
Chapter 9 Describing Process Specifications and Structured Decisions
Tutorial 5 Creating Advanced Queries and Enhancing Table Design
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
Guide To UNIX Using Linux Third Edition
1 Chapter 2 Reviewing Tables and Queries. 2 Chapter Objectives Identify the steps required to develop an Access application Specify the characteristics.
Concepts of Database Management Sixth Edition
Management Information Systems MS Access 2003 By: Mr. Imdadullah Lecturer, Department of M.I.S. College of Business Administration, KSU.
Access Tutorial 3 Maintaining and Querying a Database
Chapter 8: String Manipulation
Chapter Seven Advanced Shell Programming. 2 Lesson A Developing a Fully Featured Program.
Visual Basic Chapter 1 Mr. Wangler.
Computer Literacy BASICS
Solutions Summit 2014 Discrepancy Processing & Resolution Terri Sullivan.
1 Shawlands Academy Higher Computing Software Development Unit.
WEEK 3 AND 4 USING CLIENT-SIDE SCRIPTS TO ENHANCE WEB APPLICATIONS.
PHP meets MySQL.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
Analyzing Data For Effective Decision Making Chapter 3.
1 The Software Development Process  Systems analysis  Systems design  Implementation  Testing  Documentation  Evaluation  Maintenance.
Management Information Systems MS Access MS Access is an application software that facilitates us to create Database Management Systems (DBMS)
System Analysis and Design
Testing and Debugging Version 1.0. All kinds of things can go wrong when you are developing a program. The compiler discovers syntax errors in your code.
Concepts of Database Management Seventh Edition
® Microsoft Office 2010 Access Tutorial 3 Maintaining and Querying a Database.
Concepts of Database Management Seventh Edition
MS Access 2007 Management Information Systems 1. Overview 2  What is MS Access?  Access Terminology  Access Window  Database Window  Create New Database.
1 Κατανεμημένες Διαδικτυακές Εφαρμογές Πολυμέσων Γιάννης Πετράκης.
Page 1 Non-Payroll Cost Transfer Enhancements Last update January 24, 2008 What are the some of the new enhancements of the Non-Payroll Cost Transfer?
Working with the VB IDE. Running a Program u Clicking the”start” tool begins the program u The “break” tool pauses a program in mid-execution u The “end”
Systems Life Cycle. Know the elements of the system that are created Understand the need for thorough testing Be able to describe the different tests.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 8 Debugging, Creating Executable Files, and Distributing a Windows Application.
Pasewark & Pasewark 1 Access Lesson 3 Creating Queries Microsoft Office 2007: Introductory.
1 Chapter 3 Syntax, Errors, and Debugging Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
The Software Development Process
1 Debugging and Syntax Errors in C++. 2 Debugging – a process of finding and fixing bugs (errors or mistakes) in a computer program.
Week 14 Introduction to Computer Science and Object-Oriented Programming COMP 111 George Basham.
Lesson 4.  After a table has been created, you may need to modify it. You can make many changes to a table—or other database object—using its property.
Access Queries Agenda 6/16/14 Review Access Project Part 1, answer questions Discuss queries: Turning data stored in a database into information for decision.
COMP3241 E-Commerce Technologies Richard Henson University of Worcester November 2014.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
The single most important skill for a computer programmer is problem solving Problem solving means the ability to formulate problems, think creatively.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
Querying Databases A query is a program that allows us to VIEW the data or operate on the data Several types of queries –Select query –Merge query –Summary.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5 1 Microsoft Office Access 2003 Tutorial 5 – Enhancing a Table’s Design.
AVCE ICT – Unit 7 - Programming Session 12 - Debugging.
Visual Basic.NET Windows Programming
Objectives Query for top values Create a parameter query
Microsoft Office Illustrated Fundamentals
Intro to PHP & Variables
Designing and Debugging Batch and Interactive COBOL Programs
Creating and Modifying Queries
Microsoft Office Access 2003
Chapter 11 Describing Process Specifications and Structured Decisions
CHAPTER 6 Testing and Debugging.
Presentation transcript:

Debugging ACL Scripts

Basic Debugging Steps If the script failed, check the log. The log will tell you on what command the script failed. If knowing where the script failed is not enough information, then double click on the script. This will give you some information on why it failed. LEFT: The red X indicates that the command EXECUTE FIELDS failed. RIGHT: A brief description of the problem is provided when you double click the X above. Sometimes the information provided is very minimal.

Common problems If the script failed, it is usually due to one of several common problems: 1) Incorrect field types used. Check to make sure that functions are being used with the proper field type. For example: STRING(characterfield,2) SUBSTRING(numericfield,1,2)

Common problems cont 2) Unmatched parenthesis/missing closing string delimiter: Check the number of quotation marks/parenthesis. These errors are common when a () or “” or ‘’ are not balanced: STRING(fieldname, 2 MATCH(fieldname, “value ) ASSIGN variable = ‘value

Common problems cont. 3) STOP ON NUMERIC OVERFLOW: A numeric overflow error generally occurs as a result of one of three reasons: First, if a calculation is divided by ZERO, then a numeric overflow error will occur. Second, ACL will only compute values with a maximum of 22 characters. If the value is larger than 22 characters, it will error out. Third, ACL sometimes has problems with numeric’s with too many decimal places. Ten or more decimal places may cause errors. NOTE: ACL does have a command “SET OVERFLOW on/off. If you set it off, the script will not error out, but will truncate values from the LEFT.

Common problems cont. 4) Crashed due to a PRESORT This error often occurs on a script that otherwise works without a problem, but for some reason ceases working. It is the result of a bug in the system. Sometimes when a script crashes or is aborted, this error appears. The solution is simple, close and restart ACL.

The Script works, but produces the wrong results Most people have experience trouble shooting scripts that error out. Trouble shooting scripts that work, but produce incorrect or incomplete results is much more challenging to figuring out. There are several different techniques that can be used to identify problems when the code works, but produces the wrong results.

Limit Size of File When trying to debug scripts, it is generally better to limit the size of the file that you are working with. You do not need a file with 10,000,000 records when 10,000 would suffice. For this reason, when writing scripts, it is often advisable to perform an extract from data to obtain a sample population.

Step by Step One of the most powerful ways to test a code is to run the code manually on the COMMAND LINE of ACL. This can be time consuming process, but it allows the programmer to validate results at every step. If the command line does not appear on your ACL project select: WINDOWS> Show Command Line

SET FILTER/Quick Filter/ Quick Sort The use of a these commands can be a simple and quick method for evaluating the accuracy of a test or for determining the correct syntax for a piece of code. Using these commands can help the programmer determine if there are records that fit the expected criteria. Once records are identified, the programmer can use those identified cases to add logic to capture them.

Forcing Values Often when running scripts, one will have a variable that is utilized in the execution of the script. This might be a simple count, a computed value, or an item from a list. Often it is beneficial to over-ride this value and force a value into the system to see how it reacts. Does the script produce the same results or have they changed? Is the change appropriate?

Isolating subprocesses Often times the problem with a script centers around one step or one phase. If you can identify this step/phase, you can isolate it to test independently. This has two advantages: First, it enables you to see what happens with the section in question as you make minor tweaks. Second, you can bypass the section in question and see how the rest of the script behaves. This is an opportunity to force values into the script to test the results under a controlled situation.

WORKSPACES Workspaces are a powerful tool when trying to debug a script. It allows one to define a field on one table and then recreate the same field on another table. This allows for quick easy comparing of data/results between tables.

PAUSE Pause is a tool that can be utilized to explore the execution of a script. Using a PAUSE command will allow the programmer to know where the status is on a specific script. This is particularly helpful when exploring DO … WHILE or ERROR TRAP scripts to ensure that there is a working escape.

RELATIONSHIPS Relationships are a simple method to join two tables to determine what might be happening in a script. Creating a relationship can be done through the ACL GUI. Select DATA > RELATE TABLES

Creating a Relationship ACL will then pull up the parent table that is to be used in the relationship. You then select the specific table you want to connect to via the “Add Table” button. Then select the items to be matched via the relationship. Relationships can only be formed on primary key fields (no secondary fields). Note: A parent table can only have 17 related tables (either directly or indirectly.)

Using a related tables Once the relationship is created, one can add fields from the child table to the view. This allows for a quick comparison on how the fields are actually relating to one another. If there are no values, then that is an indication that the fields used in the relationship are not the same.

Using a related tables 2 If the fields are not the same, the first thing one should do is determine why are they different. Using the ACL Wizard to JOIN tables will allow for quick comparison between the table formats: NOTE: The AREA fields have a different length on these tables, thus would have to be edited to get a join/relation to work.

Using related tables 3 Once the relationship is working, you should determine if the script was properly written correctly or does it need to be modified. If the script was written correctly, the related fields can now be used to validate the results being generated. Are the values correct? Do they need to be refined?

REVIEW TEMP FILES The power of using the TEMP01 – TEMPXX convention is that it allows for easy review of the temporary files. The numeric presentation of these tables allows the user to determine which temp file was created first, then second. A quick review of the temporary files might indicate where a logic problem originates.

EXTRACT One of the best ways to determine why a script is producing incorrect results is through the increased use of EXTRACT commands. These extracts allow the programmer to review the data at various stages of execution. Using the FIRST parameter allows you to limit the number of extracts, thus minimizing the impact on the execution.

SET SESSION Allows for the creation of “Sessions” within ACL. These Sessions will tag the LOG with a title that can be used to determine when a new process is being run. This can be used to help identify where in the script errors occur.

SET LOG The use of a SET LOG command is very similar to the SET SESSION command. It is a means to identify the processing of a script at different points. The difference between a SET LOG and a SET SESSION command is that the SET LOG command is more appropriate when using a DO … WHILE combination or when the same script is repeated for different parameters.