Skip to content

Commit

Permalink
THRUPPENCE
Browse files Browse the repository at this point in the history
  • Loading branch information
mt1976 committed Jan 20, 2020
1 parent 9d66ee1 commit 60628da
Show file tree
Hide file tree
Showing 18 changed files with 193 additions and 201 deletions.
2 changes: 1 addition & 1 deletion SIENA.BP/SIENA.BC.FXSPOT.HELPER
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SUBROUTINE SIENA.BC.FXSPOT.HELPER(PROCESS.NAME)
* : on ldn-srv-ubnt01 (Linux)
* -----------------------------------------------------------------------------
*
$INCLUDE UTIL.BP I_UTIL.TRANSLATE.H
$INCLUDE UTIL.BP F_UTIL.TRANSLATE.H
$INCLUDE UTIL.BP I_RATECSV.H
$INCLUDE UTIL.BP I_UTIL.H

Expand Down
2 changes: 1 addition & 1 deletion SIENA.BP/SIENA.ECB.HELPER
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SUBROUTINE SIENA.ECB.HELPER(PROCESS.NAME)
* : on ldn-srv-ubnt01 (Linux)
* -----------------------------------------------------------------------------
*
$INCLUDE UTIL.BP I_UTIL.TRANSLATE.H
$INCLUDE UTIL.BP F_UTIL.TRANSLATE.H
$INCLUDE UTIL.BP I_RATECSV.H

* INITIALISE
Expand Down
6 changes: 3 additions & 3 deletions SIENA.BP/SIENA.FORWARDS.HELPER
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SUBROUTINE SIENA.FORWARDS.HELPER(PROCESS.NAME)
* : on ldn-srv-ubnt01 (Linux)
* -----------------------------------------------------------------------------
*
$INCLUDE UTIL.BP I_UTIL.TRANSLATE.H
$INCLUDE UTIL.BP F_UTIL.TRANSLATE.H
$INCLUDE UTIL.BP I_RATECSV.H
$INCLUDE UTIL.BP I_UTIL.H

Expand Down Expand Up @@ -40,10 +40,10 @@ $INCLUDE UTIL.BP I_UTIL.H
PRECISION precisionValue

CCYPAIR.LIST = "" ; NO.PAIRS = -1
CALL U_OS.GET.LIST("SIENA.CONFIG", "forwards", "X", CCYPAIR.LIST, NO.PAIRS)
CALL U_OS.GET.LIST("SIENA.CONFIG", "ccyPair", "X", CCYPAIR.LIST, NO.PAIRS)

TENOR.LIST = "" ; NO.TENORS = -1
CALL U_OS.GET.LIST("SIENA.CONFIG", "forward_tenors", "TENOR", TENOR.LIST, NO.TENORS)
CALL U_OS.GET.LIST("SIENA.CONFIG", "ccyTenor", "TENOR", TENOR.LIST, NO.TENORS)

CALL U_CRT.INFO("NO PAIRS", NO.PAIRS)
OUTPUT.DATA = ""
Expand Down
96 changes: 56 additions & 40 deletions SIENA.BP/SIENA.FXCCYUPDATE.HELPER
Original file line number Diff line number Diff line change
Expand Up @@ -13,59 +13,75 @@ $INCLUDE UTIL.BP I_UTIL.H
$INCLUDE UTIL.BP F_UTIL.LOG.EVENT.H

* INITIALISE
CALL U_START(PROCESS.NAME)
CALL U_START(PROCESS.NAME)
* Setup some temp locations for input data
FN.SIENA.CONFIG = "SIENA.CONFIG" ; FV.SIENA.CONFIG = "" ; STOP.ON.ERROR = @TRUE ; ERROR.TEXT = ""
CALL U_OPENFILE(FN.SIENA.CONFIG, FV.SIENA.CONFIG, STOP.ON.ERROR, ERROR.TEXT)
ID.SIENA.CONFIG = ""

ID.SIENA.CONFIG = ""

ERROR.TEXT = ""; STOP.ON.ERROR = @TRUE ; VERBOSE = @TRUE
ERROR.TEXT = ""; STOP.ON.ERROR = @TRUE ; VERBOSE = @TRUE
* OPEN FILES

CALL U_HEADER("SIENA - Update CCY's to Deliver")
CALL U_HEADER("eurobase - Update CCY's to request")

SOURCES.LIST = "" ; NO.SOURCES = -1
CALL U_OS.GET.LIST("SIENA.CONFIG", "ccyPairSources", "SOURCE", SOURCES.LIST, NO.SOURCES)

FOR I = 1 TO NO.SOURCES

THIS.SOURCE = SOURCES.LIST<I>
THIS.SOURCE = CONVERT("|", @AM, THIS.SOURCE)

SQL.FIELDS = "CodeMajorCurrencyIsoCode,CodeMinorCurrencyIsoCode"
SQL.TABLE = "dbo.CurrencyPair"
SQL.WHERE = "Active=1"
RES.COLUMNS = ""
RES.DATA = ""
RES.COUNT = ""
SQL.KNOWN.AS = THIS.SOURCE<1>
SQL.ADDRESS = THIS.SOURCE<2>
SQL.DATABASE = THIS.SOURCE<3>

