Вы находитесь на странице: 1из 13

Programming in JBASE

FM Field Marker 254


VM Value marker 253
SM Sub Value marker 252
FM to be placed for empty value
Program Skeleton
Comment denoted by *

.Bp file extension type = UD

Basic trg.bp my.first.pgm to complie

List all in directory


Ls windows
Ls -I unix

PATH – T24/bin location – core executables


JBC-DEVBIN – bin to store local executables
Dimensional Array - DIM ARR(5)
Common used in jbase
1.IF THEN ELSE
2.CASE
3.FOR NEXT
4.LOOP REPEAT
DICT RECORD
001 Data Field D
002 Order 0,1,2,3 etc
003 Not used
004 name TR.ID, Name, Course,
005 25L, or 35R length justified
006 S,M single or multi value

J4 files never closed


OPEN – Open file
Setting var is set then it gives information of open failure with codes
128 – No file or directory
4096- network error
24576 Permission denied
32768 physical IO or unknown error

OPEN, READ,WRITE.READU READU – Read and lock file

SETVAR
-1 end of array reached
-2 array delimited by FM
-3 array delimited by VM
-4 array delimited by SM
SYSTEM(43) – to identify which port has lock in case of readu locked

Lock is released :
WRITE, WRITEV, MATWRITE
RELEASE, DELETE
SHOW ITEM LOCKS

MATREAD reading in dimensional array


ONError executes for all status except 128TR

TRANSSTART
TRANSEND

FIND
SUBSTRINGS

Output
ABC
BB
B1 B2
Locate – position of item for multiple items 1,2 position of vm items
T24 API
Open for company specific FBNK, FCO2 etc not portable

CALL OPF(Name,Path)

FN.ACC = evaluated based on company mnemonic


FBNK/FCO2
INT> FN.ACC

F.Acc = ‘’ populated with file path auto

BUCKET – Cache jbase

All About System cache (JBASE)


After R11 routines using system cache

OPF – File control checked for classification if not found in file type buffer
Jbase open performed to get file path if not found in file open buffer

In same session information is retained .


If for another company then only jbase open needed for getting file path if already classification is
present.

Common Variable – Session specific only I_Common (GLOBUS.BP)

Session
Classic – Always open for user , cache remains in T24 server , usually connection by telnet
Browser – TSS session cache(TCSERVER) in web server of browser , no guaranty info will be retained
if req from other server.

F.READ

Only works when you have file.control record present.


F.read variables are not session specific, they are transaction specific.
Fread variable are not session variables

FREAD only to read not to update/edit


FWT Filename and record id
FWC Actual record

CACHE.SIZE in SPF – 3001 default

Y.CURRENCY == R.ACC(8) or you should use field name as position can change with release

INSERT FILES
Common
I_COMMON I_EQUATE

Application specific
I_F.CUSTOMER
I_F.ACCOUNT
JBCLIB_DEV path to store routine objects
JBCGLOBALDIR Global path for having jLibDefinition
jLibDefinition Used by jbase to auto create library if full

jshow -c gives details of actual library file and path where code is catalogued
jshow -a give actual content of library file

Insert vs include
JBCOBJECTLIST : Contains search path for all objects

DEBUG : in routine , use -D while compiling with EB.COMPILE Command

S , Line by line execution


V F.ACC view content at any time

F.READU

FREADU checks if type lock exist which in case of F.READ is null


So it gets from db and set Type as L
FWF : L keeps lock type

F.WRITE writes to cache

JOURNAL.UPDATE – Cache to database

EB.TRANS(‘START’,’’)
EB.TRANS(‘END’,’’)
EB.ABORT triggered when error

T24 transaction framework routines used mostly to commit to db


UNAUTH.RECORD.WRITE any other than live record
AUTH.RECORD..WRITE To write live record

Multiple records can not be in memory more than limit:


CACHE.SIZE Set in SPF record
File I/O cache exceed number <n> 3?

F.WRITE or Journal.update release the lock by calling TRANSEND

F.RELEASE – Release the lock use with caution with parameter

EB.READLIST :

List Ids separated by FM

SELECT VS Execute SEL CMD - use select if no clause or condition


CACHE.READ – F.READ cache is transaction specific, here data stored for parametrizable amount

CACHE.EXPIRY set in SPF , after which data is read again

Use mostly for static table SECTOR , CATEGORY , don’t use for ACCOUNT

Accessing sequential file in jabse


T24 stores in sequential j4 files
Internal log file &como& , &hold&
Ud file used by OFS in batch processing

Create sequential file

OPENSEQ

Writeseq
CLOSESEQ

Example

READSEQ
Open sequential file with path

Sequential file is open , only one type of operation can be done read/write.

Code Review
Eb.compile is used for catalog and compile.

Rating based on the weightage and default values of these factors

The negative ranking is good sign/ positive ranking means lot to improve.
Size/Number of lines
If the line of code is greater than 600 the +10 ranking.
GoSUB
Break up long program into smaller ones. Use CALL statement to bring
Top down approach, -10 for GOSUB component
Paragraph depth
If paragraph is more than 100 lines, than weightage 5 is given
Nesting
The max. no. of nesting statement is 3, if more than 3 than weightage is 50
Improve – by using CASE.
Nesting Depth
Maximum number of lines within an IF… END statement is 40 anything over
will affect the ranking by 5. Improve – using GOSUB within nested IF’s.
Comment
For each line of comment the weightage is -1.
GOTO
use of GOTO never recommended. Weightage is 100.
Temenos allows GOTO with locked clause.
GOTO never returns the point of origin unlike GOSUB. Improve – paragraph

Non standard expression – IF then

Вам также может понравиться