The Number 1 independent website for ACL information!

TexasACL User Group
About Us
Training
Why ACL
Essays & Scripts
ACL News
Events
Links
FAQ
Site Map
Support Us
Loading Excel Tables into ACL

question:
I have 24 excel FILES to be imported in ACL through ODBC. One of the problem with these files is that ACL is assigning the field length based on the longest record it finds in the table.  So the record layout (size) will vary for different excel sheet despite these sheets are having same type and same number of fields. Can u please explain how to tackle this issue and import and append these files in ACL to one comprehensive file.

Answer: This is never really easy.  Here are the key points:
1.  Review the Excel files and ensure the first row is the field names and the second row is the data.
2.  Check the column widths - some may be very large because of text (Do you need these columns).
3. Make note of the number of rows (minus 1 for the column titles) and the total of all key numeric fields.
4.  Copy the column titles from the first spreadsheet to an empty speadsheet.  Use this as the column titles for all other spreadsheets (assumes that all spreadsheets have the same columns and that they are in the same order).  This will ensure that all your fields in ACL have the same name.
5.  Use ACL Data Wizard to create table layout for all spreadsheets.
6.  Using one table, build a standard definition for each required field.  This will let you create a standard layout for all imported spreadsheets.  For example, if each spreadsheet has a field called Amount, but they are different lengths.  Create an expression called Amt = 1.00* Amount.  This will always have a length of 12.  Use ACL's print project information to print all table layouts to check for the longest length of each field.  For example, say Name is 25 to 35 long (depending on the spreadsheet).  Create Name1=Substr(Name+blanks(35),1,35) - this will ensure that Name1 is always 35 long.
7.  Create a workspace with all the standard field definitions.
7.  Open each table and activate the workspace
8.  Extract the standardized fields (Amt1, Name1, etc)
9.  Copy the Activate wokspace and Extract command (with Append) to a script and run against the rest of the files.


Note:  If you have columns that contain numeric and alpha data - the ODBC process may cause the alpha data to be a zero (0) if he feild is deamed to be numeric.