Overview of Case Independence

1. Create Case Sensitivity Control

Because jBASE already has many customers who rely on their applications running as they currently do we have the ability to switch any new behavior on and off. Within jBASE there is a config file that lets user tailor how jBASE behaves, although many of the changes are aimed at supporting case sensitivity much of the new behavior is generic enough to be of use to existing users, a good example is that jQL verbs no longer have to be all upper case.

To enable this behavior you would to simply set case_insensitive_queries = true in the Config_EMULATE configuration file.

New config flags currently are:

These are described in more detail below.

2. jBASE Executables (jSH only)

When running in a jShell, all jBASE commands can be accessed in any case, this behavior can be controlled by setting case_insensitive_md = true.

For example to run jdiag from within a jsh you should now be able to do:

However this new behavior does not extend to your application program names and things outside of jBASE, like UNIX/Windows commands and C functions which are still case sensitive.

3. jBC

jBASE BASIC has been changed in the following area's.

3.1. Basic Source Code

New utility: jFormatCode

Format existing code

jFormatCode -f myfile source_name.b

Reformat older code so it can be compiled in jBase

jFormatCode -p -f myfile source_name.b

Get some help

jFormatCode -?

Code reformatting follows the these simple rules

This is intended for use when porting source into jBASE, the idea being simply that if everything has been through the same process then renaming variables and subroutines should not be an issue.

A good example to consider is that in some implementations of PICK, variables can be in any case, e.g.

abc = 1 Abc = 2 ABC = 3

Within jBASE you would end up with 3 versions of [abc]. After conversion, all instances of abc will be in the same case so jBASE will now work as expected. This will also apply to subroutine names, arrays and COMMON. It will also try and fix common issues like reserved words being used as variables, no spaces after GOTO, etc...

However it is not necessary to change anything. For example, if you want leave the source code as it is then the BASIC command as a new option (T) that will translate the code on-the-fly during the compilation stage.

BASIC myfile source_name.b (T

There is no emulation option to control this, it is always available regardless of which emulation options are / are not set. IOW, you can use the (T) option or jFormatCode at any time.

There is also a 't' option in the jed editor, e.g.

will 'fi'le, 'b'asic, 'c'atalog and call the code 't'ranslator.

3.2. Runtime Strings (String comparison within a jBC process and jQL)

At first glance this will look pretty straight forward as you could do something like:

With case sensitivity enabled the case of a string should not matter, abc is ABC. In jBASE currently case does matter, it uses standard C libraries for pattern matching, in-fact for almost everything.

To get over this issue whenever a string is assigned an upper case version of the string is also created. This version is used for all pattern matching, however when strings are to be displayed we use the original version.

A simple example in jbase could be as follows:

name = "Corwin"

LOCATE name IN employees SETTING pos THEN

   PRINT "found employee", name

When looking for "Corwin" in the list of names, we use "CORWIN", the list of names will also be in upper case so if it's in there we can easily find it. This additional version of the string should only be generated once and should have minimal impact on performance. Once enabled this behavior should be global, jQL should also behave the same way. This new behavior is controlled with the case_insensitive_runtime_strings emulation option.

4. Files

4.1. Filename case

All files listed on JEDIFILEPATH get added to an internal lookup, although this may seem like overkill internally whenever you try to open a file, jBASE will search all locations listed on JEDIFILEPATH until it opens the requested file. This will happen for every OPEN. Because the caching of filenames is only done when a new jBASE process starts, for most processes it should end up being a little more efficient as the internal cache of available files is also used by all child processes.

Typically most users may start by opening a jShell or some form of menu, any new processes started will always check cached names first.

There are exceptions, things like a new file is created by another user. In these cases files opened using the existing mechanisms and the cache is updated.

This new behavior is controlled with the case_insensitive_file_ids emulation option.

4.2. Record ids

All files should now support case-less record IDs. For example,

READ data FROM file, "abc" ELSE NULL READ data FROM file, “ABC” ELSE NULL

will return the same record.

In order to make record IDs case insensitive you will need to run the jchmod command with the +U option.

For example, to make the item-ids of both the dictionary and data section of a file called MYFILE case insensitive:

jchmod +U MYFILE

jchmod +U MYFILE]D

The first line is for the DATA section, the second is for the dictionary. If the file is large then it may take a few minutes to take effect as it has to build a cross-reference. For dictionaries, it should be nearly instantaneous.

