0% found this document useful (0 votes)
191 views

Jbase Editor

This document describes how to create and maintain JR files in jBASE. After completing this course, learners will be able to create JR files, describe their features, read and write records, and understand how JR files automatically resize as records are added. The document explains that when a JR file is created, it is initially allocated 4KB of space for the header. As records are added, data frames of 4KB are dynamically created and pointers to these frames are stored in the file's internal hash table.

Uploaded by

Mamat Adouma
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
191 views

Jbase Editor

This document describes how to create and maintain JR files in jBASE. After completing this course, learners will be able to create JR files, describe their features, read and write records, and understand how JR files automatically resize as records are added. The document explains that when a JR file is created, it is initially allocated 4KB of space for the header. As records are added, data frames of 4KB are dynamically created and pointers to these frames are stored in the file's internal hash table.

Uploaded by

Mamat Adouma
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 53

1. Welcome to the “Creation and Maintenance of JR Files” learning unit.

This learning
unit will help you to work with JR files

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


1
After completing this course, you will be able to:

•Describe JR files
•Analyze the features of JR files
•Create a JR file
•Describe the header information of a JR file
•Analyze how to read and write records in a JR file
•Explain INTMODS
•Create a huge record
•Analyze the purpose of MINSPLIT
•Health check utility for JR files
•Analyze the environment variables related to CREATE.FILE command

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


2
1. You can classify files in jBASE into two major categories. The first type of files are
the hashed files and the second type of files are the non-hashed files. There are
many file types available in jBASE like UD, j3, j4, JR etc. In this learning unit, you
will learn about JR files. JR files are also called the resilient files. This type of file is
new in jBASE.
2. The best feature about these types of files is that, it supports automatic resizing.
You need not manually resize these files when it grows like in j4.
3. To create a JR file, you will specify TYPE=JR.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


3
You will now learn how to create a JR file in jBASE.

1. Use the command CREATE.FILE to create the file. Following the CREATE.FILE
command, you will specify the file name. In this example the file name is
TRAINING.JR. The file name will be followed with the file type. To create a
resilient file, the file type will be JR.
1.2 On executing the command, a data file and a dict file will get created. The
name of the data file is TRAINING.JR and name of the dict file is
TRAINING.JR]D. Creating a JR file is similar to creating any other type of
file in jBASE.
2. After creating the JR file TRAINING.JR, if you check the size of the file, it will be
4096 bytes. Yes, on creating a JR file, jBASE will allocate only 4k of space for the
file. In the coming few slides, you will learn what is the purpose of this 4k space is
and also how a JR file grows.

When a JR file is created, the initial size of the file is 4k. This 4k (4096 Bytes) is meant
for the header of the file.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


4
1. Use the command jstat to obtain the statistics of the JR file. jstat command with
the option –v will give a descriptive statistic on a jBASE file. On executing the
command jstat –v TRAINING.JR, you can see the following details.

File Path : Holds the full path and the name of the file
File Type : JR signifies that the file is a resilient file
Hash Method : Default hash method for JR files is 5. This will tell you the hashing
algorithm being used for this file. There are many hashing algorithm available.
Created : Holds the date and time when the file was created
Frame size : Size of a frame that will be created to hold data

File Size : Size of the file on disk


Accessed And Modified : Holds the date and time when the file was last accessed or
modified
Record Bytes : Holds the size of the records in the file.
Record Count : Holds the number of records in the file.
Bytes/Record : Holds the average size of a record.
Bytes/Group : Size of each data frame.
Data Frames : Holds the number of data frames allocated.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


5
1. Assume that when the file TRAINING.JR is created, only the one group was
available in the header.
1.1 You will identify this group as 'Group 0'. This 'Group 0' is an internal hash
table. An internal hash table can only store pointer information, and these
pointers will point to data frames that actually contain data.
1.2 If you notice the internal hash table has only three modulo. This gets
created by default.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


