Madics

DART

&

 DVerto

              

 

Importing data to use with DART

 

There are a few ways to get data into DART one is via a CSV file directly placed in the DART import folder or if your using Ashell you can use the DART.SBX to can transfer the csv and launch DART, the other method is using the DART DVerto module to extract the data from the Ashell AMOS random data file into a SQL Server database (or MS Access MDB)

 

Ashell data to DART with a manually CSV Import

 

Ashell data to DART using DART.SBX and a CSV file

 

Ashell data to an external database for DART using DVerto

 

 

Ashell data to DART with a manually CSV Import

Possibly the simplest way to import a CSV into DART is manually copying the file in the DART’s CSV processing folder, but first you need to go into DART Settings and enable the CSV to DB Table Import option.

This will also ask if you wish to point DART to the MS Access CSV import Database, the CSV folder and database is normally under Windows XP located at:

C:\Documents and Settings\{username}\My Documents\My DART Saves\DART Application Data\CSV

 

Once selected you will notice a new CSV Import option on the DART main tool bar menu, Clicking this will cause DART to search for any CSV files in folder as stated above, If your unsure of the folder destination or would like to see what files exist just select the Open CSV Folder this also make it easy to copy any CSV files in.

 

DART requires a .DEF file with the same file name prefix as the CSV layout structure, you can find more about this in the section Ashell data to DART using DART.SBX and a CSV file but for the time being DART is able to create a DEF file for you as best it can by selecting the Create DEF option.

 

DART will read the first line of the CSV file an list all the fields in the CSV file, here you are able to change the data type and field lengths, Tick the checkbox at the bottom if the CSV contains a header record, once complete save the DEF file and exit.  You wll now be able to select/tick the CSV file and import data.

 

 

 

Ashell data to DART using DART.SBX and a CSV file

Before you can pass a CSV file to DART you need to tell DART the CSV fields and field types, this is done via DEF file.  The DEF file is in a INI file style format as followings:

[COLx]

NAME={Field Name}

TYPE={String,Date,Numeric,Currency}

SIZE={length if string}

 

So for  example if you have a CSV file containing a Customer Name, Last Order Date and outstanding balance the CSV file will look something like:

FRED and Co Limited,071225,500.32

etc..

and the DEF file will be as follows:

[COL1]

NAME=Customer_Name

TYPE=STRING

SIZE=35

[COL2]

NAME=Last_Order_Date

TYPE=DATE

SIZE=6

[COL3]

NAME=Outstanding_Balance

TYPE=NUMBER

 

The DEF file requres the same file name prefix as the CSV file, so for eaxmple if we have an HISSAL.CSV the DEF file will be called HISSAL.DEF.

 

Once we have the data and field information we use the DART.SBX to view the indormation in DART, the XCALL format is as follows:

 

XCALL DART,{opcode},{rtncde},{Csv File},{method},{value field},{group field},{chart type},{display type},{transfer files},{chart title}

 

                Opcode                  1 – Launch DART and import CSV.

                                                 2 – Check if DART is installed on PC

                                                 3 – Launch DART as if you clicked on the DART Icon.

                Return Code          0 - Failed

                                                 1 – OK

                CSV File                  The CSV File name

                Method                  0-Sum

                                                 1-Count

                Value Field             The value field to show in the chart – Y Axis. Eg. Invoice Value.

                Group Field            The group field in the chart – X Axis, for example Customer Code.

                Chart Type             0 – Pie

                                                 1 – Bar

                                                 2 – Line

                                                 3 – Area

                Display Type          0 – Launch and show chart, then exit.

                                                 1 – Once users finished with the Chart stay in DART

                Transfer Files        0 – DART will copy/FTP file to DART folder

1- Your manually place the files in the correct DART folder.

                Chart Title              The Charts Title.

 

Once the SBX has been called from Ashell DART will launch and import the CSV into a temporary  MDB database for DART to report from.

Recommend looking at the example in the Ashell SOSLIB ppn of [907,40] this includes an example HISSAL.CSV and DEF file, DARTX.BAS.

 

 

 

Ashell data to an external database for DART using DVerto

 

DVerto that come with DART is an application that takes Ashell/AMOS random data files and exports them into an SQL Server or MS Access database (It can if required also then push the data up the web)

 

DVerto uses script and configuration files stored on the Ashell server, this is for easy remote maintenance and multi user systems.

Two files are required for each data file a .LAY and a .DEF (The DEF file is different from the .DEF file used for CSV imports)

 

the .LAY file contains the data files table, description and file location on the Ashell server.  The LAY file contains the file format and fields.

For eample we have a datafile called INTAKE.DAT

 

The INTAKE.DEF file will be something like:

[SETTINGS]

TABLENAME=Order_Intake

DESCR=Sales Order Intake Example

MAPFILE=INTAKE.LAY

DATAFILE=/madics/miame/dsk43/280006/intake.dat

RECORDSIZE=256

 

The following set the records in use count position on the header (first) record the following is the default and gets the in use count from a floating point at byte 9, but a STRING type can also be used.

 

[HEADER]

INUSE TYPE=FLOAT

INUSE BYTE POS=9

INUSE BYTE LENGTH=6

 

If the AMOS random data file does not have the “records in use” as a floating point (F,6) in postion 9 of record 1 then you can also add  HEADER RECORD=NONE in the DEF file under the RECORDSIZE=  this will cause the complete file to be read (as it will not know how many records there are) you many want to use the FILTER in the .LAY file to filter out unused/black/bracket records. (See below)

The .LAY file contains the AMOS file structure. You do not need to include all fields which is useful if you want to exclude sensitive or unimportant fields (costs or Production Factor for example).  The format is as follows:  {Starting Byte Position},{Field name},{field type},{field length},{division value}

The INTAKE.LAY file will be something like:

1,Order_Number,S,6

FILTER,Order_Number,<>,"]]]]]]"         This filters out records with ‘brackets’ if NO HEADER is used.

7,Customer_Code,S,6

3,Order_Or_Credit,S,1

14,Product_Group,S,15

29,Part_Number,S,15

44,Location,S,2

46,Description,S,40

86,Order_Quantity,F,6

92,Net_Value,F,6,100

98,Delivery_Date,D,6

104,Order_Date,D,6

110,Sales_Rep,S,3

113,Record_Type,B,1

114,Customer_Name,S,30

144,Area,S,3

147,Product_Category,S,2

149,Cost,F,6,COSTDIV

155,Manufacturers_Ref,S,25

194,Madics_User,S,6

 

Far more information on the LAY file struture and SQL execution scripts can be found here.

 

Once the DEF and LAY files have been create you need to setup and point DVerto to these files, launch DVerto and under the Madics/Ashell Server enter the Ashell server details and the full Unix (or windows) path to the DEF files.

 

You will also need to set the Local Database in DVerto to a new database in your SQL Server or a MS Access database.

For a more detail example on setting up, configurating and running DVerto goto the example setup to the Madics/Ashell example Data files“ section here.

 

Please ask Madics for a small working example of an INTAKE.DAT, SALMAN.DAT and the LAY & DEF Files, these are normally in the [280,6] ppn.

 

Once the data has been extracted from Ashell and into a SQL or MS Access dataabase you can just point DART to this database and create Charts and Data Views from with in DART.