In order to activate this new behavior you need to set the case_insensitive_runtime_strings emulation option to true in the Config_EMULATE file.

To reverse this:

jchmod -U MYFILE

jchmod -U MYFILE]D

You can query the jchmod status flags with the -t option, e.g.

jchmod -t MYFILE

To see all jchmod options:

jchmod -?

You can list which files currently support casing via LISTF.

























Any files that support casing will be shown in the CASING column.

5. jQL

5.1. Queries and Verbs

All jQL statements and verbs should now work in any case. The following 2 jQL statements will function identically with no need to create redundant dictionary records:

list myfile with account_balance gt "0" firstname lastname account_balance


Commands, verbs and dictionary's should be usable in any case. This behavior is controlled with the case_insensitive_queries emulation option. Note that case_insensitive_file_ids must also be set in order for the file name to be used in a case independent manner.

Setting the case_insensitive_runtime_strings emulation option will cause string comparisons to be case independent. For example, the following 2 jQL statements should list the same records:

list myfile lastname WITH with lastname = 'smith'

list myfile lastname WITH with lastname = 'SMITH'

5.2. Dictionary Items

Fields within the dictionary items are not yet full implemented. Attribute 1 and many conversions have been addressed and some formats currently work.

6. New commands

6.1. config-strings

This command displays the emulation options for a given emulation, the current emulation being the default if not specified.

cmd:     config-strings

desc:    Displays jBASE Config_EMULATE settings for a given emulation.

usage:   config-strings <<options>>

options: -help -emulation -list [email protected]


        -l -list, list sections in config_EMULATE

        -e -emulation <<mode>>, display section for a given emulation

           e.g. -e prime

        [email protected], show @ values

        -h -help, this page

e.g.    config-strings            - display setting for JBCEMULATE or default if not set.

        config-strings -e r83     - display setting for r83

        config-strings -e r83 [email protected]  - display setting for r83, also show @ values

        config-strings -l         - list sections in config_emulate

        config-strings -h         - this page

6.2. jFormatCode

This command reformats and parses jBC (BASIC) code to conform to the jBASE compiler.

cmd:     jFormatCode

desc:    formats existing code and ports BASIC code to jBASE.

usage:   jFormatCode filename

options: -file, -tabs, -parse, -diffs, -pause -replace, -quiet, -stamp, -confirm, -no_backup, -no_line_numbers, LPTR, -help

where:   -f -file, name of the file to read source from, default [.].

            -file /home/data/bp

         -t -tabs, number of spaces to pad and indent formatted source.

            -tabs 2,2

         -p -parse, call pre-parser to force code to conform to the jBASE compiler.

         -d -diffs, display line by line comparison of source during pre-parser.

         -pg pause output for each page. (q to quit)

         -r -replace, Overwrite original source with parsed source.

         -q -quiet, dont output source to screen.

         -s -stamp, add a time stamp to end of source.

         -c -confirm, dont ask if you really want to replace the file.

         -n -no_backup, dont create a backup of original version.

         -l -no_line_numbers, dont display line numbers in preview.

         LPTR, send to printer. (must be on end)

         -?, -h, -help, this page.

e.g:     jFormatCode -file /home/account1 -quiet -replace -no_backup my_prog.b

         jFormatCode my_prog.b LPTR

6.3. CASE

New command to control case sensitivity at runtime.

One issue within jBASE is that some commands and functions will behave differently if strings are case insensitive. It may be that 99% of the time its not an issue but when it is you can do:

To disable:


after issuing command case sensitivity will be disabled.

To enable it again simply do:


7. Updated Commands


Changed to should case sensitive files.


Changed to should case sensitive files.


Changed to allow code formatting at runtime.


Changed to allow code formatting at runtime.

8. New jBC statements


Just like the new CASE command, within a jBC program you may need to disable case insensitivity. This new jBC statement will simply disable case_insensitive_runtime_strings from within a jBC program, e.g.

x = 'HELLO'


IF x = 'hello' THEN CRT 'match' ELSE CRT 'no match'


IF x = 'hello' THEN CRT 'match' ELSE CRT 'no match'

Program output:


no match

9. Miscellaneous

For new users to jBASE there is now Pick style command stack in the jShell, .L, .X, .C.

Just enough to help with the transition.