Dec 142017
 
Convert Prodigy stock Quotes from text to a form inputable to a spreadsheet.
File CPQ103.ZIP from The Programmer’s Corner in
Category Databases and related files
Convert Prodigy stock Quotes from text to a form inputable to a spreadsheet.
File Name File Size Zip Size Zip Type
CPQ.DOC 3936 1612 deflated
CPQ.EXE 11847 7173 deflated

Download File CPQ103.ZIP Here

Contents of the CPQ.DOC file


Converts Prodigy(sm) quotes to a form importable into a spread sheet


USAGE: CPQ

CPQ will prompt for an input filename and an output filename. The
input filename is required. The output filename is optional. Output
will go to STDOUT if no output filename is given.

USAGE: CPQ infile

CPQ takes its input from infile and sends its output to STDOUT.
Program messages are output on STDERR.

USAGE: CPQ infile outfile

CPQ takes its input from infile and sends its output to outfile.
Program messages are output on STDERR.

Infile and outfile are path and file names for the input and output files.


CPQ converts text that contains date or dates and stock quotes in the
input format to the output format. Input can include multiple Quote
Files concatenated.

Quote line input format:

Symbol Price Change Price Price Price Volume

Symbol = Upper Case Alpha 1 to 7 Characters
Price = An Integer, a fraction, or an Integer and a Fraction
Change = Sign (+ or -) and an Integer, or a Fraction, or an Integer and
a Fraction
Volume = Integer

Fractions from halves to thirtyseconds are converted and must be less
than one.

Input fields must be seperated by spaces - multiple spaces between
fields - one space between the Integer and Fraction in a pair
such as 100 1/2.

Output format:

Date,Symbol,Price,Change,Price,Price,Price,Volume

Date format is MM/DD/YY
Symbols is as input
Prices are converted from Integer + Fraction or Fraction to Decimal
Volume is as input

The program reads each line of text classifying each line as QUOTE,
DATE, or OTHER based on contents.

When a non QUOTE line containing a date is encountered the program sets
the date for following QUOTE lines to the date found.

The input date in the form MM/DD/YYYY is converted to MM/DD/YY. This
allows easy conversion of the text date to a number for manipulation
in a spread sheet.

Each QUOTE line is read, converted, and output in turn.

Exceptions:

In the case of a quote on a stock that did not trade the output is:

Date,Symbol,Price,"","","","",MM/DD

MM/DD is the month and day of last trade.


In the case of stocks with only a BID and ASKED price quoted.

Date,Symbol,"",Price,Price

To the User:

You are free to use this program as you wish and to distribute freely as you
like as long as you include this documentation file with it.

I have tested the program thoroughly and know of no errors, if you
find any please let me know so I can fix them. Of course you use this
program at your own risk.

I wrote this program convert a specific format of text and plan to
enhance it over time to a more general form accepting command line
options to make input format and output selectable. If you have any
suggestions let me know.


I can be contacted at:

Steven Chandler Prodigy ID TTJS86A
Compuserve 71067,743
PC PURSUIT Net Exchange

Revision History:


1.03 8/09/89
Eliminated input redirection. Enabled command line input
of filenames for input and output.
Corrected problem with No Trade, Bid/Asked quotes < $1.00.
Enabled CPQ to read past unintended EOF characters.

1.02 8/02/89
Enabled handling of quotes on stocks with * in quote line.

1.01 7/31/89
Extended fraction conversion capability to include 32nds.

Enabled handling of quotes on stocks not traded on the day.

Enabled handling of quotes on stocks with only bid and asked
prices quoted.

Added Prompt for Input and Output file names in cases where
input is not redirected.


Prodigy is a service mark and registered trade mark of Prodigy
Services Company, a partnership of IBM and Sears.


 December 14, 2017  Add comments

Leave a Reply