You are on page 1of 95

JBASE FOUNDATION

Slide 1

OBJECTIVE

Objectives of the course are to


introduce jBase with special features and architecture
login jBase
Understand jShell and environmental variables.
Understand Tools and Utilities
Comprehend File Management and tools
Understand jBase editor

INTRODUCTION TO JBASE

INTRODUCTION TO JBASE

jBase is a database management environment that runs on


UNIX or Windows NT Operating system etc...
T24 Applications are developed in jBase Environment Using Info
Basic and runs in jBase.
Portable across hardware platforms
(HP-Unix, Aix, SCO Unix, Windows etc)
jBase provides a complete Development and Runtime
environment.

TECHNICAL LAYER

AC

LD

MM

Applications

T24/GLOBUS

jBase / UniVerse

DBMS

Unix / Windows

OS

T24 works on Unix/Windows platform and uses jBase/ Universe as


its database during runtime environment.
5

JBASE TERMINOLOGY

jBase

Microsoft Office

Account

Database

File

Table

Record

Record

Field

Field

Value

Value

Multi Value

no comparison

Sub Value

no comparison

FEATURES OF JBASE

JBASE FEATURES
Unique feature in jBase are
Can store variable length records.
Unlimited number of files.
Most efficient method of data storage, access and retrieval.

RELATIONSHIP OF OS AND JBASE

jBase has its own command processor that includes many OS


commands.
Example:
pwd
We can administer jBase from OS.
Example:
Backing up and Restoring system files, Keeping records, etc...

JBASE ARCHITECTURE

10

JBASE ARCHITECTURE

11

ARCHITECTURE

The jBase architecture consists of three components


Application Development Environment (ADE)
Middle-ware components
Database Management System

12

ARCHITECTURE

The first component is the


Application Development Environment.
This consists of several products.
First and primary is the
Basic language (jBC)

13

ARCHITECTURE

The second component is Middleware


The most important part of the
jBase middleware component is the
jBase External Database Interface (jEDI)

14

ARCHITECTURE

The third and final component of jBase


is the Database Management System.

15

ARCHITECTURE

Application Development Environment (ADE)


It consists of the following tools/products
jBase Basic language compiler(jBC)
jBase OBjEX
jBase Web Builder (jWB)

16

ARCHITECTURE

Middle-ware component consists of two products.


jBase External Device Interface ( jEDI )
jBase Data Provider ( jDP)

17

DATA-BASE MANAGEMENT SYSTEMS

Efficient Resource Management


Non First Normal Form database, having multi-value
capabilities. (i.e.. To embed tables within tables)
Transaction Management
It enables lock mechanism and ensures either a transaction is
completed fully or reversed back to its original state
Effective Distribution
Distribution of data in the database through Hashing algorithm
enables faster retrieval of data.

18

LOGIN TO JBASE

19

JBASE LOGIN

STEPS TO LOG ON TO T24 RUNNING ON jBase


Log on to Unix by specifying user name and password
user name and password are verified
Remote.cmd or .profile file is executed
Remote.cmd or .profile has the jBase environment set

20

JBASE LOGIN

Using REFLECTION software

Invoke Reflection to login to the server running jBase

21

JBASE LOGIN

It will automatically start prompting the user to enter


user-name and password.

22

JBASE DIRECTORY STRUCTURE

23

JBASE DIRECTORY STRUCTURE

/jBase

bin

config

jspooler

lib

tmp

dev

24

JBASE DIRECTORIES

bin
config
dev
jbcmessages
include
lib
src
tmp

Executable files
Configuration files
External device information
Error messages
Include files
Library files
Source code files
Temporary files

25

JSHELL

26

JSHELL

Why jShell?
jShell provides a command line environment equivalent to DOS
and UNIX terminal modes.
Features of jShell
Easily customizable command line prompt
Easy command recall.

27

NAVIGATION IN JSHELL

BK
from T24 gets you down to the jsh prompt
jsh > pwd
present working directory
jsh > jdir
list files and directories under current directory
jsh > ls -l (unix installation)
list files and directories and their permissions
jsh >more (unix installation)
used with record name to display contents of the record
jsh > cd
move to directory or file
jsh> exit
exits UNIX

28

jShell COMMANDS

jdir
jrm
jmv

Displays list of files in a directory


Removes a file
Moves old file to new file

29

JBASE ENVIRONMENTAL
VARIABLES

30

JBASE ENVIRONMENTAL VARIABLES

