PMA Tutorial : Loading Sample Data
Overview
All sample PMA Tutorials are based on the data described in this section. Several sample data files have been supplied in addition to sample Vision code which can be executed to read these files and create the database.
By default, all files referenced are in the directory /localvision/samples/pma/. Check with your Vision Administrator if you do not see the following files in the directory:
File Name | Function | Reference |
Currency.pma | Tab-delimited file containing currency identifiers and names. | CurrencyMaster |
Country.pma | Tab-delimited file containing country identifiers and names and a currency identifier. | CountryMaster |
Sector.pma | Tab-delimited file containing sector identifiers and names. | SectorMaster |
Industry.pma | Tab-delimited file containing industry identifiers and names and a sector identifier. | IndustryMaster |
Company.pma | Tab-delimited file containing basic company information: id, name, country, industry id, and fiscalYearEnd. | CountryMaster |
SecType.pma | Tab-delimited file containing basic SecurityType information: id, name, unitcalc, assetcategory | SecurityTypeMaster |
Security.pma | Tab-delimited file containing security information: id, name, currency, cusip, ticker, companyId, security type, and latestMarketCapUS. | SecurityMaster |
Portfolio.pma | Tab-delimited file containing additional portfolio information: id, name | SecurityMaster |
Price.pma | Tab-delimited file containing price information for different time points. | PriceFeed |
Holdings.pma | Tab-delimited file containing holdings information for portfolios over time. | HoldingsFeed |
sample.pma | File containing Vision code that loads the .pma files. |
You can read the sample.load file into your favorite Vision Editor or you can execute the code in this file using the asFileContents evaluate expression:
"/localvision/samples/pma/sample.load" asFileContents evaluate ;
Note: The sample.load file runs by default on a Unix environment. If you are using a Windows NT platform, this location may be prefixed by a drive and optional path (e.g., d:/visiondb/localvision/samples/pma/sample.load). In additition, the sample.load file must be edited by your Vision Administrator to reflect the correct locations.
Loading Currency Data
The file Currency.pma contains one line per currency. Each line contains a currency identifier and a currency name. The first few lines of this file are displayed below:
id name ADP Andorran Peseta AED UAE Dirham ...
CurrencyMaster is the name of the feed that is used to create and refresh basic information for Currency instances.
To manually load the file, execute the following:
Interface ExternalFeedManager upload:"CurrencyMaster" usingFile: "/localvision/samples/pma/Currency.pma";
The output buffer will display the total number of currencies loaded.
Loading Country Data
The file Country.pma contains one line per country. Each line contains a country identifier and a country name. The first few lines of this file are displayed below:
id name currency AD Andorra ADP AE United Arab Emirates AED ...
CountryMaster is the name of the feed that is used to create and refresh basic information for Country instances.
To manually load the file, execute the following:
Interface ExternalFeedManager upload:"CountryMaster" usingFile: "/localvision/samples/pma/Country.pma";
The output buffer will display the total number of countries loaded.
Loading Sector Data
The file Sector.pma contains one line per sector. Each line contains a sector identifier and a sector name. The first few lines of this file are displayed below:
id name NONDUR Non-durables DUR Durables ...
SectorMaster is the name of the feed that is used to create and refresh basic information for Sector instances.
To manually load the file, execute the following:
Interface ExternalFeedManager upload:"SectorMaster" usingFile: "/localvision/samples/pma/Sector.pma";
The output buffer will display the total number of sectors loaded.
Loading Industry Data
The file Industry.pma contains one line per industry. Each line contains an industry identifier, industry name, and a sector identifier.The first few lines of this file are displayed below:
id name sector 110 Beverages NOND 120 Cosmetics NOND ...IndustryMaster is the name of the feed that is used to create and refresh basic information for Industry instances.
To manually load the file, execute the following:
Interface ExternalFeedManager upload:"IndustryMaster" usingFile: "/localvision/samples/pma/Industry.pma";
The output buffer will display the total number of industries loaded.
Loading Company Data
The file Company.pma contains one line per company. Each line contains a company identifier, company name, country identifier, identifier, industry identifier, and a fiscalYearEnd date. The first few lines of this file are displayed below:
id name Country Currency Industry fiscalYearEnd 02364J10 AMERICA ONLINE INC US USD 390 6 37044210 GENERAL MOTORS CORP US USD 210 12 45920010 INTL BUSINESS MACHINES CORP US USD 530 12 ...CompanyMaster is the name of the feed that is used to create and refresh basic information for Company instances.
To manually load the file, execute the following:
Interface ExternalFeedManager upload:"CompanyMaster" usingFile: "/localvision/samples/pma/Company.pma";
The output buffer will display the total number of companies loaded.
Loading SecurityType Data
The file SecType.pma contains one line per security type. Each line contains a security type identifier, security type name, UnitCalc, and an AssetCategory. The first few lines of this file are displayed below:
id name unitcalc assetcategory 0 Cash & Equiv 1.00 Cash 1 Common Stock 1.00 Equity 2 Preferred Stock 1.00 Equity ...
SecutityTypeMaster is the name of the feed that is used to create and refresh basic information for SecurityType instances.
To manually load the file, execute the following:
Interface ExternalFeedManager upload:"SecurityTypeMaster" usingFile: "/localvision/samples/pma/SecType.pma";
The output buffer will display the total number of security types loaded.
Loading Security Data
The file Security.pma contains one line per security. Each line contains a security identifier, security name, currency identifier, cusip, ticker, company identifier, security type identifier, and latestMarketCapUS. The first few lines of this file are displayed below:
id name currency cusip ticker companyId type latestMarketCapUS 02364J10 AMERICA ONLINE INC DEL COM USD 02364J10 AOL 02364J10 1 4792900.00 37044210 GENERAL MTRS CORP COM USD 37044210 GM 37044210 1 42734805.00 45920010 INTERNATIONAL BUSINESS MACH COM USD 45920010 IBM 45920010 1 88261698.75 ...SecurityMaster is the name of the feed that is used to create and refresh basic information for Security instances.
To manually load the file, execute the following:
Interface ExternalFeedManager upload:"SecurityMaster" usingFile: "/localvision/samples/pma/Security.pma";
The output buffer will display the total number of securities loaded.
Loading Portfolio Data
The file Portfolio.pma contains one line per portfolio. Each line contains a portfolio identifier and a portfolio name. The first few lines of this file are displayed below:
id name 102 INSYTE GROWTH FUND 232 INSYTE INCOME FUND 332 INSYTE GROWTH & INCOME FUND ...PortfolioMaster is the name of the feed that is used to create and refresh basic information for Portfolio instances.
To manually load the file, execute the following:
Interface ExternalFeedManager upload:"PortfolioMaster" usingFile: "/localvision/samples/pma/Portfolio.pma";
The output buffer will display the total number of portfolios loaded.
Loading Price Data
The file Price.pma contains multiple dates per security. Each line represents a specific security identifier, date, currency identifier, adjustmentDate closing, price, and volume. The first few lines of this file are displayed below:
id date currency adjustmentDate close volume 02364J10 11/06/1997 USD 12/18/1997 79.38 2.55 02364J10 11/07/1997 USD 12/18/1997 79.25 4.85 02364J10 11/10/1997 USD 12/18/1997 76.06 1.75 ...PriceFeed is the name of the feed that is used to create and refresh basic information for security prices.
To manually load the file, execute the following:
Interface ExternalFeedManager upload:"PriceFeed" usingFile: "/localvision/samples/pma/Price.pma";
The output buffer will display the total number of prices loaded.
Loading Holdings Data
The file Holdings.pma contains a line for each security held in a portfolio on a date. Multiple dates of holdings for a portfolio are involved. Each line contains a date, an account identifier, and security identifier. The first few lines of this file are displayed below:
date acctId secId shares mval 19971215 102 37044210 7800 497741.40 19971215 102 00949T10 15200 589000.00 19971215 102 02364J10 8200 695975.00 ...HoldingsFeed is the name of the feed that is used to create and refresh basic information for Account holdings.
To manually load the file, execute the following:
Interface ExternalFeedManager upload:"HoldingsFeed" usingFile: "/localvision/samples/pma/Holdings.pma";
The output buffer will display the total number of holdings loaded.