Jbase Intro
Jbase Intro
1
OBJECTIVE
2
COURSE AGENDA
4
Introduction to jBase
5
Technical Layer
AC LD MM … … … Applications
T24/GLOBUS
jBase / UniVerse DBMS
Unix / Windows OS
6
jBase Terminology
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
9
Relationship of OS and jBase
10
jBase Architecture
11
jBase Architecture
12
ARCHITECTURE
13
ARCHITECTURE
14
ARCHITECTURE
15
ARCHITECTURE
16
ARCHITECTURE
17
Application Development
Environment
18
Application Development
Environment
jBase OBjEX
• It provides an interface from two environments, Microsoft's COM
and Java-based applications.
• The COM based OBjEX allows access to jBase database from Visual
Basic and Delphi.
• jBase OBjEX provides a similar capability for Java based
development tools, such as JBuilder…
19
Application Development
Environment
20
ARCHITECTURE
21
Middle-ware
22
Middle-ware
23
Middle-ware
24
Data-Base Management
Systems
25
Login jBase
26
Login jBase
27
Login jBase
28
Login jBase
29
Login jBase
30
Login jBase
31
jBase Directory Structure
32
jBase Directory Structure
/jBase
/jBase
bin
bin config
config jspooler
jspooler lib
lib tmp
tmp dev
dev
33
jBase Directory Structure
/bin
– Contains all the binary executables that make up the jBase system
including the compilers.
/config
– Contains various configuration files for systems such as background
processing and the j-file(s) lock daemon. (jRLA )
34
jBase Directory Structure
/dev
– All external devices on the current system are described here.
/jbcmessages
– Contains all jBC error messages
– It may be edited by the user.
35
jBase Directory Structure
/include
– Various include files required at compile time are stored here.
/lib
– Contains all the libraries required for linking & executing jBC compiled
programs.
36
jBase Directory Structure
/src
– This directory contains any source code files that are distributed with
the current jBase release.
– It contains extended user exit support, templates for Makefiles and jEDI
interface code.
/tmp
– This is a general purpose temporary directory for runtime use.
37
jBase Directory Structure
38
jShell
39
jShell
• Why jShell?
– jShell provides a command line environment equivalent to DOS and
UNIX terminal modes.
• Features of jShell
– Easily customisable command line prompt
– Easy command recall.
40
Navigation in jShell
• BK
from globus 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
41
Sentence Stack commands
Cursor keys migrate through commands and position cursor for editing
- Home and End keys will also work if properly mapped
Control keys can also be used
p - previous command
n - next command
k - clear to end of line
b - left one character
w - delete to end of word
a - move to beginning of command
e - move to end of command
o - toggle insert/overwrite
42
jShell COMMANDS
43
jShell COMMANDS
44
COMMAND SYNTAX
45
COMMAND SYNTAX
46
COMMAND SYNTAX
47
COMMAND SYNTAX
jdir {<file_name>}
48
COMMAND SYNTAX
jrm –r <file_name>
jrm <record_name>
49
COMMAND SYNTAX
50
COMMAND SYNTAX
51
File Management in jBase
52
Files in jBase
53
File Types
54
Non-hashed Files
55
Non-hashed Files
56
Hashed Files
• Data and dict portions are divided into groups called Modulos
57
Structure of Hashed file Type J3
58
Structure of Hashed file Type J4
59
Hashed Files
60
CREATION AND MAINTENANCE OF FILES
61
How to create a Non Hashed file?
SYNTAX
CREATE.FILE <file name> TYPE=UD
62
How to create a Hashed file?
SYNTAX
CREATE.FILE <file name> TYPE=<file type> <dict portion> <data portion>
63
WORKSHOP
64
Non – Hashed File
Ex : CREATE.FILE JSL.BP TYPE=UD
Output :
File JSL.BP]D created, type = UD
File JSL.BP created, type = UD
65
Hashed File
Output :
File F.JSLEMP]D created , type = J4
File F.JSLEMP created , type = J4
66
Hashed File
69
FILE SIZING
70
JSTAT
• It is used to get the statistical information about static hashed files.It displays the file
type, modulo, number of bytes in the file and number of groups in the file.
Example : JSTAT FBNK.ACCOUNT
OUTPUT:
File ..\bnk.data\ac\FBNK.ACCOUNT
Type=J4 , Hash method = 4
Groups = 53 , Frame size = 4096 bytes , Secondary Record Size = 8192 bytes
Record Count = 608 , Record Bytes = 272508
Bytes/Record = 448 , Bytes/Group = 5141
Primary file space: Total Frames = 97 , Total Bytes = 272508
Secondary file space: Total Frames = 0 , Total Bytes = 0
71
RESIZE
• JRF is the command used to reorganize a file with a new file type, modulo,and
separation, or to change an existing non dynamic file to a dynamic file.
72
MAINTENANCE OF FILES
COPY
SYNTAX:
COPY FROM [SOURCE FILE]TO [TARGET FILE] record names
Eg: COPY FROM JSL.BP TO JSL1.BP RECORD.NAME
This command copied the record from JSL.BP to JSL1.BP.
73
MAINTENANCE OF FILES
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>
74
COMO
75
WHERE & WHO
WHERE
WHO
• Utility that displays the port number and the user for the
current process.
76
CT
77
OFF
The OFF command will close down all current jBase programs.
78
jQL
79
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.
80
List
List
To list all the records in a file for the given fields.
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.
List File Record
Eg. LIST FBNK.CUSTOMER "100161" "100068"
81
List
List Like
List file with Fields like ....
82
List
Soundex Selection
LIST FBNK.CUSTOMER NAME.1 WITH NAME.1 SAID "SUNN“
Will list only those records which sounds like “SUNN” and the retrieved value will
have ‘S’ as the starting letter.
83
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
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.
84
Sort
Calculations
TOTAL Calculate and display totals for numeric fields.
COUNT To count the number of records in a report.
LIST FBNK.ACCOUNT BY CUSTOMER BREAK-ON CUSTOMER TOTAL
WORKING.BALANCE
This command will give the grand total for each Customer along with the
break.
SORT FBNK.ACCOUNT BY CUSTOMER BREAK-ON "'P'" CUSTOMER TOTAL
WORKING.BALANCE
This command will give the grand total for each Customer and each record
will be displayed in a new page.
85
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.
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.
86
ESEARCH
This command will search for the string OFS in Globus.BP.
ESEARCH GLOBUS.BP
STRING:RADAR
STRING:
4 record(s) selected to SELECT list #0.
COUNT
To count the number of records in a file.
COUNT GLOBUS.BP
COUNT FBNK.CUSTOMER
87
Programming Basics in jBase
88
jED – Editor of jBase
89
jED
90
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.
91
jED Editor screen
3. The data editing area, which fills the rest of the screen.
92
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
93
jED COMMANDS
94
jED COMMANDS
<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.
<Back Space> Performs a destructive backspace.
<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. To
override, place "set delete-line = ^D" in the .jedrc file.
<Ctrl G> Sets the start or end position for marking a block of
text. The first <Ctrl G> will mark the start of a block or
mark a single line. The second <Ctrl G> with the cursor
on a different line will mark a complete block. The block
can be unmarked by pressing <Ctrl G> a third time.
95
jED COMMANDS
97
Copy and Move -
Blocks
98
WORKSHOP
99
WORKSHOP
100