Create some dictionary items. Rush Flat Consulting OpenQM
Reklama
Reklama
Accounts, Files and Editors
Page 43
In row 5 (currently blank), add the following identifiers to identify each of the currencies.
These are actually there official currency identifiers as specified by ISO 4217 (see: http://en.wikipedia.org/wiki/ISO_4217 ):
United States dollar
UK Pound sterling
Australian dollar
Japanese yen
European Euro
Canadian dollar
South Korean Won
Chinese renminbi
Malaysian ringgit
Hong Kong dollar
Indonesian rupiah
Thai baht
Singapore dollar
New Taiwan dollar
USD
GBP
AUD
JPY
EUR
CAD
KRW
CNY
MYR
HKD
IDR
THB
SGD
TWD
Now, delete rows 1 to 4. This will leave the header row as the first row in the spreadsheet.
Cell A1 is now blank. Put a heading name of
DATE
in this cell.
Go right to the bottom of this spreadsheet and delete the comment rows there.
Now save the spreadsheet as a CSV file. Choose ‘File | Save as’ from the menu, select a file type of
daily.csv’.
, and save with the original base file name. This should save the file as ‘hb1-
Create some dictionary items
As noted above, dictionary items describe the data contained in the data file. The point of creating dictionary items now is that the file import routines used by AccuTerm can use these dictionary items to correctly format the data as it is imported.
We want to create a dictionary item for each of the exchange rates in the file. To do this, we are going to use the MODIFY editor within OpenQM:
MODIFY DICT XRATES
The editor will respond: Id (? for list):
Type in:
DATE
A list of fields will now be displayed:
Id (? for list): DATE
1: TYPE/DESC=
2: LOC =
3: CONV =
4: NAME =
5: FORMAT =
6: S/M =
7: ASSOC =
And a prompt will appear at the bottom of the screen:
TYPE/DESC:
This is asking what type of dictionary item are we going to create. Answer: D
The prompt changes to
LOC
This is the field number. Answer:
15 Alternatively, you could save this as a TAB delimited file. Make sure you know which delimiter you are using as we will need to specify that at the file import stage.
16 A field number of zero indicates we are referring to the item-id.
© Rush Flat Consulting Getting Started in OpenQM - Part 1
Page 44
Accounts, Files and Editors
The remaining prompts and answers are:
CONV
NAME
FORMAT
S/M
ASSOC
D
Date
11R
S
Just press enter at the
ASSOC
prompt to leave it blank. The following prompt will now appear:
Action(n/FI/Q/?):
If everything is correct, type FI to file the item. Otherwise, enter the line number of the entry you would like to correct. Once the item is correct, enter
FI
to file it.
Now create the following dictionary items:
CNY
MYR
HKD
IDR
THB
SGD
TWD
ID
USD
GBP
AUD
JPY
EUR
CAD
KRW
D
D
D
D
D
D
D
D
D
D
D
D
Type Loc
D
D
1
2
12
13
14
8
9
10
11
5
6
3
4
7
Conv
MR44,
MR44,
MR44,
MR22,
MR44,
MR44,
MR22,
MR44,
MR44,
MR44,
MR22,
MR44,
MR44,
MR44,
Name
US Dollar
UK Pound
Aus Dollar
Jap Yen
Euro
Canada Dollar
SKorea Won
Format
7R
7R
Chinese Yuan
Malay Ringgit
7R
7R
HK Dollar 7R
Indonesia Rupiah 9R
7R
7R
7R
7R
7R
S/M
S
S
S
S
S
S
S
S
S
S
S
Thai Baht 8R
Singapore Dollar 7R
Taiwan Dollar 7R
S
S
S
Assoc
To exit the editor, simply press enter when it prompts you for a new
ID
. Now to see your completed dictionary items, type:
SORT DICT XRATES
@ID......... TYPE LOC........... CONV.. NAME........ FORMAT S/M ASSOC...
DATE D 0 D Date 11R S
@ID D 0 XRATES 10L S
USD D 1 MR44, US Dollar 7R S
GBP D 2 MR44, UK Pound 7R S
AUD D 3 MR44, Aus Dollar 7R S
JPY D 4 MR22, Jap Yen 7R S
EUR D 5 MR44, Euro 7R S
CAD D 6 MR44, Canada Dolla 7R S
r
KRW D 7 MR22, SKorea Won 7R S
CNY D 8 MR44, Chinese Yuan 7R S
MYR D 9 MR44, Malay Ringgi 7R S
t
HKD D 10 MR44, HK Dollar 7R S
IDR D 11 MR22, Indonesia Ru 9R S
piah
THB D 12 MR44, Thai Baht 8R S
SGD D 13 MR44, Singapore Do 7R S
llar
TWD D 14 MR44, Taiwan Dolla 7R S
r
16 record(s) listed
Note that some of the descriptions have wrapped within their display field.
You probably understand that we have just created a set of descriptions of the data we are going to store in the database – something like an SQL schema – but it won’t be totally clear what the elements of the definitions mean.
The ‘D’ in the first field indicates that this is a
‘D-type’
(direct) dictionary item. A
‘D-type’ item describes the date in the file.
Getting Started in OpenQM - Part 1 © Rush Flat Consulting
Pobierz
Reklama