ipicvd (Sat Oct 25 2014 01:31:01)

ipicvd

This program connects to the TGT server, Logons on, tells the server which
Magazines text files to send when they arrive (called adding Magazines to the
Watchlist) and does the occasional dump of all or certain fields of particular
exchanges (called Snapshotting Financial Instruments).

Note from from version 6 (ie GlobalTopic) these are called SOURCES not
exchanges/

Incoming files are dumped into spool/2brouted for 'iproute' to decide where to
send and process. Generally Magazine text file are sent to the editorial box
while financial data is reprocessed and stuffed in a database.

For a list of magazines available plus details of fields, exchanges etc, please
refer to the TGT documentation. That is a polite way of saying you need the
book!


ipicvd will run timed snapshots for any data (that is permissioned of course).
These are setup in the parameter file.


It will also allow manual snapshots - either by short form if specified in the
parameter file - or adhoc using a certain fiphdrs :
	CB - snapshot this blob
	CL - snapshot this fininst using the restricted list
	CM - snapshot this fininst short form
	CF - snapshot this finist for all fields
	CH - snapshot history for this finist
also
	CN - used for name of the snapshot if timed or manual

touch /fip/spool/tgtsnap/#SN:okboys#CB:701~KQ
touch /fip/spool/tgtsnap/#SN:okboys#CF:FOREXINDEX

touch /fip/spool/tgtsnap/#SN:okboys#CF:GOOG.NQ
touch /fip/spool/tgtsnap/#SN:okboys#CF:BA.N

