AFS Ticket Importer


The Ticket Importer reads in an ASCII file of tickets and saves them  to the afstrade database.  (See Release Notes for canceling a trade using the Ticket Importer.) Tickets saved by this tool may extend or realize against existing positions.  All calculations of commission amount, principal and net amount are performed (see Release Notes for calculation information).  This application requires 1) the afstrade.ini file to determine which database to save the tickets and 2) the afscalc.dll file to perform ticket calculations.

After double clicking on the AFS_Ticket_Importer, the following form is displayed:

wpe1.gif (10737 bytes)

To process a file of tickets, click on the Browse... button and select the file to process.  The file is read and the Total number of items is displayed.  Click on the Process button and the tickets in the file are saved to the afs:TRADE database.  Once started, you can click on the Cancel button to stop processing, but the process will not actually be stopped until after the current ticket is saved.  After you process a set of tickets, you may click Browse... again to select another file.  If you want to re-process the current file, and that file has changed, you need to select it through the Browse... button again.

While processing, status messages, indicating inserted tickets, canceled tickets, and errors, are displayed in the scrolling text area.  These messages are also stored in a log file in c:\temp or in the directory pointed to by the LogFileDirectory item in the [Afstrade] section of afstrade.ini.   The name of the log file is of the form SFMTicket_Importer_yymmdd_hhmmss.log.   A corresponding .txt file is also created containing just the lines that failed, so one could edit this file and then reprocess it as is.

Tickets created with the importer have the following defaults:

  • Stage = Completed
  • Last Update, Operator and Approval IDs are the ID of the sybase user who runs the importer.
  • Last Update, Operator and Approval Date/Times are the Date/Time that the ticket was created by the importer.
  • Comment = "Generated by Ticket Importer"

In addition to the standard AFS command line parameters, the following are valid command line parameters

mode if value is run, importer will be run in batch mode.  The USER NAME, PASSWORD, and file parameters must be included if mode=run.
file file, including path, to import

See also:

Release Notes

v2001.7.31

  • Line 2, the list of column names, can include should_update, to indicate if the record referenced by a row should be updated.  The Ticket importer uses the value in the reference_id or primary_ticket_number column to find which record to update.  If no record is found with a matching value, or if a matching ticket is found, but already canceled, an exception is raised.  If is_update and is_delete are both set to 1, an exception is raised.  If an update is performed, every value should be provided, regardless of whether the value was updated.

v2001.7.31

  • If product on ticket has a restriction that requires approval, set stage on ticket to Requires Legal Approval
  • Fix problem where importer was deleting zero positions when the importer was run via the command line.
  • If other party code does not exist in database, message now reads "Contraparty invalid" (was "Broker invalid")

v2001.7.5

  • Make sure all previous values on a ticket are cleared before next ticket is created.
  • Fix average_cost and closed_fund calculations when realizing a trade for a product with a principal_scalar <> 1.

v2001.05.31

  • Fix problem where last character in data row was a comma.  Was skipping record and displaying error "Incorrect Number of Fields, or Blank Data Record."

v2001.04.30

  • A new column, reference_id, has been added to the ticket tables.  This column is used to assign an external ticket identifier to an AFS ticket.  This can be used by the ticket importer in later runs, e.g. to cancel the ticket.
  • A new column, should_recalc, indicates whether afstrade should recalculate ticket values like principal, accrued interest, and net amount.  No recalculation is performed unless should_recalc = 1.
  • Line 2, the list of column names, can include should_delete, to indicate if the record referenced by a row should be deleted/canceled.  The ticket is canceled if should_delete = 1.  The Ticket importer uses the value in the reference_id or primary_ticket_number column to find which record to delete/cancel.  If no record is found with a matching value, or if a matching ticket is found, but already canceled, an exception is raised.

v2001

  • The latest version of the Ticket Importer is built using shared libraries.  Before running this version, you need to install a set of shared .bpl files in the same directory as the importer.

Last Updated: 05/24/04