Used to help jBASE to,


Locate files
Establish search paths
Locate programs
Locate subroutines
Locate the spooler files

31

VIEWING ENVIRONMENT VARIABLES

jdiag
Shows all environment variables from a jBASE perspective
This has to be executed from the jshell prompt
echo
Shows you the contents of an environment variable
This has to be executed from the jshell prompt
Example : echo $HOME

32

JBCRELEASEDIR

Path to the jBASE directory where jBASE has been installed.


It shows the path where jbase executables, Libraries and Scripts
are found.
Example: jsh jglobus ~ -->echo $JBCRELEASEDIR
Output : /t24muappl/t24mcbdev/tafcmcbdev

33

JBCGLOBALDIR

Path to the jBASE directory where various configuration files are


found.
JBCGLOBALDIR shows where global constants can be found, such
as the configuration file for the record locking mechanism.
Example: jsh jglobus ~ -->echo $JBCGLOBALDIR
Output : /t24muappl/t24mcbdev/tafcmcbdev

34

JBCSPOOLERDIR

Contains the path of the spooler directory of JBASE.


jBase spool files are under the jspooler directory where jBase has
been installed.
Example: jsh jglobus ~ -->echo $JBCSPOOLERDIR
Output : muappl/t24mcbdev/jspooler

35

PATH

Search path locating executables.


Contains search path for OS executables.
Contains the search path of jBase executables.
It also Contains Compiler executables.
jBase executables are under the bin directory where jBase has
been installed.
Example: jsh jglobus ~ -->echo $PATH
Output :
/usr/java5/jre/bin:/t24muappl/t24mcbdev/bnk/bnk.run/t24bin/eb_
monitoring:/t24mun

36

JBCBASETMP

Contains the path of the JBASE temp directory that stores


temporary files.
Example:jsh jglobus ~ -->echo $JBCBASETMP
Output :
/t24muappl/t24mcbdev/bnk/bnk.run/jBASEWORK/tmp_4

37

JBCLISTFILE

Contains the path of the SAVEDLISTS File that is


used to store select lists.
Example: jsh jglobus ~ -->echo $JBCLISTFILE
Output :
/t24muappl/t24mcbdev/bnk/bnk.run/&SAVEDLISTS&

38

FILE SYSTEM JBASE

39

FILE TYPES

Jbase has two types of Files

Hashed Files
Non-Hashed Files

40

NON-HASHED FILES

Contains Sequential files


Unix level directories
Used to store programs or generated reports
Name cannot exceed 255 chars, determined by OS.
Spooler files used by GLOBUS to store printed reports
are directory files.
BASIC programs, executables and subroutines are
generally stored in directory files since they have no set
key, length or structure, and record sizes vary greatly.
It has only one Type UD

41

HASHED FILES

Data files are stored as hash files


Uses Hash Algorithms to dynamically read and write data
Two types of Hashed files
Type J3
Type J4
All T24 data files are Hashed files of Type = J4

42

FILES IN JBASE

Every file created in jBase contains two parts


Data portion
Dictionary portion
Data portion

Contains records

Dictionary portion
Contains field name and
its properties

Data
: Records in turn has many fields.
Dictionary : Contains field name and its attributes like
eg. Length, Max.range etc.,

43

MODULO AND SEPERATION

Modulo
The data and dict portion of hashed files are divided in to groups
called Modulos.
Default size of one Modulo is 1024 bytes for J3 type
Default size of one Modulo is 4096 bytes for J4 type
Separation
The size of the modulo is determined by separation.
Multiplying factor of the Modulo.

44

MODULO AND SEPERATION

Modulo and Separation specify the disk space allocated to a hashed


file.
The choice of file type, modulo, and separation can have dramatic
effect on JBASEs performance in accessing a file.
Size of the Data and Dict Portions can be determined while creating
file.
Apart from these it is possible to define secondary Buffer size.
Default size of secondary buffer size is twice the size of one modulo.

45

STRUCTURE OF HASHED FILE TYPE J3

4*1024=

4*1024=

4*1024=

4*1024=

4096 Bytes

4096 Bytes

4096 Bytes

4096 Bytes

Modulo1

Modulo2

Modulo3

Modulo4

4 *1024=
4096bytes
Modulo 5

Data Portion of Hashed file of Type=J3


for Modulo=5 and Separation=4

46

STRUCTURE OF HASHED FILE TYPE J4

3*4096=

3*4096=

3*4096=