OR a fiphdr in a file
For multiple symbols (tgt6 allows up to 20), separate with a one and ONLY one
space.
(Note that gt6 is not over effusive with error details, so a single error will
result in all being rejected - use trial and error to find which synbol is
wrongly specified
~
CF:=UKX.FT =DJIA.CT =INX.CM Z/F.LI* =HSI.HK =IEQP.EI =DAX.XE =PX1.P =SMI.Z
=SPMIB.MI
~



It uses a parameter file, tables/setup/TGT, to describe which Magazines to
watch for and when to run timed snapshots :
Syntax are :
	; comment line
	mag:(number)	(name)
	snap:(name)	time:(time) symbol:(symbol/query) dest:(dest) [allfields:]
	manual:(name)	symbol:(symbol/query) [allfields:]
	logon:(logonname)
	password:(logonname)

For MAGs, the number (decimal) is that defined by TGT. The name should start
with 3 uppercase chrs which are unique to describe the service. eg:
Pre Version 6 - use the Mag Number, after - use the actual name
	mag:^AFX	AFX News
	mag:^RNA	RNS

Snapshots of Financial Instruments are either Manual (hopefully valid) times.
	name is used for manuals only; for snaps it is for your use.
	time is 4 digit, 24 hour format (ie no dots, colons etc).
		Not used for Manuals.
	symbol is any valid TGT symbol or query.
	allfields: (optional) is to extract ALL data for each stox requested.
		You are NOT advised to do that too often.
	fields: (optional) is a series of 2 letter TGT field names.
		Normally the defaults are reasonable which are :
			fields:CV,ED,II,MA,MD,ST,YC,CL
	redun:(primaryHost), (secondaryHost)
		allow source redundancy (FipHdr field SZ)

	manual:lse	contract:S*EX
	manual:liffe	contract:L*EX
	manual:p707	page:707A

	; big one of ALL data at 6am
	snap:lse.check  time:0600	contract:S*EX   allfields:
	snap:lse.noon   time:1200	contract:S*EX
	snap:forex.noon time:1200	page:702A

Input Parameters (all optional) :
	-s : TGT Server hostname		default: "icv"
	-p : TGT Server port number		default: 1000
	-P : Local or source port number	default: 9222
	-q : Snapshot NOW queue			default: spool/icvsnap
	-o : Output queue			default: spool/2brouted
	-V : version number if connection to an old version of topic
		valid numbers are 1,3,6
		default: latest (version 6 as at nov07)
	-v : Print the version number and exit

----------Notes-----------

--The parameter file is read once on startup.

--Only if we are connected, logged on and have finished setup, will we snapshot
!!

--If the TGT server logs us off - like at 2am every morning - we wait and try
to reconnect automatically.

--Magazines data files are sent to a DU (destination) of TGTmagABC where ABC is
the first 3 letters of the magazine.

--To trigger manuals, a file with a FILENAME containing a header field of
CM:(name) is stuffed in the icvsnap queue where name is the same as the manual
name. Eg:
	touch /fip/spool/icvsnap/#SN:okboys#CM:lse
will trigger a manual of "lse" if one exists in the parameter file.

--Pre Version 6
	used Contracts and Pages

	contract is any valid TGT contract. Generally this is a all stox for
		an exchange ("S*EX" is S for LSE, *EX meaning all stox)
		If more than one contract is required, use a comma to separate
			contract:S*EX,U*EX
	page-fields: (optional) is a series of 2 letter TGT Page field names.
		The default is all relevent Page fields.
	snap:(name)	time:(time) contract:(contract) dest:(dest) [allfields:]
	snap:(name)	time:(time) page:(pageno) dest:(dest)
	manual:(name)	contract:(contract)
	manual:(name)	page:(pageno)

	manual:lse	contract:S*EX
	manual:liffe	contract:L*EX
	manual:p707	page:707A

	; big one of ALL data at 6am
	snap:lse.check  time:0600	contract:S*EX   allfields:
	snap:lse.noon   time:1200	contract:S*EX
	snap:forex.noon time:1200	page:702A
--Normal Startup sequence is as follows :
	1. Connect to TGT server
	2. Logon
	3. wait for TGT system quality messages
	4. Load which fields we want for our snap shots
	5. Load the magazine numbers we want to sample

The FIP log will show:

Thu May  9 02:07:10 ipicvd !s : Logon ok - Starting Setup 
Thu May  9 02:07:10 ipicvd !z : TGT System Message	  
Thu May  9 02:07:10 ipicvd !z : TGT System Message C3
Thu May  9 02:07:10 ipicvd !z : Status Feed Status	: 0 : Ok
Thu May  9 02:07:11 ipicvd !z : Status Database Quality : 0 : all Ok
Thu May  9 02:07:13 iproute !i : TGT	TGT7679 CTL : TGTsysmsg  SYS.INFO 
Thu May  9 02:07:13 iproute !i : TGT	TGT7680 CTL : TGTsysmsg  SYS.INFO 
Thu May  9 02:07:13 iproute !i : TGT	TGT7681 CTL : TGTsysmsg  STATUS 
Thu May  9 02:07:23 ipicvd !z : Load Fields for Shares 
Thu May  9 02:07:23 ipicvd !z : Command Succeeded 
Thu May  9 02:07:26 ipicvd !z : Load Magazines requested 
Thu May  9 02:07:26 ipicvd !z : Command Succeeded 
Thu May  9 02:07:28 ipicvd !z : Setup Completed successfully 

--Installation

On the Fip server, we need queues spool/icvsnap for manual snaps
	plus tables/setup/TGT for parameter file
	plus tables/route/TGT for routings
	plus correct destinations in tables/sys/USERS
	For Magazines, check tables/xchg/TGT2XXX
	For FinInst, check 'ipxicv' is also running / in SYSTEM

On the TGT server, change the hostname, IP address, Port number for the Server
	plus an entry for each Fip server - IP address and Port number.

-- General Notes (from the GlobalTopic doc)

Although both exchange and magazine control packet ids are equal in
functionality and are both able to watch sources of any kind, by convention the
magazines packet id is used for monitoring news stories and the exchanges
packet id for monitoring financial instruments.

Version Control
;005f4	30aug08 added history
	;e14 06nov07 Global topic v6
	;f4 20sep08 added history/CH
;004c	18may00 sorted out page stuff
	;b 13jul00 bugette in page
	;c 23jun05 mod for TGT change to Class in Magazines

(copyright) 2014 and previous years FingerPost Ltd.