DatAna - An introduction Preliminaries This text is an introduction to use the program DatAna. DatAna is a program for the PSION Series 3a to analyse data. DatAna reads data, which are produced by the application data (i. e. DBF-files) and generates as result a table (SPR-file). In the easiest case DatAna is a transformation program which transforms DBF-files to SPR-files. More over you may select records, omit some fields and define data types or value parts for single fields. You may count data records, or cumulate numerical data (average, sum, minimum, maximum). There are one- or two- dimensional conversions. The parameters of a conversion can be saved to repeat the conversion after the DBF-file has been updated. To save, print or work on the results of a conversion you may use known functions for SPR-files with the PSION program table. How to use 1. Start the program DatAna - by choosing a conversion file under the program symbol and pressing Enter or - by creating a new conversion file with PSION-n. The conversion files are stored in a directory \D2S\ and have the ending .D2S. In a conversion we save all parameters of a conversion: - the input file, a DBF-file, - the output file, a SPR-file, and - the conversion parameters like the conversion type, data types, record filter, screen preferences etc. 2. Now choose the DBF- and the SPR-file names. 3. With the menu you may adjust the conversion parameters. By default you work with a simple conversion from a DBF- to a SPR-file. - 2 - 4. The desired conversion will be shown in three windows: a) In the first window there are the conversion type and the file names. b) A record filter for the selection of some records is shown in the second window. If the record filter itself should not be printed to the output file, it will be surrounded by brackets. c) The third window shows the structure of the resulting spread sheet i. e. the labels and data types. There are no data! This windows just shows how the resultting SPR-file will be structured. The analysis of the DBF-file will be only be generated to the SPR-file. The windows may be made visible or invisible with the menu "Special:Preferences" (PSION-q). The numbers of character per cell in the structure window may be changed. These preferences have no influence on the resulting SPR-file! 5. Start the conversion with the menu "Actions:Start conversion" (PSION-m). 6. View at the result by using the menu "Actions:View SPR- file" (PSION-p). 7. Leave the SPR-file by pressing PSION-x and return to DatAna. Conversion Types 1. Conversion type list - the simple transformation In the easiest case all records are just transformed from the DBF- to the SPR-file. 2. Conversion type report - the one-dimensional analysis You need a key and a value field for a report. During the conversion all keys, i. e. all contents of the choosen key field, are determined. In the easiest case the number of occurencies are just counted; here you have to use the value "#count". You may choose a numerical field as value; then you need the type of cumulation like average, sum, minimum or maximum. With this conversion for every key the values in the DBF-file are cumulated according to the cumulation type. 3. Conversion type table - the two-dimensional analysis With a table all records of the DBF-file are analysed according to TWO keys. For every occurence of a key pair there will be - 3 - - the count of key pairs - or the cumulation of the choosen type (see conversion type table). Example file DATANA.DBF There are some example data. In the following some sample conversions with DatAna are descriped. Every record of DATANA.DBF describes a person; given is - name, - department, - experience, - age, - salary and - location. The file DATANA.DBF contents 13 records. Questions The following conversions are descriped: 1. conversion of DATANA.DBF into a SPR-file 2. conversion with data types and field parts 3. How many persons with medium or high experience are available in which location? 4. How old in the average are the persons specified for their department and their experience? 5. Which salaries are paid in maximum - specified for department and age group? Tutor1 - conversion of DATANA.DBF into a SPR-file After the start of DatAna from the system screen with PSION-n or within DatAna with the menu "File: New File" specify the conversion file name, the DBF-file name DATANA.DBF (as input or source) and the SPR-file name TEST (as output or result file). The conversion is started with the menu "Actions:Start conversion" (PSION-m). The result file may be viewed with "Actions: Show SPR- file" (Psion-p). - 4 - To leave the SPR-file press PSION-x and return to DatAna. This conversion is available as TUTOR1.D2S. The generated spread sheet should look like: ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄ ÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ ³Name: ³Departme³Experien³Age: ³Salary: ³Location³Fld7 ³Fld8 ³ ³Anton ³D1 ³low ³40 ³5500 ³A-town ³ ³ ³ ³Berta ³D2 ³medium ³38 ³6500 ³C-town ³ ³ ³ ³Caesar ³D3 ³medium ³44 ³6100 ³A-town ³ ³ ³ ³Dora ³D3 ³low ³38 ³5300 ³A-town ³ ³ ³ ³Emil ³D3 ³low ³23 ³4900 ³A-town ³ ³ ³ ³Fritz ³D2 ³medium ³29 ³5900 ³B-town ³ ³ ³ ³Gertrud ³D2 ³low ³29 ³4700 ³A-town ³ ³ ³ ³Heinrich³D2 ³high ³39 ³7678 ³C-town ³ ³ ³ ³Ida ³D2 ³high ³44 ³7700 ³B-town ³ ³ ³ ³Julia ³D1 ³medium ³38 ³6900 ³A-town ³ ³ ³ ³Karl ³D1 ³medium ³35 ³6700 ³B-town ³ ³ ³ ³Ludwig ³D3 ³high ³61 ³7400 ³C-town ³ ³ ³ ³Norbert ³D1 ³high ³39 ³7210 ³C-town ³ ³ ³ ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄ ÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ Tutor2 - conversion with data types and field parts For this conversion there should only be taken the fields: name, the first letter of experience, age and salary. The last two fields should be numerical (integer and float). You have to define the right data types with "Layout:data types" (PSION-t): Name: String Department: Omit Experience: String Age: Integer Salary: Float Location: Omit - 5 - (omit all following fields) With "Layout:field parts" (PSION-f) you can define that you only want the first letter of experience. Press n to get the specification for experience and choose only the first letter: Experience:- FROM 1 Experience:-LENGTH 1 With "Layout:Conversion type" (PSION-a) you may define that the resulting data may be put as columns into the SPR-file. The eleven five columns of the result should look like: ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄ ÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄ ³Name: ³Anton ³Berta ³Caesar ³Dora ³Emil ³Fritz ³Gertrud ³Heinrich³Ida ³Julia ³Experien³low ³medium ³medium ³low ³low ³medium ³low ³high ³high ³mediu ³Age: ³ 40³ 38³ 44³ 38³ 23³ 29³ 29³ 39³ 44³ ³Salary: ³ 5500³ 6500³ 6100³ 5300³ 4900³ 5900³ 4700³ 7678³ 7700³ 6 ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄ ÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄ Tutor3 - How many persons with medium or high experience are available in which location? With the menu "Layout:Conversion type" (PSION-a) choose the conversion type "report". As key for the counting you need the location and as value define #count. We only want to count persons who have medium or high experience. Define with "Layout:Record filter" (PSION-r) a record filter. Formulate the first comparison: label name: Experience comparison operator: = comparison operand: medium After pressing Enter press the arrow down key to bring the cursor into a blank line and define: conjunction: or label name: Experience comparison operator: = comparison operand: high - 6 - Leave the dialog with ESC. You defined a record filter: Experience: = "medium" or Experience:="high" The record filter may printed into the SPR-file with "Layout:Conversion type" (PSION-a) into the SPR-file. The result should be: ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ ³ Experience: =...³ ³ ³ ³ ³Location³Count ³ ³C-town ³ 4³ ³A-town ³ 2³ ³B-town ³ 3³ ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ Tutor4 - How old in the average are the persons specified for their department and their experience? First, define the data type of age as integer because we shall cumulate over age. For this kind of conversion we need a two-dimensional conversion i. e. a table as conversion type. The keys are department and experience. The value is the field age together with the cumulation type average. The SPR-file shows: ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ ³avg(Age:³Department: ³ ³ ³ ³Experience: ³low ³medium ³high ³ ³ ³D1 ³ 40³ 36,5³ 39³ ³ ³D2 ³ 29³ 33,5³ 41,5³ ³ ³D3 ³ 30,5³ 44³ 61³ ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ Tutor5 - Which salaries are paid in maximum - specified for department and age group? The data type of salary should be decimal. For the field age you need a field part Age:-FROM 1 Age:-LENGTH 1 By this setting we consider only the century of age of the persons. - 7 - The conversion in this case is a table with the keys department and age. Choose salary as value and the cumulation type maximum which results in ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄ¿ ³max(Sala³Department: ³ ³ ³ ³ ³Age: ³ ³4 ³3 ³2 ³6 ³ ³ ³D1 ³ 5500³ 7210³ 0³ 0³ ³ ³D2 ³ 7700³ 7678³ 5900³ 0³ ³ ³D3 ³ 6100³ 5300³ 4900³ 7400³ ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÙