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 

To run the script that loads the larger set of TAQ sample data into RAPStore, you must have Sybase IQ 15.1 client tools installed on your system.

The installed 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 unzipping the STOCK_QUOTE.zip, STOCK_TRADE.zip, and STOCK_HISTORY.zip 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.

To load the larger set of sample data into the RAPStore:

  1. Unzip the files STOCK_QUOTE.zip, STOCK_TRADE.zip, and STOCK_HISTORY.zip in the $RAP/Samples/data/marketdata/databaseformat directory.
  2. On the machine that hosts the Sybase IQ database, change directories to $RAP/RAPStore/IQ-15_1.
  3. Source the environment variables source IQ-15_1.csh or . ./IQ-15_1.sh.
  4. Change directories 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. Log in to the RAPStore database using Interactive SQL (dbisql).
  7. (Optional) Load the larger set of sample data into the STOCK_HISTORY table by editing the 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.


Created October 8, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com