6
You will now see what happens when a user inserts the first record Into a JR file, in a
flow.
1. User inputs a record with ID 1.
2. jBASE calculates a hash value based on the ID of the record, value returned by
the hashing algorithm will be in the rage of 1 to 3 as there are 3 internal modulo in
'Group 0'.
3. Let us consider that the result of the hashing algorithm is 1.
4. Modulo 1 in 'Group 0' is locked.
5. A data frame of size 4k is created and the record is placed in it.
6. While modulo is locked, the address of the data frame is written to the locked
modulo, P1 represents a pointer to data frame 1.
7. After writing the pointer, the lock on modulo 1 is released.

jBASE maintains an internal table to store pointers to data frames that it creates. The
first internal table is referred to as 'Group 0' and will contain 3 internal modulo to
store pointer information. When a record needs to be inserted into the file, jBASE
calculates a hash value based on the ID of the record. Since there are 3 modulo
available in 'Group 0', jBASE will return a value in the range 1 to 3. Based on the
value returned, the appropriate modulo in 'Group 0' is locked. A data frame of size
4096 Bytes is created and the record is placed there. The address of the data
frame is written on to the locked modulo. Lock on the modulo is then released.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


7
JBS4.Creation And Maintenance Of Files In jBASE 5-R15
7
1. Let us now try to understand the file statistics after inserting a new record in the
file. If you notice, values of few parameters have changed.

Record Bytes : Holds the size of the records in the file at present. In this case, holds
the size of the 1st record that was input
Record Count : Holds the number of records in the file. In this case, it is one.
Bytes/Record : Holds the average size of a record. Since there is only one record in
the file now, the ‘Record Bytes’ and ‘Bytes/Record’ are the same
Bytes/Group : Size of each data frame.
Data Frames : Holds the number of data frames allocated. This is the most crucial
point to understand. To store the one record that we input, a data frame of size 4096
bytes has been allocated. Note that space gets allocated as and when required and
not at the time of creating the file like J4 files.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


8
Now let us see what happens when a user inserts a second record.

1. User inputs a record with ID 2.


2. jBASE calculates a hash value based upon the ID of the record.
3. Let us assume that the result of the hashing algorithm is modulo 2.
4. Modulo 2 in 'Group 0' is locked.
5. A new data frame for modulo 2 is created and the record is placed in this data
frame.
6. While modulo is locked, the address of the data frame is written to modulo 2, P2
represents a pointer to data frame 2.
7. After writing the pointer, the lock on modulo 2 is released.

By now you should understand that for each internal modulo one data frame will be
created as and when required.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


9
Now let us see what happens when a user inserts a third record.

1. User inputs a record with ID 3.


2. jBASE calculates a hash value based upon the ID of the record.
3. Let us assume that the result of the hashing algorithm is modulo 3.
4. Modulo 3 in “'Group 0'” is locked.
5. A new data frame for modulo 3 is created and the record is placed in this data
frame.
6. While modulo is locked, the address of the data frame is written to modulo 3, P3
represents a pointer to data frame 3.
7. After writing the pointer, the lock on modulo 3 is released.

Like J4 files, data will always be evenly spread and stored across data frames pointed
by internal hash table ('Group 0'). Since there are 3 internal modulo in group 0,
there can be a maximum of 3 data frames at this level. Each data frame can
contain data (records) up to the size of 4096 bytes. Each internal modulo holds
pointers to its data frame. As you would have noticed, data frames get created as
and when required and not at the time when the file is created. As you can see,
there is no upper limit for the file size. We haven’t specified any file size until now.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


10
After 10 records have been input into the TRAINING.JR file, following is the statistics
of the file.

Record Count is ten


Data Frames is three

The statistics say that till now ten records have been stored in the JR file and up to
three data frames have been used.

Now that you have understood how records are stored in the JR files. Now let us see
what happens when records are deleted from a JR file.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


11
1. First note down the size of the JR file before deleting any record. Depending
upon the operating system on which jBASE is installed, this command will change.
You can also use the jstat command to check the size of the file.

2. Now delete a record from the file. The command to delete records from a file is
DELETE. This command is followed by the file name and then the record id. In our
example , the command will be DELETE TRAINING.JR 1

3. Now check the size of the file again. If you notice the file size would not have
changed. In jBASE, once space is allocated for a file, it will not be de-allocated on
deleting any record.

4. The Record Bytes value is 168, previously it was 222.


5. The number of records is nine, previously it was ten.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


