Find below the list of common variables used in subroutines. They’re accessible as long as you include “$INSERT I_COMMON” in
Category: Programming
DEBUGGER
2 ways to invoke the debugger: launching debugger once a program is called and reaching a specific line number:
Update a record in live & history file during EOD/COB
Just an example of elements to include in a routine that update a record during the COB (end of day
Number(s) Formatting
First thing to note: native data is string in Jbase. So if you start with multiplying your data by 1,
Get Call stack history
In a routine, when you need to get information about the calling subroutine / program, or the routine which called
Function usage
JBase-Basic allows the definition of functions, like in any standard programing language. Benefit is that programs calling functions are much easier to read
LOCATE and FINDSTR functions
LOCATE Function When searching for a value in an array, you can use the common “LOCATE” function. You need to
Date Time Stamp
Various commands to manipulate date and time DATE() returns the system date, compared to TODAY which returns T24 date (banking date).
Fields Definitions
Compared to standard RDBMS, T24 applications (or table) have their structure hard-coded. Who said 🙁 ??! Fields definitions relates to the dictionary of
Dynamic array versus matrix
Within a jBase-Basic program, a data array can be represented as a Dynamic Array: – Used with array_name<datax> or alternatively
Write trace in a log file
Sometimes you need to add some program traces in a log file to understand more clearly what is going on.
“black belt” LIST command under Jbase
SQL: select left(value_date,6), count(*) from security_transfer where broker_no = ‘595701’and transaction_type like ‘F%’ and value_date like ‘2010%’ group by left(value_date,6)
Create a new application, starting from a standard TEMPLATE
If the standard package is not enough for you, you can easily create a new application from scratch 🙂 Steps
Display messages to the user
Display a simple message Example of coding: TEXT = “Your input overrides tolerance of” TEXT := “<CR>” TEXT :” MAX.TOL
JBase Programmer’s Guides
Programmers_Reference_Manual.pdf: Advanced Programmers Reference Manual.pdf :
How to modify the default enrichment of a field
(to be used in a version) STANDARD.SELECTION Create an I-desc that contains the new enrichment DX.CONTRACT.MASTER 15. 5 USR.FIELD.NAME. SHORT.NAME.SIZE
Validation routine in a Version
In a version, you can manipulate fields contents by using a validation routine. It is defined in a version using
Jbase Editor tips & tricks
Quit Editor after multiple select After a SELECT + EDIT / jed, to quit the editor: Escape !EXK + Return
Dates Manipulation
Get detailed date time information: * Time HH:MM:SS DD MMM YYYY CURRENT.TIME = TIMEDATE() CURRENT.TIME = CURRENT.TIME[1,2]: ‘:’ : CURRENT.TIME[4,2]:
Write directly a record in a table
WRITE “R.RECORD” TO “F.TABLE.NAME”, “RECORD.KEY” Example : FN.DX.MARKET.PRICE = “F.DX.MARKET.PRICE” F.DX.MARKET.PRICE = “” CALL OPF(FN.DX.MARKET.PRICE, F.DX.MARKET.PRICE) (…) WRITE R.DX.MKT.PRICE TO
Write properly a record in a table (CALL F.WRITE)
CALL F.WRITE (FN.TABLE.NAME, RECORD.ID, R.RECORD) Example : FN.FILENAME = ‘F.FILENAME’ ; FV.FILENAME = ” CALL OPF(FN.FILENAME, FV.FILENAME) R.RECORD<DX.CM.FIELD1> = ‘TOTO’
Build and fill in an array then retrieve data from it
Sometimes you will need to temporarily store data, before aggregation, cumul, re-order, etc… An array is the solution to perform
Read an History file with a Live key
Read an History file with a Live key Use the program EB.READ.HISTORY.REC to read the history file. You take the
Return a list of keys with a QSELECT
CALL EB.READLIST can also be used with a QSELECT. The QSELECT is selecting all fields from a table, not only
Return a list of keys after a SELECT (CALL EB.READLIST)
CALL EB.READLIST (SELECT.STATEMENT, KEY.LIST, LIST.NAME, SELECTED, SYSTEM.RETURN.CODE) Routine to return a list of keys from a select statement. Introduced to
Extract a range of keys after a CALL OPF(FOR NEXT, LOOP REMOVE)
Extract a range of keys after a CALL OPF Y.DATE = TODAY READ R.DX.DAILY.TRANS FROM F.DX.DAILY.TRANS,Y.DATE ELSE R.DX.DAILY.TRANS = “”
Manipulate the fields of a table (quick introduction)
All fields from a table are numbers, with an associated description. This association is set in libraries loaded by
Get a foreign data from a local table (CALL DBR)
Get a foreign data from a local table When you work with a table, you may need information stored in
Get a whole record, then extract multiple fields (CALL OPF, CALL F.READ)
CALL OPF, CALL F.READ
This is How Globus Works
This is How Globus Works…