3*4096=

12298 Bytes

12298 Bytes

12298 Bytes

12298 Bytes

Modulo1

Modulo2

Modulo3

Modulo4

Data Portion of Hashed file of Type=J4


for Modulo=4 and Separation=3

47

COPY

SYNTAX:
COPY FROM [SOURCE FILE]TO [TARGET FILE] record
names
Eg: COPY FROM MCB.TRN TO MCB.TRN1 TEST
This command copied the record from MCB.TRN to
MCB.TRN1.

48

FILE HANDLING WHEN ORACLE USED AS DATABASE FOR T24

49

Data Storage in Oracle

Slide 50

Data Storage in Oracle With T24 Browser

Slide 51

Creating a XMLORACLE type File

Slide 52

Input Data From Jbase

View it in Oracle

Slide 53

COMMANDS

CLEAR.FILE
To delete all records in dictionary or data file. You cannot
use this statement to delete the file itself.
Syntax : CLEAR.FILE <file name>
DELETE.FILE
Deletes the data file or dictionary file.
Syntax : DELETE.FILE <file name>

54

jQL

55

JQL
The jBase Query Language (jQL) provides the facility, which allows
to retrieve data from the database in a structured order and to
present the data in a flexible and easily understood format.
It is used to process data in the database and to generate reports.
They are

Record selection for processing


Report formatting
Sorting

Data field manipulation capabilities

Enter JQL statements in the jBase prompt to see how each one
works.

56

LIST

List

To list all the records in a file for the given fields.


Eg. LIST FBNK.CUSTOMER
List File Fields
Eg. LIST FBNK.CUSTOMER MNEMONIC SHORT.NAME
NAME.1
Explicit List
This list will select only those records which are given explicitly.
Eg. LIST FBNK.CUSTOMER "1000000017" "1000000013"

57

LIST

Listing of Specific records


LIST FBNK.CUSTOMER WITH NAME.1 = VAR1" VAR2" VAR3
This will list those records whose Name.1 matches the above
mentioned value.
LIST FBNK.CUSTOMER WITH NAME.1 = VAR1" AND WITH
SHORT.NAME= VAR2
If both Name.1 and Name.2 matches then only the record will be
retrieved.

LIST FBNK.CUSTOMER NAME.1 WITH NAME.1 LIKE S


Will list only those records which starting with S

58

SORT

Sort
Sort will sort the record in ascending order. If you want to sort
the records in descending order we have to explicitly mention in
the sort statement. By default it will sort in ascending order.
Sort File By Field Fields
SORT FBNK.CUSTOMER BY NAME.1 NAME.2

This command will sort the record by Name.1 in ascending order. Though it
is not specified in the sort command by default it will take ascending order.

SORT FBNK.CUSTOMER BY-DSND NAME.1


This command will sort the record by Name.1 in descending order.

SORT FBNK.CUSTOMER BY @ID BY NAME.1


This command will sort the record by id and name in ascending order.

59

SORT

BREAK-ON
SORT FBNK.CUSTOMER BY NAME.1 BREAK-ON NAME.1
This command will insert a break each time the value in the
Break-On field changes.
(I.e) when the Name.1 changes there will be some spaces
between records.

60

COUNT

COUNT
COUNT FBNK.ACCOUNT
Count is used to count the total number of records in a file.
SUPPRESS : DET-SUPP Details suppress
SORT FBNK.ACCOUNT BY CUSTOMER BREAK-ON "'P'"
CUSTOMER TOTAL WORKING.BALANCE DET-SUPP
The command will list the total working balance for each
customer without the account detail. Only the grand total of each
customer will be listed. If DET-SUPP is not given then the
command will list all the account and working balance for each
customer along with the grand total of each Customer.

61

COUNT

SUPPRESS : ID-SUPP
Suppress the record ID from being displayed as the first field
in any report.
SORT FBNK.ACCOUNT BY CUSTOMER BREAK-ON "'P'"
CUSTOMER @ID WORKING.BALANCE ID-SUPP
By default the id of each record will be displayed even if the
id column is not given. To suppress that id column we have
to give Id-Supp.

62

ESEARCH

ESEARCH
This command will search for the string RADAR in Globus.BP.
ESEARCH GLOBUS.BP
STRING:RADAR
STRING:
4 record(s) selected to SELECT list #0.

63

UTILITIES

64

COMO

Como is a Utility that is used to record the details which takes