12
In all the scenarios you have seen so far, the data frames were not full. Now you will
learn, how JR files behave when data frames are full. Let assume a scenario
1. A user inserts a record.
2. jBASE hashing algorithm calculates the frame into which this new record has to be
placed.
3. Let us assume that the result is modulo 1.
4. The data frame pointed by modulo 1 is full.
5. When any one of the data frames are full or do not have enough space to store the
new record the existing data in the frame is re-hashed into the second set of data
frames.
6. jBASE will extract the data from the original data frame, calculates a hash value
based on the IDs of the records, the hash value returned will be in the range 1 to 7
as we are now at the second level. Up to 7 new data frames will be created based
on the number of records and the hash value that jBASE returns. You must
remember that all the seven frames will not be created at one shot, depending
upon the requirement frames will get allocated. To the maximum 7 frames will get
created. Data will be placed in the new data frames.
7. The original data frame will be marked as free so that it could be re-used at next
level.
8. You learnt about the internal table ‘Group 0’ which held pointers to 3 data frames.
The next internal table in jBASE is called ‘Group 1’. This group is capable of
storing pointer information of up to 7 data frames.
9. Pointer information will be written into ‘Group 1’ so that it points to the data frames

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


13
that have been newly created. Pointer information of ‘Group 1’ is written on to the
appropriate modulo in ‘Group 0’.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


13
Now if you check the statistics of the JR file

The value of Data Frames is 6. As you already know that it contains the number of
frames that actually contain data. In our example, two frame belongs to ‘Group 0’ and
four frame belongs to ‘Group 1’.

If you take a look at the Record Count you now have eight records in the file.

The Free Space contains the value one to denote the data frame that initially
contained data has now been marked as free for future use. This is the data frame
whose data has been rehashed into four new data frames.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


14
This is how the JR file will look like after all initial data frames have been rehashed.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


15
'Group 0': When the JR file was created, initially there was only one internal hash table
available, with three modulo.

'Group 1': When the data frames pointed by the first hash table became full, the data
frames were re-hashed and a second set of internal hash table were created with
seven modulo each.

'Group 2': Likewise, when the data frames pointed by the second hash table became
full, the data frames were re-hashed and a third set of internal hash tables were
created with 19 modulo each.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


16
Let us view the statistics Of The File After 17 Records Have Been Input

Data Frames : There are 12 data frames that contain data now
Record Count : We have 17 records in the file now
Free Space : There are no free frames now. The data frame that was marked as free
has now been used by jBASE and hence the value ‘0 frames’

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


17
• Why should ‘Group 0’ contain 3 internal modulo and ‘Group 1’ contain 7 internal
modulo?
• The number of internal modulo for ‘Group 0’ and ‘Group 1’ can be
parameterized.
• In fact there is another group called ‘Group 2’ which can contain up to 19
internal modulo. This can also be parameterized
• In the CREATE.FILE command, we can specify
• Up to 3 internal hash table modulo
• The default values are 3, 7 and 19. Hence
• ‘Group 0’ contains 3 internal modulo
• ‘Group 1’ contains 7 internal modulo
• ‘Group 2’ contains 19 internal modulo

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


18
1. The internal modulo that a user can specify must
1.1 be prime numbers
1.2 not exceed a cumulative product of 485
( x + x*y + x*y*z)
2. These values can be specified with the CREATE.FILE command using the
INTMODS option.
3. You have specified INTMODS = 3,5,7.
4. If you check the statistics of the file, Internal Modulo is 3/5/7

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


19
Temenos recommends default INTMODs of 3,7 and 19. Do not change INTMODs

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


20
1. When data could not be fit into the 3 data frames allocated for ‘Group 0’, data
was re-hashed into data frames belonging to ‘Group 1’
1.1 Maximum data frames that can exist at ‘Group 1’ level is 7 for each of the
3 ‘Group 0’ internal modulo

2. Similarly, when data cannot be fit into the frames that belong to ‘Group 1’, data
will be re-hashed into data frames of ‘Group 2’
2.1 Maximum data frames that can exist at ‘Group 2’ level is 19 for each of the
7 ‘Group 1’ internal modulo

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


