© Matti Mattila, CPFA, CISA, CIA

Running SEM3

Previous Item Next item Previous menu
1. Preparing 'IsFile'
SEM3 searches matches of strings in one IDEA file ('IsFile') in another IDEA file ('InFile'). The first step is to make an 'IsFile', if you don't have one, and import it to IDEA. You can make the file e.g. in MS Excel.
- An example of 'IsFile' ('SearchThese') [in picture 1] has only two columns. Both of them are character in type; the macro accepts only fields of that type. Column headings are on the first row. In 'Object' column there are the strings that we want to find in another file. In 'Code' column there are the strings that we want to join with the records where 'Object' is found.
Picture 1
Picture 2
Picture 3
Picture 4
Picture 5
Picture 6
- Next, import ('File' - 'Import Assistant' - 'Import to IDEA' - 'Microsoft Excel') 'IsFile' to the IDEA directory containing the file(s) that you want to search matches for.
2. Running the macro
Running the macro takes place in the following steps.
- When running 'SM3' (demo) be sure to have it and 'sm3.txt' in the same directory (folder).
- 'SM3'is a compiled macro User runs it from: 'Tools' - 'Macros' - 'Run..', selects file type '.ise', and 'SM3.ise' (picture 2).
- 'SM3' tries to find 'sm3.txt'. If 'sm3.txt' is not found the following message is displayd: "No original sm3.txt file was found. Execution will be terminated."
- If 'sm3.txt' is found its contents is shown to the user [1] (picture 3).
- Next, user is asked to select the 'IsFile'. He/she selects it. Here 'SearchThese-Taul1' is selected. It contains only three records (see the picture 3a).
Picture 3a
- User selects the field containing strings to be searched ('IsField'); here 'Object' (picture 4).
- If user selects here 'Characters to Upper case' search both is done based on upper case letters not only in 'IsFile' but also in 'InFile'. User can make this selection later, too.
- User can select another field in 'IsFile', too; here 'Code' (picture 4). If user does not want to select another field he/she should select here 'IsField'.
- If user does not want to select another field he/she should select here 'IsField' once again. In that case 'SEM3' ignores the second selection of 'IsField', and it writes only once the contents of the selected field in the resulting csv file.
- User is told to select the 'InFile'. He/she proceeds by clicking 'Select an IDEA file ('InFile')' (picture 5), and FileExplorer starts. In the case here a file 'G98' is selected.
- One should be aware that number of records in 'InFile' and 'IsFile' effects the processing time. In some cases processing time can be reduced significantly [2].
- Finally, user is told to select an 'InFile' field, where matches are searched for. Here matches are searched in the field 'SELITE' ('description' in English) (picture 6).
- If user selects here 'Characters to Upper case' search both is done based on upper case letters not only in 'IsFile' but also in 'InFile'. If user has selected this option ealier, selecting it again is not necessary (but it can be done).
- The macro starts running: on the right bottom of the screen there is a message 'IDEA Script is running' (picture 7)
- During the run screen becomes empty (white), and it flashes. It's normal and harmless. Just wait patiently until the macro ends.
- As told in the footnote [2] running time depends on record numbers of 'IsFile' and 'InFile'.
- Finally, user is informed about the number of matches found, and about the csv file containing the results.
- The results - here: 'SELITE.csv' - are in the same directory (folder) as the 'InFile'.
Picture 7
Picture 8


[1] In "Please Note!" you are told restrictions concerning 'SEM3' demo version (='SM3'): search is limited up to 500 'InFile' records and 5 'IsFile' records.
[2] Running time dependency is in accordance with an equation: Records in 'IsFile' * Records in 'InFile'. In order to minimize running time 'IsFile' is summarized in terms on'IsField' (result: '_Sm3IsFile.IMD'). In some cases, to shorten the running time, it might make sense to summarize 'InFile' in terms of 'InField', too.