Wednesday, October 27, 2010

Open File jBase Temenos T24

One can open a file in temenos t24 in different ways simple is by using OPEN command, suppose we want to open CUSTOMER file then the command issued will be
OPEN FBNK.CUSTOMER
there is a little problem with OPEN command, when we use the 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 identify itself uniquely.

Example

There is a Bank named MyBank, and has many branches as bank do, suppose in Branch1 we open the customer file in a subroutine by using the jBASIC OPEN commad.
OPEN FBR1.CUSTOMER
now, 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.
In order to overcome this problem or to make our program portable, we need to use the core T24 subroutine OPF instead of OPEN.

OPF

OPF is a core T24 subroutine that is used to open files.

Synatax

CALL OPF(Parameter1,Parameter2)

Example

FN.CUS = 'F.CUSTOMER'
F.CUS = ''
CALL OPF(FN.CUS,F.CUS) //open customer file

How OPF Works

OPF takes in 2 parameters:
Parameter 1 -> The name of the file to be opened prefixed with an F.
Parameter 2 -> Path of the file to be opened. This is usually specified as ''

Both the parameters are to be stored in variables and then passed to the OPF subroutine.
FN.CUS = 'F.CUSTOMER'
The name of the variable that is to store the file name has to begin with "FN." followed by a string that denotes the file that is to be opened. Just supply the value "F." followed by the name of the file to open like above to the variable FN.CUS.When the OPF subroutine gets executed, the COMPANY file is read in order 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 "F" - FBNK thus making subroutines portable across branches of bank. F.CUS = '' The name of the variable that will hold the path of the file has to begin with a 'F.' followed by a string that denotes the file that is to be opened. This string has to be the same as that of the file name (FN) variable. This variable should be equated to a null ('').
When OPF gets executed, the VOC entry for the file is read and the path of the data file gets populated in this variable.


1 comments:

OBA on January 25, 2022 at 1:59 AM said...

thank you so much for this.

Post a Comment

 

Blog Info

A Pakistani Website by Originative Systems

Total Pageviews

Tutorial Jinni Copyright © 2015 WoodMag is Modified by Originative Systems