21
When data is re-hashed from 'Group 1' to 'Group 2', steps similar to the ones that you
have learnt so far will apply
1. New data frames up to 19 will be created
2. Data will be re-hashed into the 19 data frames
3. Pointer information will be updated in 'Group 2', it will hold pointers to the
data frames
4. Pointer information will be updated in 'Group 1', it Will hold pointer to
internal hash table 'Group 2'
5. Original data frame will be marked as free for future use

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


22
19 Data Frames For Each Of The 'Group 2' Modulo have been allocated.

This slide represents data frames that can get created for internal hash table 'Group 2'
and shows linkages only for the first part

Once data frames for 'Group 2' modulo have been created you can have unto a
maximum of 399 data frames each of size 4096 bytes. That is 3 * 7 * 19 = 399 data
frames. File Size would be 399 frames * 4096 Bytes = 1634304 Bytes.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


23
First, what is considered a huge record?
A record that is greater than or equal to the size of OOG Threshold is considered a
huge record. OOG stands for Out Of Group storage. The default value of OOG is 2048
bytes.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


24
You can define OOG Threshold value using the SECSIZE option with the
CREATE.FILE command.

Note : The above command has been executed on Windows to state the fact that JR
files work the same on Windows as well as Unix

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


25
What Happens When A Huge Record Is Inserted Into The File?
1. User inputs record with ID 4
2. jBASE calculates a hash value based on the ID of the record
3. Assume that the resulting modulo is 3
4. Data is bigger than OOG Threshold
5. Create as many OOG frames as required and store the data. Make data frame of
modulo 3 point to the OOG frame

P1, P2 and P3 represent pointers to data frames 1, 2 and 3 respectively. Each OOG
Frame will be of size 4096 bytes like other data frames. Depending on the size of the
record, required number of OOG frames get created and data is split and stored
across these OOG frames. When data is stored in more than one OOG frame, the
OOG frames maintain pointers to the other OOG frames that have been created to
store the record (Like a link list)

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


26
1. When a record greater than or equal to the size of OOG Threshold is inserted
1.1 Data is stored in out of group frames (OOG Frames)
1.2 The size of the record determines the number of OOG frames that get
created
1.3 Record will be split and stored across the OOG frames that have been
created for the record
1.4 Each of the OOG frames will hold pointer information to the next OOG
frame (Like a link list)
1.5 The main data frame will hold pointer information to the first OOG frame
1.6 Compare this to ‘Secondary File Space’ in J4 files

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


27
Analyze the statistics of the file now.
There are totally 18 records in the file.
The last record inserted, was bigger than 2048 bytes. Hence, 2 OOG frames have
been created and data has been split and stored there.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


28
Assume record number 18 has been deleted. Let us analyze the statistics of the file
now.

The OOG Frames value you see above get marked to 0 to denote that there are no
OOG frames for the file now
Frames allocated to a JR file are never de-allocated unless the file is deleted. The
OOG frames have now been marked as free frames for re-use

Compare the size of the file on disk with the screen shot in the previous slide. Note
that the size on disk is not the same in both

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


29
You know that the maximum number of data frames that we can have once we have
reached 'Group 2' is 399. Here, the number of data frames is 403 and the number of
Pointer Frames is 38.

What does this signify?

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


30
For ease of understanding and to avoid clutter, only part of the JR file is described
here. Consider that all data frames are full.

1. User inputs record with ID 2981


2. jBASE calculates a hash value based on the ID of the record
3. Assume that the result is modulo 1.
4. No space in the data frame
5,6,7 Re-hash data in the data frame into a maximum of 31 data frames and make the
original data frame a pointer frame
8. Data frame that has become pointer frame
9. Data frames other than the initial 399 that have been created

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


31
If all 399 data frames have been created and If there is no space to hold new data,
what happens next?
The data frame that does not contain space to hold new data becomes a ‘Pointer
Frame’. A Pointer frame is one that points to data in another data frame. New data
frames referred to as ‘External Data Frames’ (Up to 31) are created for each pointer
frame and the data is re-hashed into the new data frames.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


32
Is the number 31(Number of external data frames) hard coded? Can’t it be
parameterized?
The value can be parameterized using the EXTMODS option in the CREATE.FILE
command.

Is there a health check utility for JR files?


Yes. The command is jrscan which is similar to jcheck for J4 files. We will discuss
about this command as we proceed further.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


