Professional Documents
Culture Documents
Infobasic Programming and T-24 Standard
Infobasic Programming and T-24 Standard
Introduction
Structure of Infobasic Program
Control Structure of Infobasic
Built in Infobasic functions
Infobasic Commands
Writing subroutine in Infobasic
Practice session
Assignment
I_COMMON and I_EQUATE are two main insert files available in Globus.
I_COMMON defines all common global variables that can be used across subroutines and the file
I_EQUATE initializes those common variables
(It is a good practice to include these files in every subroutine we write irrespective of whether we are to use common global
variables or not. These insert files are available under the directory GLOBUS.BP.)
common variables are accessible as long as you include “$INSERT I_COMMON” in your programs.
ID.NEW
FT Id
PGM.FILE
(whenever an application or batch job is selected, the PGM.FILE table is read to firstly see if the program or process
exists, and secondly to see what its characteristics are. If there is no entry on the PGM.FILE table then it cannot be
executed from within the T24 environment.)
This table can also hold the names of all subroutines within T24
Inorder to open the Customer file we can use the Infobasic command OPEN.
OPEN FBNK.CUSTOMER ………………….
When we use the UniVerse command OPEN to open a file, we need to supply the
exact file name(along with the prefix). If programs are written using OPEN statements , they do not
become portable across branches of a bank as each branch will have a different mnemonic to indentify
itself uniquely.
For Instance
Bank XYX
In Branch1
In a subroutine we open the customer file by using UniVerse OPEN statement
OPEN FBR1.CUSTOMER
In Branch2
If the above subroutine with the OPEN statement were to be executed in this branch,
the subroutine would return a fatal error saying that it cannot open the file. The name
of the customer file in this branch is FBR2.CUSTOMER.
Inorder to overcome this problem or program portability, we need to use the core
Globus subroutine OPF instead of Open.
When the OPF subroutine gets executed, the COMPANY file is read inorder to obtain
the mnemonic of the bank. Then the FILE.CONTROL record of the file is read to find out the type of
file(INT,CUS or FIN). Once the file type is extracted, the ‘F.’ in the file name gets replaced with
“FBankMnemonic” - FBNK thus making subroutines portable across branches.
OPF Description: File open routine. Handles company modification
of file name hence it must be called for all file
opens.
Arguments: (FILE.NAME, FILE.VAR)
Incoming:
FILE.NAME Name of the file to be opened, this should not
include any mnemonic as this will be determined
by the program itself allowing for the file
classification and multi-company or multi-book
setup e.g F.CUSTOMER.
Returned:
FILE.NAME The full file name including the company
mnemonic if applicable e.g. FXXX.CUSTOMER.
FILE.VAR File variable.
Here we're opening our local application using OPF wrapper subroutine.
It supports caching of opened _les so if this _le is already opened by another
subroutine, whether a core or a local one, _le wouldn't be reopened and
performance wouldn't su_er.
After the _le has been opened the variable FN.FCM contains full _le hame.
(It's FBNK.FT.CREATION.METHOD in case we're working in the main company
with mnemonic \BNK" used for _nancial _les.) In fact, sometimes OPF is
used only to obtain full _le name, e.g. for subsequent SELECT.
112
In order to obtain the mnemonic and the nationality of the customer, we need to
access the dynamic array R.CUSTOMER. To extract values from a dynamic array, angular brackets
“< >” need to be used.(Use ‘()’ for dimensioned arrays)
We can extract data from the dynamic array by specifying field positions as follows
Y.MNEMONIC = R.CUSTOMER<1>
or by specifying the actual name of the field.It is always advisable to use field names ‘coz field
positions could change from one release of Globus to another. Here 1 is the field position of the
field mnemonic in the CUSTOMER file.
How does one know the field numbers and the field names?
Most of the files in Globus have insert files which begin with ‘I_F.’ followed by the name
of the file. They will be available under GLOBUS.BP.These files hold the names and the field positions
of the various fields. These fields could have prefixes/suffixes.
And for a person who knows jBASE or Universe well it's a bit embar-
rassing to learn that some thing absolutely valid in \pure" jBASE doesn't
work in T24 environment (like adding something to dictionary manually { it
lives only until STANDARD.SELECTION record is rebuilt next time).
What's an application after all in T24 context? The answer is: it's a
combination of at least one subroutine containing table structure and busi-
ness logic (based on so-called \template"), one or several data _les (read {
jBASE tables), dictionary _le and several setup records. You'll be surprised
to know that setup records and data records actually are stored the same way
{ setup records in setup applications and data records in data applications
Example 1:
What's wrong:
There is a global variable ID.COMPANY which is to be used instead of 'US0010001'.
We don't need to read company record since it's already available in global array R.COMPANY.