place in the terminal and this in-turn is stored as a record in
COMO.
Record will be stored in a directory &COMO&
Como can be initiated from jsh prompt by COMO ON <record>
Como can be stopped by COMO OFF
During EOD/COB process, COMO will be initiated automatically
and it records the details for every process/agent

65

WHERE & WHO

WHERE
will display the details of processes executing jBase programs.
It has to be executed from jShell prompt.
WHO
Utility that displays the port number and the user for the current
process.

66

AUTOLOGOUT

The AUTOLOGOUT command enables a session to be


automatically logged off if there is no keyboard activity for a
specified time.
Syntax : AUTOLOGOUT n
n - number of minutes of keyboard inactivity required before
the session is logged off.

67

CT

CT command used to display a record from a file to the terminal.


Syntax : CT <filename> <record>
Example : CT MCBMU.BP TEST
Output :
001 *------------------------------------------------------------------------002 * <Rating>0</Rating>
003 *------------------------------------------------------------------------004 PROGRAM TEST
005 PRINT HELLO WORLD!"
006 END

68

SHOW-ITEM-LOCKS

The SHOW-ITEM-LOCKS command displays details of items that


are locked in jBase hashed files.
SYNTAX
Jsh t24demo SHOW-ITEM-LOCKS
A lock can be explicitly cleared with the CLEAR-ITEM-LOCKS
command.

69

CLEAR-ITEM-LOCKS

The CLEAR-ITEM-LOCKS command can be used to clear a


specific lock or all locks taken against a specific file.
This command can only be used with jBase hashed files.
The user should have administrator rights to execute this
command.
SYNTAX :
CLEAR-ITEM-LOCKS filename
CLEAR-ITEM-LOCKS filename record name

70

TOOLS

71

JSHOW

Used to find data files, programs and subroutines


It has to be executed from jshell prompt.
Syntax : jshow -options name
a display subroutine names in a shared object
c display compile time and source file
f filename search only
h display help for jshow
p program name only search
s subroutine name only search

72

JDIAG

Shows all environment variables and the assigned path from a


jBASE perspective
This has to be executed from the jshell prompt

73

JSTAT

Jstat is the tool used to find the statistics of a data file


It has to be executed from jsh prompt
Syntax : JSTAT <file name>
It can be applied only for a Hashed file.
Output will show the Modulo and file space details.

74

JRF

Badly sized file will always affect the performance


So file need to be resized depending on the data flow
JRF is the tool with which we can resize the data /
Hashed file
It has to be executed from the jsh prompt
Syntax : JRF options <filename>
Options are
- H3
Force to J3 file type
- H4
Force to J4 file type
- Sm(,s) Increase Modulo/seperation
. Modulo -m ; seperation -s
-R
Reporting purpose only
-D
Allows downsizing of a file
75

JEDITOR

76

jED

It is the preferred editing tool for the jBase operating environment


and suited to the editing of jBASIC programs.

jED editor is a full screen, context sensitive, screen editor


designed specifically for ease of use and learning

It incorporates many powerful facilities for manipulating text and


data, and contains all the features that programmers expect.

Configurable and customizable command keystrokes.

77

JED COMMAND SYNTAX


Syntax:
jed pathname {pathname..}
jed {DICT} filename{,filesection} {record-list} {(options)}
DICT - This modifier is only required if you wish to edit records in
the DICTionary of a j-file.
filename - This is the name of the "file" containing the records.
filesection - This is the file section name, as used in a j-file.
record-list - It is possible to furnish a list of records to be
successively edited. This can be a list of records separated by a
space, or "\*" to indicate all records in the file.

78

jED Editor screen


Editor screen is divided into three sections
1. The editor status line at the top
Eg. File PROGS, Record cust_rep.b Insert 10:45:17
2. The Command line
Eg. Command

3. The data editing area, which fills the rest of the screen.

79

jED COMMANDS

Ctrl G

Mark Block, 1st Start Blk, 2nd End Blk, 3rd Remove Mark

CBn

Copy Marked block before current line, n times

CAn

Copy Marked block after current line. n times

/string or L

Locate the next occurrence of "string"

MB

Move Marked block before current line

MA

Move Marked block after current line

BI

Format BASIC code

BION

Turn on Format indentation

! Cmd

Execute Command

!!

Re-execute last ! Cmd

HX or HEX

Toggle the display of the record in Hexadecimal


80

jED COMMANDS

<Ctrl A>

Moves cursor to start of the current line.