33
Usage of EXTMODS is explained in the screen shot.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


34
Is there a way to pre-allocate size for a file, on creation?
Yes. The size of the file (at creation time) can be set using the option MINSPLIT in the
CREATE.FILE command. By default, the value of MINSPLIT is 0. This implies that the
size of the file when created is 4096 bytes and when 399 data frames are not
sufficient, up to 31 data frames will be allocated for each data frame that overgrows.
Specifying a value for MINSPLIT pre-allocates space for the file. Let’s see how.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


35
MINSPLIT has to be used with caution as it pre-allocates space for a file. The value for
MINSPLIT can be set in the range from 0 till 4.
The MINSPLIT value forces a table to be created with a minimum split level and would
normally be used only where the future data population is known to be large and will
remain large throughout the lifetime of the file.

1. When MINSPLIT is set to zero, by default 4096 bytes is allocated


2. When MINSPLIT is set to one, the calculation is (3*7*19)*4096 bytes
3. When MINSPLIT is set to two, the calculation is (3*7*19*31)*4096 bytes
4. When MINSPLIT is set to three, the calculation is (3*7*19*31*31)*4096 bytes
5. When MINSPLIT is set to four, the calculation is (3*7*19*31*31*31)*4096 bytes

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


36
What you see here is statistics of a file when MINSPLIT is set to 1

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


37
As the internal structure of JR files differs from hashed files, new utility ‘jrscan’ which
offers similar functionality as ‘jcheck’. The options available are

-a - Show header values


-b - Bitmap scan – verify frame use
-h - Display help
-i - Display internal hash table
-k - Display record keys
-ln - Set split level to n
-s - salvage data to SLVG_ prefixed copy of file
-v - verbose output

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


38
When jrscan is used with –v (verbose) option for a file , we get following details

1. Header information, offset for each of the level


2. The total file size, number of data bytes, number of items, number of OOG frames
3. Total data frames for each of the levels etc

In the screenshot shows the result of jrscan on FBNK.SECTOR. This file has 45
records with 3 data frames.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


39
1. In an ideal situation JR files does not get corrupted since its has auto-resizing
feature.
2. On rare occasions, when number of OOG frames are in large numbers, there is a
chance that file can get corrupted
3. Result of jstat and jrscan commands can be used to determine whether the file is
corrupted
4. SELECT command on the file also shows error

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


40
1. When jstat command is triggered on the file with verbose option, along with the file
details HASH error and Scanfile: Bad termination is shown.
2. We can note that for the given example, the number of OOG frames is in large
number with no free frames
3. SELECT command also throws error message

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


41
1. Overly sized files can be salvaged using jrscan with –S option
2. At the jsh prompt, jrscan -Sv salvage with verbose option
3. The salvaged data is written with an prefix SLVG_<file name>
4. Salvaged data can be viewed with the command SELECT SLVG_F.<file name>
5. Salvaging JR files can result in data loss

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


42
Now you will learn about two CREATE.FILE related environment variables.

1. If you set some value to the environment variable JEDI_PREFILEOP, it gets


defaulted while using the CREATE.FILE command. Let us understand this with an
example.
1.1 Set a value “TYPE=JR LOG=NO” to this variable, you can use the
command export JEDI_PREFILEOP = “TYPE=JR LOG=NO” if you are
working on UNIX.
2. Now create a file just by giving a command CREATE.FILE followed by a file name.
Let us consider for example CREATE.FILE TRAINING.TEST
2.1 Now check if you have got the values set in the environment variable. Use
the jstat to do this. Can you see the Type set to JR and Log set to NO.

Remember that value specified in this variable takes more precedence over the value
supplied in command line for the CREATE.FILE command.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


43
Let us now look into the next environment that CREATE.FILE uses.