CALL U_CRT.INFO("SOURCE", THIS.SOURCE)

SQL.FIELDS = "CodeMajorCurrencyIsoCode,CodeMinorCurrencyIsoCode"
SQL.TABLE = "dbo.CurrencyPair"
SQL.DATABASE = "rel_gateway_sal_prd_demo-sys-3"
SQL.WHERE = "Active=1"
RES.COLUMNS = ""
RES.DATA = ""
RES.COUNT = ""
GOSUB UPDATE.LIST
NEXT I
CALL U_STOP(PROCESS.NAME)

CALL U_MSSQL.SELECT(SQL.FIELDS, SQL.TABLE, SQL.DATABASE, SQL.WHERE, VERBOSE, ID.RESULT,RES.COLUMNS,RES.DATA,RES.COUNT)
RETURN

CALL U_CRT.INFO("RESULT", ID.RESULT)
CALL U_CRT.RECORD(RES.COLUMNS)
CALL U_CRT.RECORD(RES.DATA)
CALL U_CRT.INFO("NO RECORDS",RES.COUNT)
UPDATE.LIST:
CALL U_MSSQL.SELECT(SQL.FIELDS, SQL.TABLE, SQL.ADDRESS, SQL.DATABASE, SQL.WHERE, VERBOSE, ID.RESULT,RES.COLUMNS,RES.DATA,RES.COUNT)
CALL U_CRT.INFO("RESULT", ID.RESULT)
CALL U_CRT.RECORD(RES.COLUMNS)
CALL U_CRT.RECORD(RES.DATA)
CALL U_CRT.INFO("NO RECORDS",RES.COUNT)

ID.SIENA.CONFIG = SQL.DATABASE:"_forwards.list"
ID.SIENA.CONFIG = "tmp_":SQL.KNOWN.AS:"_ccyPair.list"

R.NEW.LIST = ""
R.NEW.LIST<-1> = "#=----------------------------------------------------------------------------="
R.NEW.LIST<-1> = "#=AUTO GENERATED - FX SPOT & FORWARD CURVES TO FETCH="
R.NEW.LIST<-1> = "#=GENERATED at ":OCONV(TIME(),"MTS."):" on ":OCONV(DATE(),"D4/"):"="
R.NEW.LIST<-1> = "#=For ":ID.SIENA.CONFIG:" in SIENA.CONFIG="
R.NEW.LIST<-1> = "#=----------------------------------------------------------------------------="
R.NEW.LIST = ""
R.NEW.LIST<-1> = "#=----------------------------------------------------------------------------="
R.NEW.LIST<-1> = "#=AUTO GENERATED - FX SPOT & FORWARD CURVES TO FETCH="
R.NEW.LIST<-1> = "#=GENERATED at ":OCONV(TIME(),"MTS."):" on ":OCONV(DATE(),"D4/"):"="
R.NEW.LIST<-1> = "#=Temp file is ":ID.SIENA.CONFIG:" in SIENA.CONFIG="
R.NEW.LIST<-1> = "#=----------------------------------------------------------------------------="

FOR THIS.PAIR.POS = 1 TO RES.COUNT
CCY.PAIR = RES.DATA<THIS.PAIR.POS,1>:RES.DATA<THIS.PAIR.POS,2>
CALL U_CRT.INFO("PAIR",CCY.PAIR)
R.NEW.LIST<-1> = "X=":CCY.PAIR:"="
NEXT THIS.PAIR.POS
FOR THIS.PAIR.POS = 1 TO RES.COUNT
CCY.PAIR = RES.DATA<THIS.PAIR.POS,1>:RES.DATA<THIS.PAIR.POS,2>
CALL U_CRT.INFO("PAIR",CCY.PAIR)
R.NEW.LIST<-1> = "X=":CCY.PAIR:"="
NEXT THIS.PAIR.POS

FN.SIENA.CONFIG = "SIENA.CONFIG" ; FV.SIENA.CONFIG = "" ; STOP.ON.ERROR = @TRUE ; ERROR.TEXT = ""
CALL U_OPENFILE(FN.SIENA.CONFIG, FV.SIENA.CONFIG, STOP.ON.ERROR, ERROR.TEXT)
CALL U_WRITE(FV.SIENA.CONFIG, ID.SIENA.CONFIG, R.NEW.LIST, STOP.ON.ERROR, ERROR.TEXT)
CALL U_WRITE(FV.SIENA.CONFIG, ID.SIENA.CONFIG, R.NEW.LIST, STOP.ON.ERROR, ERROR.TEXT)