<Ctrl E>

Moves the cursor to the end of the current line.

<Esc>

Moves the cursor to the Command LINE

<Ctrl W>

Deletes from the cursor to the end of the word,


including the following white space characters

<Ctrl K>

Clears text to the end of the line. If the cursor is


situated at the end of the text line, then this
Command will join the following line with the
current line

<Ctrl D>

Deletes the current line. By default, this key


must be pressed twice to delete the line. This is
to avoid accidental deletion by users familiar
with vi.
81

jED COMMANDS

<Ctrl P>
<Ctrl R>
<Ctrl T>
<Ctrl V>
<Ctrl X>

<Enter>

Locates the previous occurrence of a earlier located


string.
Redisplays the screen and discards the most recent
updates (since the last carriage return).
Copies the character at the corresponding cursor
position on the line above the current line.
Performs jBC program indentations on the current
screen window.
Exits the current record without writing away any
updates. If the record has been changed within the
current editing session then the editor will ask for
confirmation to exit the modified record.
Opens a new line. Any characters on the current line
after the current cursor position are moved to the start
of the new line.
82

REPLACE

Position the cursor on appropriate line and move to the


Command-> Prompt
R/OLD/NEW

: Changes first OLD to NEW on current line.

R/OLD/NEW/3 : Changes first 3 OLD to NEW on current line.


R3/OLD/NEW

: Changes first OLD to NEW over 3 lines.

RU/OLD/NEW

: Changes all OLD to NEW on current line.

RU3/OLD/NEW : Changes all OLD to NEW over 3 lines.

83

COPY AND MOVE - BLOCKS

Select the Block using Ctrl G and move to the Command->


Prompt
CA
: Copies block after line you are on.
CA4
: Copies block 4 times after line you are on.
CB
: Copies block before line you are on.
CB4
: Copies block 4 times before line you are on.
MA
: Moves block after line you are on.
MB
: Moves block before line you are on.
DB
: Deletes Block.

84

SUMMARY

We have learnt Jbase architecture and access to jbase


We discussed about use of Jbase environmental variables
We thrown some light on jbase tools, utilities ,jeditor and JQL

85

Thank You !!!

Presented By:
Prakash Parupudi

Slide 86
Slide 86

CREATION AND MAINTENANCE OF FILES

87

HOW TO CREATE A NON HASHED FILE?

To create a file in jBase use CREATE.FILE command.


SYNTAX
CREATE.FILE <file name> TYPE=UD
This command Creates the data file and dict file.

88

HOW TO CREATE A HASHED FILE?

To create a file in jBase use CREATE.FILE command.


SYNTAX
CREATE.FILE <file name> TYPE=<file type> <dict portion> <data
portion>
This command Creates the data file and dict file.

89

WORKSHOP

Create a Non hashed file


Create a Hashed file with J3 type
Create a Hashed file with J4 type

90

NON-HASHED FILE

CREATE.FILE MCB.TRN TYPE=UD


Output :
[ 417 ] File MCB.TRN]D created , type = UD
[ 417 ] File MCB.TRN created , type = UD

91

HASHED FILE

CREATE.FILE F.MCB TYPE=J4 4,2,3 4,3


Dict Modulo

: 4

Dict Separation

: 2

Dict Secondary Buffer size : 3


Data Modulo

: 4

Data Separation

: 3

Data Secondary Buffer size: Default


Output :
File F.MCB]D created , type = J4

File F.MCB created , type = J4


92

HASHED FILE
Dict Portion of Hashed file of Type=J4 for Modulo=4 and
Separation=2 and secondary buffer size = 3

2*4096=
8192 Bytes
Modulo1

3*8192

2*4096=

2*4096=

2*4096=

8192 Bytes

8192 Bytes

8192 Bytes

Modulo2

Modulo3

Modulo4

3*8192

3*8192

3*8192

Secondary buffer size is allocated only when there is data overflow


93

HASHED FILE
Data Portion of Hashed file of Type=J4 for Modulo=4 and
Separation=4 and Default secondary buffer size

4*4096=
16384 Bytes
Modulo1

2*16384

4*4096=

4*4096=

4*4096=

16384 Bytes

16384 Bytes

16384 Bytes

Modulo2

Modulo3

Modulo4

2*16384

2*16384

2*16384

Secondary buffer size is allocated only when there is data overflow


94

Thank You !!!

Presented By:
Prakash Parupudi

Slide 95
Slide 95

You might also like