1. This variable is the same like JEDI_PREFILEOP, If you set some value to the
environment variable JEDI_POSTFILEOP, it gets defaulted while using the
CREATE.FILE command. But you should remember that value specified in this
variable can be overridden using the CREATE.FILE command.
2. Let us understand this with an example.
1.1 Set a value “TYPE=JR LOG=NO” to this variable, you can use the
command export JEDI_POSTFILEOP = “TYPE=JR LOG=NO” if you are
working on UNIX.
3. Now create a file using the CREATE.FILE command followed by a file name,
also specify the file type as J4. Let us consider for example CREATE.FILE
TRAINING.TEST TYPE=J4 1 1
2.1 Now check if you have got the values set in the environment variable. Use
the jstat to do this. If you notice, though you have set JEDI_POSTFILEOP
to TYPE=JR, the file type of the file you created just now is J4, this is
because you have given TYPE=J4 in the CREATE.FILE command. As
already said, the value specified in the CREATE.FILE command takes
more precedence when compared to the variable JEDI_POSTFILEOP

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


44
1. Should all T24 files be JR ?
1. No. It is not mandatory that all T24 files be JR files.
2. If not, what T24 files should be changed from J4 to JR ?
1. Files that are currently distributed in jBASE 4, can be made JR.
3. How do JR files perform in comparison to J4 ?
3.1 A badly sized J4 file will be much slower than a JR file
3.2 An aptly sized J4 file will be faster than a JR file
4. What is the disk usage profile of JR when compared to J4 ?
4.1 For both JR and J4 type of files, once space is allocated on disk they are
not de-allocated until the file is deleted

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


45
1. Let us create a J4 file by name TRG.J4. Now if you wish to convert this j4 file into
a JR file, it is possible.
2. Use the command jrf with –H6 option with the J4 file name. jBASE will convert the
J4 file into a JR file.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


46
1. Let us create a JR file by name TRG1. Now if you wish to convert this JR file into a
J4 file, it is possible.
2. Use the command jrf with –H4 option with the JR file name. jBASE will convert the
JR file into a J4 file.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


47
JR files are multilevel hashed files which contain data frames linked by hierarchies of
pointer frames, all contained in a single physical file. There is a small hierarchy of
modulo in the file header through which all item ids are hashed before being written.
Data and pointer frames are allocated only as required. The split modulo¹ determines
the hierarchical order, i.e. the number of pointers per pointer frame (node) within the
hierarchy. The split modulo can be configured at file creation with reference to the
likely number and type of keys.

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


48
Let us look into some additional characteristics of a j4 and JR file

Backup: When set to YES, file will be backed up when the jbackup command is
executed, the default value is YES. You can change this value by issuing the
command jchmod +B <File Name> to grant and jchmod –B <File Name> to revoke
backup feature.

Log: When set to YES, any DML (Data Manipulation Language) on the file will be
recorded by jBASE Transaction Journaling, provided jBASE Transaction Journaling is
started. Its default value is YES. You can change this value by issuing jchmod +L
<File Name> to grant and jchmod –L <File Name> to revoke log feature.

Rollback: The Rollback flag indicates if a file is subject to transaction boundaries. Its
default value is YES. If unset, it will have an impact on the way jBASE Transaction
Journaling journals data. To grant Rollback use the command jchmod +T <File
Name> and to revoke use the command jchmod –T <File Name>

Network: It is set for files that are NFS mounted so that jBASE can place byte locks
on them. Its default value is NO. It is not used by JR files as JR files use jDLS for
locking. Applicable only for J4 files. The command to grant this feature is jchmod +N
<File Name> and to revoke the command is jchmod –N <File Name>.

Secure: The file is flushed at critical junctures such that any file update will rely only
on a single disk write. This maintains the file structure in the event of system failure.
Set so that file structure never gets corrupt. Its default value is NO. It is applicable only
to JR files. It can affect performance if set. The command to grant this feature is
jchmod +S <File Name> and to revoke it is jchmod –S <File Name>

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


49
1. TRUE
2. FALSE – It stores only pointer information
3. TRUE
4. TRUE
5. FALSE – jcheck is for J4 type of files
6. TRUE

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


50
In this course, you learnt about the JR files

You will now be able to

•Describe JR files
•Analyze the features of JR files
•Create a JR file
•Describe the header information of a JR file
•Analyze how to read and write records in a JR file
•Explain INTMODS
•Create a huge record
•Analyze the purpose of MINSPLIT
•Health check utility for JR files
•Analyze the environment variables related to CREATE.FILE command

JBS4.Creation And Maintenance Of Files In jBASE 5-R15


51

You might also like