JBASE FOUNDATION
2
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 editor3
INTRODUCTION TO JBASE
4 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.5 TECHNICAL LAYER
T24 works on Unix/Windows platform and uses jBase/ Universe as its database during runtime environment.
Unix / Windows
jBase / UniVerse DBMS
T24/GLOBUS
AC LD MM
… … …
Applications6 JBASE TERMINOLOGY
jBase Microsoft Office
Account Database
File Table
Record Record Field Field Value Value
Multi Value no comparison Sub Value no comparison
7
FEATURES OF JBASE
8 JBASE FEATURES
Unique feature in jBase are
Can store variable length records.
Unlimited number of files.9 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:
10
JBASE ARCHITECTURE
11 JBASE ARCHITECTURE
12 ARCHITECTURE
The jBase architecture consists of three components
Application Development Environment (ADE)
Middle-ware components13 ARCHITECTURE
•
The first component is theApplication Development Environment. • This consists of several products.
• First and primary is the Basic language (jBC)
14 ARCHITECTURE
•The second component is Middleware • The most important part of the
jBase middleware component is the jBase External Database Interface (jEDI)
15 ARCHITECTURE
The third and final component of jBase is the Database Management System.
16 ARCHITECTURE
Application Development Environment (ADE) It consists of the following tools/products
•
jBase Basic language compiler(jBC)•
jBase OBjEX17 ARCHITECTURE
Middle-ware component consists of two products.
jBase External Device Interface ( jEDI )18 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 stateEffective Distribution
Distribution of data in the database through Hashing algorithm enables faster retrieval of data.19
LOGIN TO JBASE
20 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 executed21 JBASE LOGIN
Using REFLECTION software
22 JBASE LOGIN
It will automatically start prompting the user to enter
user-name and password.
23
24 JBASE DIRECTORY STRUCTURE
/jBase dev lib tmp jspooler config bin
25 JBASE DIRECTORIES
•
bin - Executable files•
config - Configuration files•
dev - External device information•
jbcmessages - Error messages•
include - Include files•
lib - Library files•
src - Source code files26
27 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.28 NAVIGATION IN JSHELL
BKfrom T24 gets you down to the jsh prompt
jsh > pwdpresent working directory
jsh > jdirlist 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 > cdmove to directory or file
jsh> exit29 jShell COMMANDS
jdir - Displays list of files in a directory
jrm - Removes a file30
JBASE ENVIRONMENTAL
31 JBASE ENVIRONMENTAL VARIABLES
Used to help jBASE to,
Locate files
Establish search paths
Locate programs
Locate subroutines32 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 prompt33 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/tafcmcbdev34 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/tafcmcbdev35 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/jspooler36 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
37 JBCBASETMP
Contains the path of the JBASE temp directory that stores temporary files.
Example:jsh jglobus ~ -->echo $JBCBASETMP
Output :38 JBCLISTFILE
Contains the path of the SAVEDLISTS File that is
used to store select lists.
Example: jsh jglobus ~ -->echo $JBCLISTFILE
Output :
39
FILE SYSTEM JBASE
40 FILE TYPES
Jbase has two types of Files
Hashed Files
41 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.
42 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 J443 FILES IN JBASE
Every file created in jBase contains two parts
•
Data portion•
Dictionary portionData portion Dictionary portion
Data : Records in turn has many fields.
Dictionary : Contains field name and its attributes like eg. Length, Max.range etc.,
Contains records
Contains field name and44 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.45 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 JBASE’s 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.46 4*1024= 4096 Bytes Modulo1 4*1024= 4096 Bytes Modulo2 4*1024= 4096 Bytes Modulo3 4*1024= 4096 Bytes Modulo4
Data Portion of Hashed file of Type=J3 for Modulo=5 and Separation=4
STRUCTURE OF HASHED FILE TYPE J3
4 *1024= 4096bytes
47 3*4096= 12298 Bytes Modulo1 3*4096= 12298 Bytes Modulo2 3*4096= 12298 Bytes Modulo3 3*4096= 12298 Bytes Modulo4
Data Portion of Hashed file of Type=J4 for Modulo=4 and Separation=3
48 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.49 FILE HANDLING WHEN ORACLE USED AS DATABASE FOR T24
Data Storage in Oracle
Slide 51
Slide 52
Slide 53
Input Data From Jbase
54 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>55
56 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 capabilitiesEnter JQL statements in the jBase prompt to see how each one works.
57 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"58 LIST
Listing of Specific records
LIST FBNK.CUSTOMER WITH NAME.1 = “VAR1" “VAR2" “VAR3“
This will list those records whose Name.1 matches the abovementioned 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 S59 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.160 SORT
BREAK-ON
SORT FBNK.CUSTOMER BY NAME.1 BREAK-ON NAME.1
This command will insert a break each time the value in theBreak-On field changes.
(I.e) when the Name.1 changes there will be some spaces between records.61 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 eachcustomer 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.
62 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.63 ESEARCH
ESEARCH
This command will search for the string RADAR in Globus.BP. ESEARCH GLOBUS.BP
STRING:RADAR STRING:
64
65 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/agent66 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.67 AUTOLOGOUT
The AUTOLOGOUT command enables a session to beautomatically 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.68 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
69 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.70 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 thiscommand.
SYNTAX :
CLEAR-ITEM-LOCKS filename71
72 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 search73 JDIAG
Shows all environment variables and the assigned path from a jBASE perspective74 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.75 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
76
77 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.78 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 besuccessively edited. This can be a list of records separated by a space, or "\*" to indicate all records in the file.
79 jED
Editor
screen1. The editor status line at the top 2. The Command line
3. The data editing area, which fills the rest of the screen. Eg. File PROGS, Record cust_rep.b Insert 10:45:17
Eg. Command
80 jED COMMANDS
Toggle the display of the record in Hexadecimal HX or HEX
Re-execute last ! Cmd !!
Execute Command ! Cmd
Turn on Format indentation BION
Format BASIC code BI
Move Marked block after current line MA
Move Marked block before current line MB
Locate the next occurrence of "string" /string or L
Copy Marked block after current line. n times CAn
Copy Marked block before current line, n times CBn
Mark Block, 1st Start Blk, 2nd End Blk, 3rd Remove Mark Ctrl G
81
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
jED COMMANDS
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.
<Ctrl D> <Ctrl K>
Deletes from the cursor to the end of the word, including the following white space characters <Ctrl W>
Moves the cursor to the Command LINE <Esc>
Moves the cursor to the end of the current line. <Ctrl E>
Moves cursor to start of the current line. <Ctrl A>
82
<Ctrl P> Locates the previous occurrence of a earlier located string.
<Ctrl R> Redisplays the screen and discards the most recent updates (since the last carriage return).
<Ctrl T> Copies the character at the corresponding cursor position on the line above the current line.
<Ctrl V> Performs jBC program indentations on the current screen window.
<Ctrl X> 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.
<Enter> Opens a new line. Any characters on the current line after the current cursor position are moved to the start of the new line.
83 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.
84 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.85 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 JQLThank You !!!
Presented By:
Prakash Parupudi
Slide 86 Slide 86
87 CREATION AND MAINTENANCE OF FILES
88
•
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. HOW TO CREATE A NON HASHED FILE?
89
•
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.
90 WORKSHOP
• Create a Non hashed file
• Create a Hashed file with J3 type • Create a Hashed file with J4 type
91 NON-HASHED FILE
CREATE.FILE MCB.TRN TYPE=UD Output :
[ 417 ] File MCB.TRN]D created , type = UD
[ 417 ] File MCB.TRN created , type = UD92 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
93 2*4096= 8192 Bytes Modulo1 2*4096= 8192 Bytes Modulo2 2*4096= 8192 Bytes Modulo3 2*4096= 8192 Bytes Modulo4
3*8192
3*8192
3*8192
3*8192
HASHED FILE
Secondary buffer size is allocated only when there is data overflow
Dict Portion of Hashed file of Type=J4 for Modulo=4 and Separation=2 and secondary buffer size = 3
94 4*4096= 16384 Bytes Modulo1 4*4096= 16384 Bytes Modulo2 4*4096= 16384 Bytes Modulo3 4*4096= 16384 Bytes Modulo4
2*16384
2*16384
2*16384
2*16384
HASHED FILE
Secondary buffer size is allocated only when there is data overflow Data Portion of Hashed file of Type=J4 for Modulo=4 and
Thank You !!!
Presented By:
Prakash Parupudi
Slide 95 Slide 95