Loading Additional TAQ Sample Data

Running the queries against the sample data loaded during installation returns limited results, so you may want to load a larger set of data into the RAPStore database.

Prerequisites

Install Sybase IQ client tools.

The files STOCK_QUOTE.csv, STOCK_TRADE.csv, and STOCK_HISTORY.csv contain a subset of the data in the STOCK_QUOTE.zip, STOCK_TRADE.zip, and STOCK_HISTORY.zip files. To preserve the smaller STOCK_QUOTE.csv, STOCK_TRADE.csv, and STOCK_HISTORY.csv files, rename these files before you extract the zipped versions of the files.

Warning!  If you load the larger sample data set into RAP, the TAQ data already in RAPStore and the STOCK_HISTORY table will be lost. To preserve the small sample data set, you must perform an additional procedure.

Task
  1. Extract the files STOCK_QUOTE.zip, STOCK_TRADE.zip, and STOCK_HISTORY.zip into $RAP/Samples/data/marketdata/databaseformat.
  2. On the machine that hosts the Sybase IQ database, change to $RAP/RAPStore/IQ-15_2.
  3. Source the environment variables source IQ-15_2.csh or . ./IQ-15_2.sh.
  4. Change to $RAP/RAPStore/datamodel/scripts.
  5. Edit the file load_unix_IQ_TAQ_tables.tst to specify the location of the unzipped STOCK_QUOTE.csv and STOCK_TRADE.csv files in the $RAP/Samples/data/marketdata/databaseformat directory.
  6. Use Interactive SQL (dbisql) to log in to the RAPStore database.
  7. (Optional) Load the larger set of sample data into the STOCK_HISTORY table by editing the file load_unix_IQ_TAQ_tables.tst before you run load_unix_IQ_TAQ_tables.sh.
    Append the following lines, replacing <RAP_installation_directory> with the path name of your RAP installation directory:
    truncate table DBA.STOCK_HISTORY;
    commit;
    load table DBA.STOCK_HISTORY
    (
    INSTRUMENT_ID    null (blanks,'NULL') ,
    TRADE_DATE    null (blanks,'NULL') ,
    TRADING_SYMBOL null (blanks,'NULL') ,
    OPEN_PRICE    null (blanks,'NULL') ,
    CLOSE_PRICE    null (blanks,'NULL') ,
    LOW_PRICE    null (blanks,'NULL') ,
    HIGH_PRICE    null (blanks,'NULL') ,
    VOLUME        '\x0a'
    )
    from '<RAP_installation_directory>/Samples/data/
    marketdata/databaseformat/STOCK_HISTORY.csv'
    quotes off
    escapes off
    preview on;
    commit;
    Note:

    If you do not load the STOCK_HISTORY table with this additional sample data, some of the historical market data sample queries return no results.

  8. Run the load_unix_IQ_TAQ_tables.sh script.

    This script truncates existing data and loads the larger set of TAQ sample data into the RAPStore database.

Next

Check the status of the sample data load by reviewing the log file for the Sybase IQ RAPStore database, database_name.iqmsg. The default location of the log file is the directory where the RAPStore database file ( database_name.db) is located.

Related concepts
TAQ Data Queries