R.UTIL.LOG.EVENT = ""
R.UTIL.LOG.EVENT<U_LOG_EVENT> = 'REGENERATE'
R.UTIL.LOG.EVENT<U_LOG_MSG> = 'SIENA.CONFIG UPDATED'
R.UTIL.LOG.EVENT<U_LOG_ID> = ID.SIENA.CONFIG
R.UTIL.LOG.EVENT = ""
R.UTIL.LOG.EVENT<U_LOG_EVENT> = 'REGENERATE'
R.UTIL.LOG.EVENT<U_LOG_MSG> = 'SIENA.CONFIG UPDATED'
R.UTIL.LOG.EVENT<U_LOG_ID> = ID.SIENA.CONFIG

CALL U_CRT.RECORD(R.NEW.LIST)
CALL U_LOG.CMD("", R.UTIL.LOG.EVENT)
CALL U_CRT.RECORD(R.NEW.LIST)
CALL U_LOG.CMD("", R.UTIL.LOG.EVENT)

CALL U_STOP(PROCESS.NAME)
RETURN

RETURN
END
2 changes: 1 addition & 1 deletion SIENA.BP/SIENA.FXSP.HELPER
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SUBROUTINE SIENA.FXSP.HELPER(PROCESS.NAME)
* : on ldn-srv-ubnt01 (Linux)
* -----------------------------------------------------------------------------
*
$INCLUDE UTIL.BP I_UTIL.TRANSLATE.H
$INCLUDE UTIL.BP F_UTIL.TRANSLATE.H
$INCLUDE UTIL.BP I_RATECSV.H
$INCLUDE UTIL.BP I_UTIL.H

Expand Down
2 changes: 1 addition & 1 deletion SIENA.BP/SIENA.GILTS.HELPER
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SUBROUTINE SIENA.GILTS.HELPER(PROCESS.NAME)
*
$INCLUDE UTIL.BP I_UTIL.H
$INCLUDE UTIL.BP I_UKTREASURY.H
$INCLUDE UTIL.BP I_UTIL.TRANSLATE.H
$INCLUDE UTIL.BP F_UTIL.TRANSLATE.H
*** https://www.londonstockexchange.com/download/csv/tbLSEBondsDownloadCSV_en.csv
***
* INITIALISE
Expand Down
2 changes: 1 addition & 1 deletion SIENA.BP/SIENA.MM.HELPER
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SUBROUTINE SIENA.MM.HELPER(PROCESS.NAME, PROCESS.TYPE)
* : on ldn-srv-ubnt01 (Linux)
* -----------------------------------------------------------------------------
*
$INCLUDE UTIL.BP I_UTIL.TRANSLATE.H
$INCLUDE UTIL.BP F_UTIL.TRANSLATE.H
$INCLUDE UTIL.BP I_RATECSV.H
* INITIALISE
CALL U_START(PROCESS.NAME)
Expand Down
2 changes: 1 addition & 1 deletion SIENA.BP/SIENA.NI.NAME
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SUBROUTINE SIENA.NI.NAME(IO.NAME, COUPON.VALUE, MATURITY.DATE)
* -----------------------------------------------------------------------------
*
$INCLUDE UTIL.BP I_UTIL.H
$INCLUDE UTIL.BP I_UTIL.TRANSLATE.H
$INCLUDE UTIL.BP F_UTIL.TRANSLATE.H


MANIP.ARRAY = CONVERT(" ", @AM, IO.NAME)
Expand Down
2 changes: 1 addition & 1 deletion SIENA.BP/SIENA.SCRIPT.HELPER
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SUBROUTINE SIENA.SCRIPT.HELPER(SCRIPT.NAME)
* : on ldn-srv-ubnt01 (Linux)
* -----------------------------------------------------------------------------
*
$INCLUDE UTIL.BP I_UTIL.TRANSLATE.H
$INCLUDE UTIL.BP F_UTIL.TRANSLATE.H
$INCLUDE UTIL.BP I_RATECSV.H

* INITIALISE
Expand Down
2 changes: 1 addition & 1 deletion SIENA.BP/SIENA.TBILLS.HELPER
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SUBROUTINE SIENA.ECB.HELPER(PROCESS.NAME)
* : on ldn-srv-ubnt01 (Linux)
* -----------------------------------------------------------------------------
*
$INCLUDE UTIL.BP I_UTIL.TRANSLATE.H
$INCLUDE UTIL.BP F_UTIL.TRANSLATE.H
$INCLUDE UTIL.BP I_RATECSV.H

* INITIALISE
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion SIENA.CONFIG/forwards.list → SIENA.CONFIG/ccyPairSources.list
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#=----------------------------------------------------------------------------=
#=FX SPOT & FORWARD CURVES TO FETCH=
X=GBPUSD=
SOURCE=37-3|192.168.1.1|rel_gw3=
X=EURUSD=
X=USDCAD=
X=EURCAD=
Expand Down
File renamed without changes.
29 changes: 0 additions & 29 deletions UTIL.BP/I_UTIL.LOG.EVENT.H

This file was deleted.

12 changes: 0 additions & 12 deletions UTIL.BP/I_UTIL.TRANSLATE.H

This file was deleted.

Loading

0 comments on commit 60628da

Please sign in to comment.