| Bookmark Name | Actions |
|---|
jBASE Tools
jBASE is a Database Management System comprising development tools, middleware and a multi-dimensional database. This section describes the tools used in jBASE.
The ED editor provided with jBASE is a limited version of the familiar (but now superseded) ED editors.
You are strongly advised to use the jED editor in preference to ED. No operating system is included for the ED editor.
If you are only familiar with the old style ED editor, continue to use it in your accustomed fashion.
jSHELL has been designed to ease migration from older systems, and to overcome some of the differences between various platform command line environments. It is an interactive tool for learning the Java programming language and prototyping Java code. JShell is a Read-Evaluate-Print Loop (REPL), which evaluates declarations, statements, and expressions as they are entered and immediately shows the results.
The jsh command invokes jSHELL (the jBASE shell). It can be invoked as your login shell by using the normal system administration software supplied with the platform, either via *.bat files (Windows) or *.profiles (UNIX).
The most noticeable difference between jSHELL and other command line shells (such as the UNIX Korn shell (ksh)) is that command line arguments such as * and ? are not expanded by the shell but passed directly to the command that has been invoked. In same manner, quoted strings (such as “quoted string”) are passed directly to the command with quotes intact. This enables query language statements such as:
SSELECT file = “[SPROUT]” BY *A1 –
Issued directly from jSHELL. If the same command was issued from the ksh Prompt, then it would have to be issued as:
SSELECT file = \”[SPROUT]\” BY \*A1 –
This avoids the quotes being removed and the * being expanded by the Korn shell.
Beyond this convenient feature, jSHELL also offers many significant advantages over traditional shells and is easier to use. Some of the main features of the jsh are:
- Easily customised command line prompt
- If required commands can be passed to other shells
- Easy command recall
- Easily identified special prompt when a select list is active
- Long program names are automatically translated to their new names on SVR3.2 systems
- Run jCL programs directly from jBASE hashed files
- Supports command type-ahead
Command syntax for jsh is:
jsh - -c command -s shell -p Prompt
| Option | Description |
|---|---|
|
- |
Execute proc from MD/VOC file with same name as user login (on UNIX the .profile and .jshrc files are processed) |
|
-c command |
Specifies that a jsh process should be spawned to execute command. When the command terminates, the jsh process will also terminate. |
|
-s shell |
Specifies which shell emulation to use when executing jsh. The jsh will default to the previous emulation used by the current port. |
|
-p Prompt |
Specifies the Prompt to be used while executing jsh. |
|
-t |
Opens the tty device and accepts commands from the keyboard when the jSHELL has been invoked to process a command input file. The default action is to exit the shell once the processing of the input file has been completed. |
|
-z foreground, background |
Select foreground and background screen colors (example, jsh -z foreground,background). Colors can be WHITE, YELLOW, MAGENTA, RED, CYAN, GREEN, BLUE or BLACK. On Windows 95/98, the defaults are BLUE foreground and WHITE background (which is, jsh -z will be blue on white). On Windows NT/2000, colors can be globally set using the console setup from the control panel or by selecting the properties of a jShell shortcut. |
Before getting started, you should log in to your UNIX system and set your position at the shell prompt. If your user account has not been configured to run jSHELL by default, then execute it and complete the following:
exec jsh –
The default jSHELL prompt should now appear.
jsh user cwd -->
User is your login name and cwd is your current working directory. For this exercise, assume that your login name was jBASE and that your current working directory is the home directory for jBASE. In this case, your prompt will look like this:
jsh jBASE ~ -->
The tilde character (~) is a shorthand method of referring to your home directory. The shell expands this character to the full path name of your login home directory before executing commands. If you had changed to a sub-directory called source, then your prompt will look like this:
jsh jBASE ~ --> cd source jsh jBASE ~/source -->
You can change the primary or secondary default prompts by using the following commands:
jsh jBASE ~ -->set jps1 newPrompt jsh jBASE ~ -->set jps2 newPrompt
newPrompt is a string defining the new prompts. The string can contain terminal control characters such as a bell character by specifying special character sequences in the newPrompt string. The character sequences allowed are:
| Sequence | Replaced With |
|---|---|
|
$EnvVar |
The value of the specified environment variable |
|
$%a |
The user account name |
|
$%m |
The phrase (Cmd) if the shell is in command mode |
|
$%n |
The new line sequence |
|
$%C |
The current working directory |
|
$%c |
The current working directory with any portion matching the home directory replaced with ~ |
|
$%p |
The port number |
|
$%e |
The entry number in the stack currently being edited |
|
$%d |
The current date in dd mmm yyyy format |
|
$%t |
The time of day in hh:mm:ss format |
|
$%u |
The host name as defined by the UNIX command uname (UNIX only) |
|
$%y |
The tty name (UNIX only) |
|
$%s |
The name of the jshelltype that will execute the commands at the prompt |
|
Chars |
All other characters are taken as literals and included in the prompt |
The shell operates in two distinct modes each having a separate function.
- Command mode is used to issue all commands to jsh itself
- Operating mode is used to issue all commands to the system
There is only one command available in the current implementation of jsh (the / command). This character introduces a search string to jsh. The search string is compared against every command in your command history and if a match is found, then the command is recalled as the current command. Pressing the Esc key on your keyboard normally enters command mode.
If you include the $%m sequence when you configure the prompt, then the prompt will change to indicate whether you are in the shell command mode. For example, if the prompt is in its default state, then the following sequence will locate the last cd command in your command history.
jsh ~ --><Esc> jsh ~ (Cmnd) -->/cd jsh ~ -->cd source
Note the appearance of the (Cmnd) string as part of the prompt on the middle line.
Two other keystrokes within jsh allow you to recall up to 50 previous commands. They are:
- <Ctrl P> – Go to previous command
- <Ctrl N> – Go to next command
Using these two keystrokes allow you to retrace your commands by stepping backwards or forwards one command at a time. If you need to change any part of a command line, it is very easy as the jsh supports command line editing by using a subset of the jED editor keys.
In particular, you can use the right and left arrow keys to move the cursor to any position in the current command string. The jsh is configured for editing in insert mode by default. This means that any characters you type will be inserted just before the current cursor position. Use the Backspace key to delete the previous character and the Delete key to delete the character directly under the cursor.
The jsh can be placed into overwrite editing mode by pressing <Ctrl O>. In this mode, all typed characters will replace the character under the cursor.
The following table shows all the editing commands:
| Keystroke | Command |
|---|---|
|
<Right> |
Move the cursor right by one character |
|
<Left> |
Move the cursor left by one character |
|
<Home> or <Ctrl A> |
Move the cursor to the start of the command line |
|
<End> or <Ctrl E> |
Move the cursor to the end of the command line |
|
<Down> or <Ctrl N> |
Recall the next command in your history |
|
<Insert> or <Ctrl O> |
Toggle Overwrite or Insert mode. Default is Insert. |
|
<Up> or <Ctrl P> |
Recall the previous command in your command history |
|
<Ctrl L> |
List the command history maintained by the shell |
|
<Ctrl K> |
Delete from the cursor to the end of the command line |
|
<Ctrl W> |
Delete from the cursor to the end of the current word |
|
<Tab> |
Move to the start of the next word |
|
<Backtab> |
Move to the start of the previous word |
If you are already familiar with operating UNIX under other shells, then jsh will allow you to work in the environment with which you are most comfortable. You can switch between the various emulation modes in jsh by using the function keys:
| Key | Function |
|---|---|
|
F1 |
jSHELL (jsh) |
|
F2 |
Native Platform Shell (CMD.exe, ksh, csh, etc) |
|
F3 |
Mixed shell (msh) |
Some terminals may not support these function keys. If your terminal does not support the F1, F2 and F3 function keys, then the emulation mode can be modified by the jsh internal command jshelltype. The command syntax is:
jshelltype shell
jshell can be one of the following:
- jsh – Pre-processes Meta characters like the asterisk (*), as expected by legacy systems.
- sh – Native system shell on UNIX depends on NT/Win95 CMD.exe.
- msh – Mixed shell. Pre-processes Meta characters as a combination of jsh and sh.
- msh – Mapped Sequences
Options specified on the command line will have the leading bracket escaped. For example:
CT File1 Record1 (X becomes CT File1 Record1 \(X
Any asterisk used as part of a record specification is escaped. For example:
CT File1 * becomes CT File1 \*
Quotes used in a selection criteria specification are escaped
LIST File1 WITH A1 = “XYZ]” becomes LIST File1 WITH \*A1 = \”XYZ]\”
Other Meta characters are untouched so that pipes, etc. can be invoked.
The Encrypt utility provides simple encryption or decryption of files using a user specified key.
Encrypt –k key File > EncryptedFile Encrypt –d –k key EncryptedFile > File
The errmsg tool displays the platform related error message text when used with an error message number.
errmsg 13
The had utility displays any file in a hexadecimal format. Specification of a hexadecimal offset denotes the start of the display.
had –offset
The jcomp utility provides a mechanism to compare two Hash files or directories.
jcomp -Options FileName (Options
Where, options can be any of the following:
| Option | Description |
|---|---|
|
-L or (L |
Restrict error display to single line |
|
-N or (N |
No paging |
|
-P or (P |
Output to printer |
|
-S or (S |
Suppress matching records |
|
-T or (T |
Trim source before compare |
|
-V or (V |
Verbose display of non-matching records |
The jcover programs provide a mechanism to generate statistical information on the coverage of an application during a test run. You can use it to calculate the percentage of code that was executed, percentage of code that was not executed, what sources were not used in files and so on.
The usage of jcover depends upon much of the existing profiling tools. The jcover utility can be used to great advantage with the jkeyauto utility. Using both these utilities together can build up highly automated scripts that will automatically test new releases of software and ensure that a known percentage of your entire application gets executed as well as ensuring that all paths through your application are executed and tested.
Using jcover involves the following key steps:
- Run the application and record the information.
- Collate the recorded information.
- Report the jcover information.
This phase involves running your application in a certain manner and allowing jBASE to record the statistics about the lines of code that were executed during the running of the application. jBASE can record the information using the following mechanisms:
- Use the -JC option to the program. For example:
% MYAPPLICATION -JC COMMANDARG ETC ETC
In the above example, when the MYAPPLICATION application terminates a file called jprof, the activity will be written to the current working directory, which contains all the profiling information for this application.
- Set the JBCPROFILE environment variable to 3. For example:
% JBCPROFILE=3 % export JBCPROFILE % MYAPPLICATION COMMANDARG ETC ETC
In this second invocation jBASE will create a file in the format jprof_mmmmm_nnn. One file for each program that is executed, where mmmm is the process ID and nnn is the perform or execute level. In this way, you can generate multiple copies of profiling information which will automatically include all executed procs and programs. Each file will be stored in the current working directory as of when the application was loaded.
Remember to unset the JBCPROFILE environment variable when you are finished, otherwise you will find a very large number of the profiling files accumulating your directory. It might be useful to run your application through a jkeyauto script. In this manner, you can accurately repeat a test case through your application and repeatedly use the jcover tools to ensure as much as possible percentage of your application is executed.
At the end of the recording phase, you will have one or more profiling files. These profiling files can then be used in the second stage of jcover profiling. Remember that as UNIX files they can be easily moved and renamed. For example, you can run a number of test cases using the -JC option and each time rename the generated jprof file, such as jprof_a, jprof_b and so on.
In the next phase, you can supply multiple file name for renaming.
Once you have recorded one or more profiling files as shown in the previous section, you are ready to collate all the information. The following is the function of the jcover program. The jcover program can be run as below:
jcover {-fFilename {-fFileName ...}} {-oOutputFile} {-ddelim} {-e} {-h|?} {-u} {-x} {jprof {jprof ...}}
Where,
- -ddelim – Change the delimiter in output records from '*'.
- -e – Write out verbose details of all lines of the executed code.
- -fName – Name of file to extract source from.
- -h | -? – Help screen output.
- -oOutputFile – Output file name.
- -u – Write out details of unused source code in the supplied input files.
- -x – Write out verbose details of all lines of not executed code.
- prof – Profile name.
By default, the function takes the input UNIX file jprof, extract some statistical information about it, and write it back to a newly-created file called jcover_nnn, where nnn is the port number. It also creates suitable dictionary items.
The default information stored is a summary of the percentages of all source items executed. You can use the -e, -u and -x options to create additional statistical information.
The -oOutputFile option allows you to specify an alternative output file to jcover_nnn. If this option is not used, then it defaults to jcover_nnn and create the file if necessary. Whatever file name you choose, both the DICT and the DATA section is cleared and suitable DICT items are written for later usage.
Once this phase is complete, you will have an output file ready for use with the final phase.
This third phase requires the use of the file created in the second phase. For convenience, call it as jcover_23, but it can be any filename used as the output of the jcover program.
There are basically three ways of using the information created in jcover_23.
- Using jQL with the default DICT macros
To show a summary of percentages of coverages, use:
LIST jcover_23 STATS
To show a summary of general information, such as times, dates, files used and so on, use:
LIST jcover_23 GENINFO
If the -e option was used, you can display a list of all the lines of source code executed with:
LIST jcover_23 EXEC
If the -x option was used, you can display a list of all the lines of source code not executed with:
LIST jcover_23 NOTEXEC
If the -u option was used, you can display a list of all source items that didn’t have any code executed during the application execution.
LIST jcover_23 NOTUSED
- Using jQL with your own command line
This involves using a jQL statement with something other than the supplied macros. For example:
LIST jcover_23 WITH S.ITEMID EQ “MAR]” S.ITEMID
- Using a jBASE BASIC program
Refer to the layout of the output file and the dictionaries to write your own jBC program to further report on the information available.
At present, jcover is available on UNIX platforms only. When you are running profiling for jcover your application will run at 2-20 times slower, so this type of profiling is not suitable for performance measurement. If you use this against batch jobs, then there will be much decrease in the performance. You will additionally use around 0.5 to 5 MB extra memory per application while running this jcover profiling.
The profiling can only detect whole lines of code executed, or not executed. In the following line of code:
READ record FROM filevar, itemid ELSE record = "xxx" ; GOSUB subname
The jcover profiling only records the fact that the READ statement was executed. It cannot be used to determine if the code following the ELSE was executed or not. If you want to test, then the application will need to be changed so that the ELSE code is on a separate line.
The records written to the jcover output file have different formats depending upon what they are showing. The formats are identified by a prefix on the record key. Note that in the following examples a * character is used to delimit certain fields. This is the default delimiter character. Remember if the -d option was used to jcover, then this delimiter will be different.
E*itemid*filename*lineno
Where,
- itemid – The 4 fields show the record type (E), the item id, the source file name and the line number that were executed.
- <1> – The actual line of source code taken from the source itemid in file filename.
These items show, which lines of code have been executed. They are generated if the -e option is used on jcover. There will be one item for each different line of code executed during the application execution.
F*itemid*filename
Where,
itemid – The 3 fields show the record type (F), the item id and the source file name that were executed.
Used internally to keep track of what items in what files have been accessed as part of the jcover execution.
G*descr
Where,
- itemid – The 2 fields show the record type (G) and then a unique identifier, not really of any use.
- <1> – Textual description of the general information.
- <2> – The actual general information.
- <3> – The order in which the fields are to be displayed using LIST filename GENINFO.
These are general information items.
S*itemid
Where,
- itemid – The 2 fields show the record type (S) and the item ID that were executed.
- <1> – Item ID of the source executed.
- <2> – File name containing the executed source.
- <3> – Number of lines of source. This attribute will be the sum of attributes <4> and <5>.
- <4> – Total number of comment lines in the source code.
- <5> – Number of lines of code in the source that are executable. Blank lines and comment lines are not included in this count.
- <6> – Number of lines of code executed by the application.
- <7> – Number of lines of code executed by the application as a percentage of the total number of executable lines.
- <8> – Number of lines of code not executed by the application.
- <9> – Number of lines of code not executed by the application as a percentage of the total number of executable lines.
- <10>-<20> – Reserved for future use.
- <21> – Details of line 1 of the source code; a character C shows line 1 is a comment line. A numeric value shows line 1 is executable code and has been executed this many times. A blank shows line 1 is executable code, but was not executed during the application execution.
- <22> – Same as <21> but for line 2 of the source code.
- <23> – Same as <21> but for line 3 of the source code.
- Etc. for all lines in the source code.
These items show what item has been executed and are used to build up a list of statistical analysis of the executed item.
U*itemid*filename
For every filename specified with the -ffilename parameter of jcover, there will be one of these items for every item in every file that was not used during the application execution. These items are only generated if the -u option is used on jcover. Item id's that show a non-source item will not be included and these are items that are appended with .o , .a , .so , .sl , .obj , .d or .d or items that begin with ! , $ or *.
itemid – The 3 fields show the record type (U) , the item id and the source file name that were not executed.
X*itemid*filename*lineno
Where,
- itemid – The 4 fields show the record type (X) , the item ID, the source file name and the line number that were not executed, but the source have one or more lines of code executed.
- <1> – The actual line of source code taken from the source itemid in file filename.
These items show which lines of code have not been executed. They are generated if the -x option is used on jcover. There will be one item for each different line of code not executed during the application execution. Only the source files that have one or more line of code executed will be included here. Any source items not executed at all will not have a X* item but will be included in the U* items (assuming the -u option was used)
The jfb command allows you to produce source code listings in a standard format for listing to the terminal or printer. . The format of the command is as follows:
jfb -Options FileName Itemlist (Options
Where, options can be:
| Option | Explanation |
|---|---|
|
-A or (A |
Alternate indenting of CASE statements. |
|
-C or (C |
Indent comments with the source code, not column 1. |
|
-Ln,m or (Ln,m |
Set indentation to n spaces, with initial set at n*m. |
|
-Mnn or(Mnn |
Set maximum number of indentations to nn. Default is 10. |
|
-N or (N |
Do wait for keyboard input between pages. |
|
-P or (P |
Send output to the current printer queue. |
|
-Snn or (Snn |
Set the percentage split of code to comments to nn%. |
|
-V or (V |
Display indentation with + character. |
Run the following command to list the batch.b file in sub-directory source to the printer, indent it by four spaces per level and start non-labeled code at 8 spaces from the left margin:
jfb -L4,2 -V source/batch.b
The Windows platform does not provide a command line search program like the UNIX find command. This is a limited form of the UNIX find command for the Windows platform.
jfind C:\MYDIR -name ".*FRED.*" -print
The jgrep command searches for strings in jBASE files or directories.
The command syntax is:
jgrep -Options SearchString FileName (Options
Where, options can be:
| Option | Description |
|---|---|
|
-c or (C) |
Make search case in-sensitive |
|
-i or (I) |
Interactively ask for one or more Search Strings |
|
-k or (K) |
Search in record key for string |
|
-l or (L) |
List the record keys where the string was found |
|
-n or (N) |
Do not wait for keyboard input between pages |
|
-p or (P) |
Send output to printer |
|
-s or (S) |
Sub-directory searches |
|
-t or (T) |
Trims redundant spaces from search patterns |
|
-r or (R) |
Raw display exclusive of dollar items |
Many commands are built-in to the cmd.exe shell and cannot be executed like other executables. The following commands are provided to use in either JSH or CMD shell.
| Command | Description |
|---|---|
|
jrm {-r} |
Remove file or directory, recursively |
|
jmv oldfile newfile |
Move old file to new file |
|
jdir |
List directory |
Use the jmsgbox utility to display a message box on Windows platforms. You can use it with a console process; however, buttons are not configurable.
The command syntax is:
jmsgbox text
For example,
PERFORM "jmsgbox Test Box" SETTING Result IF Result<1,1>=0 THEN CRT "Ok was clicked" IF Result<1,1>=1 THEN
The jshow command allows you to find jBASE files or programs.
The command syntax is:
jshow -Options Name {Name ...}
Where, Name can be name of file, subroutine, program or dll/shared object and options can be:
| Option | Explanation |
|---|---|
|
-a |
Display subroutine names in dll/shared object |
|
-c |
Display compile time and source file |
|
-f |
File name only search |
|
-h |
Display this help screen |
|
-p |
Program name only search |
|
-s |
Subroutine name only search |
|
-v |
Verbose mode |
The jBASE profiling tool jprof enables developers to analyze applications to determine potential trouble spots within the application code.
By default, no profiling is done in the program. Programs do not have to be compiled in any special manner to enable profiling for them.
The mechanism works by receiving a signal at every clock tick and keeping note of where the program was when the signal arrived. Thus, for the profiling to be accurate, the application must be run for a relatively long time. It will not show particularly good results if, for example, a program executes in less than a second. Several minutes or longer is preferred.
Profiling can either be enabled using the -JP option, which only profiles the root process, or through the JBCPROFILE environment variable, which profiles the root process as well as all executed processes.
MAINPROG –JP
This command generates a profiling file called jprof_n in the current directory, where n is the port number. Only MAINPROG and any called subroutines are profiled, any executed programs will not be profiled. However, if the CPU time spent executing the actual EXECUTE statement is significant, then that line will be included in the profiling statistics. Profiling terminates when the application stops or chains to another program.
JBCPROFILE=1 MAINPROG
This command generates a different profiling file for each process executed in the form jprof_pid_n, where pid is the process ID and n is an incrementing number starting at 0.
The profiling file generated contains information about user CPU time. The time spent in system calls, file I/O, and lines, which do not accumulate more than a clock tick are not included in the profiling statistics.
Use the jprof command as shown below to provide profile analysis of the jprof files generated by a program executed with the -JP option.
jprof -kfilename {jprof{_nnn}}
jprof -a {jprof{_nnn}}
jprof -o {-v} {jprof{_nnn}}
jprof -s {jprof{_nnn}}
jprof {-n{-u}} {-i} {-fFilename}} {jprof{_nnn}}
Where,
- -a – Display all ancillary information.
- -fName – Name of file to extract source from.
- -i – Sort by increasing ticks, rather than decreasing tick.
- -kKeyFile – Name of file to store keyboard input, used by jkeyauto.
- -n – Subtotaled and sorted by source name.
- -o – Display shared object usage.
- -s – Display list of subroutines called.
- -u – Sorted by CPU utilization.
- -v – Verbose mode.
Imagine the source test1.b below has been edited into file BP, where BP is a directory. Note the INCLUDE of another source file test2.b.
OPEN "fb1" TO DSCB ELSE STOP 201,"fb1"
PRINT "Phase 1 -- start"
S1 = SYSTEM(9)
FOR Id = 1 TO 100
Rec = "
FOR I = 1 TO 100
Line = "
FOR J = 1 TO 20
Line := CHAR(SEQ("A")+RND(26))
NEXT J
Rec = Line
NEXT I
WRITE Rec ON DSCB,Id
NEXT Id
PRINT "Phase 1 -- end, CPU = ":SYSTEM(9)-S1
INCLUDE test2.b
PRINT C1:" records in file fb1"
PRINT "End"
The program can be created normally with the following command:
BASIC BP test1.b CATALOG BP test1.b
By default, when the program is run, no profiling takes place.
Run the program with the -JP switch to create a file jprof.
test1 -JP
You can now examine the profile file with the jprof command, using the -f option to generate optional source code listings from the file BP.
jprof -f BP jprof
Profile of program test1 from jprof Page 1.
Source Line Ticks % Source
test2.b 8 166 32.93 READ Rec FROM DSCB,Key EL
test1.b 9 160 31.74 Line := CHAR(SEQ("A")+RND(
test1.b 11 128 25.39 Rec = Line
test2.b 7 28 5.55 WHILE READNEXT Key DO
test1.b 10 9 1.78 NEXT J
test2.b 9 5 0.99 C1++
test1.b 13 3 0.59 WRITE Rec ON DSCB,Id
test2.b 5 2 0.39 SELECT DSCB
test1.b 7 2 0.39 Line = "
test2.b 10 1 0.19 REPEAT
The -i option sorts the output with incrementing ticks counts. The -n option additionally sort it by file name. Therefore, the test1.b entries will be displayed separately to the test2.b entries.
The jstart utility was originally provided to circumvent a problem with the Win95 CreateProcess API. The API fails to set the standard input handle to the new console if the standard input handle of the parent process is not a console device; that is, a DATA statement has been used. However, you can use jstart to start a process in the same window, in a new window or in the background. It is not available on UNIX platforms.
jstart -Options Command
Where, options can be:
| Option | Explanation |
|---|---|
|
-v |
Verbose |
|
-w |
Wait for process |
|
-m |
Run with window minimized |
|
-b |
Run as a background job, that is no console. |
|
-i |
Inherit current window |
|
-t'Title' |
Specify the title |
|
-p<class> |
Priority class: 0 - Normal; 1 - Idle; 2 - High |
jstart jsh -s jsh -
This starts the jSHELL in a new window, with a different port number and works for both Win9x as well as NT.
The jtic program shows the extended capabilities of a description file.
The command syntax is:
jtic -Options DescriptionFile
Where, options can be,
- -x – The description file contains extended capabilities
- -v – Verbose mode
By default, the jtic program takes a source description file called terminfo.src and assume it contains standard terminfo names. The output is directed to a file called /usr/lib/terminfo/x/xyz, where x/xyz depends upon the terminal name as available in the description file.
You can use any alternative description file by specifying its name on the command line. You can specify an alternative output directory to /usr/lib/terminfo by amending the TERMINFO environment variable. However, when you run a BASIC program that accesses these definitions in an alternative directory, the TERMINFO variable needs to match that when the definition was compiled; by default, the jtic program assumes the description file contains standard terminfo definitions. For example,
cuu1=\E[1A, cols#80,
If you want to create a binary with the extended capabilities, use the -x option. Remember when running jtic, you will probably require root privileges to write to the /usr/lib/terminfo directory.
To run jtic you need a description file to describe the capabilities. This file is very similar to that required by the UNIX tic command.
- Comment lines start with # as the first character of each line. Blank lines are also counted as comment lines.
- Terminal names specifies jtic the names of the terminal definition. It is a list of names delimited by | character. The final field is treated as a comment. Following the terminal names will be the binary definitions, integer values and string values for those terminals. When another set of terminal names are defined, the current definitions are written to file and the current definitions nulled. For example,
vt100|vt100am|prism-ans|Simple vt100 support
- Binary definition are just the name of the definition.
- Integer value specifies the name of the definition followed by # then the value. For example, cols#132.
- String value specifies the name of the definition followed by = and followed by the string value. jtic supports all the functionality of tic, such as defining characters 1 to 26 using ^A through ^Z, special characters such as \E for escape, \s for space, \t for tab. It also supports the if/else/endif structure and logical/arithmetic operations supported by tic.
For example, if_prtr_letter=\E[02l, use=name. This resets the definition to that of a previously defined name in the definition; you can use this to create a terminfo definition for one or more names, and then base subsequent definitions on that.
The comments and terminal names must all start at column 1. The binaries, integers, strings and use=name must all have a leading tab character. There can be more than one binary, integer or a comma should delimit string on a line, and each definition. When invoked with the -x option, a terminfo binary file with the suffix _jbase is generated for the extended capabilities.
The table below shows the extended terminfo definitions.
| Access | Long name Description |
|---|---|
|
@(-53) |
if_slave_only Send data to slave printer only. No VDT display |
|
@(-54) |
if_crt_type Returns VDT terminal type |
|
@(-55) |
if_crt_graphics Returns a 1 if Regis graphics available |
|
@(-59) |
if_crt_cuprot Clear all unprotected fields |
|
@(-27) |
if_crt_132 Switch VDT to 132 column mode |
|
@(-28) |
if_crt_80 Switch VDT to 80 column mode |
|
@(-29) |
if_crt_dwide Display double wide characters |
|
@(-30) |
if_crt_swide Display single wide characters |
|
@(-32) |
if_crt_sron Set-up scrolling region. (Enter ? for help) |
|
@(-33) |
if_crt_sroff Reset scrolling region to normal |
|
@(-47) |
if_crt_udhdw Top half of double height line |
|
@(-48) |
if_crt_bdhdw Bottom half of double height line |
|
@(-60) |
if_prtr_executive Change paper size to executive |
|
@(-61) |
if_prtr_a4 Change paper size to A4 |
|
@(-62) |
if_prtr_monarch Envelope type "Monarch" |
|
@(-63) |
if_prtr_comm10 Envelope type "Commercial 10" |
|
@(-64) |
if_prtr_interntldl Envelope type "International DL" |
|
@(-65) |
if_prtr_reset Reset printer defaults |
|
@(-66) |
if_prtr_envfeed Envelope feeder |
|
@(-70) |
if_prtr_letter Change paper size to letter |
|
@(-71) |
if_prtr_legal Change paper size to legal |
|
@(-72) |
if_prtr_chgcpy Change number of copies to print on Laser |
|
@(-73) |
if_prtr_cpwo1 Compressed print for Service WO form 1 |
|
@(-74) |
if_prtr_spcol Start printing at specified column |
|
@(-75) |
if_prtr_sprow Start printing at specified row |
|
@(-76) |
if_prtr_utray Use Upper Tray |
|
@(-77) |
if_prtr_ltray Use Lower Tray |
|
@(-78) |
if_prtr_portrt Portrait orientation |
|
@(-79) |
if_prtr_land Landscape orientation |
|
@(-80) |
if_prtr_simplx Simplex binding |
|
@(-81) |
if_prtr_duplxl Duplex, long edge binding |
|
@(-82) |
if_prtr_duplxs Duplex, short edge binding |
|
@(-83) |
if_prtr_macro Call MACRO |
|
@(-84) |
if_prtr_setdef Set default ( Font size, HMI, VMI ) |
|
@(-85) |
if_prtr_lpi2 2 lines per inch |
|
@(-86) |
if_prtr_lpi3 3 lines per inch |
|
@(-87) |
if_prtr_lpi4 4 lines per inch |
|
@(-88) |
if_prtr_lpi6 6 lines per inch |
|
@(-89) |
if_prtr_lpi8 8 lines per inch |
|
@(-90) |
if_prtr_lpi12 12 lines per inch |
|
@(-91) |
if_prtr_dwide Double wide mode |
|
@(-92) |
if_prtr_swide Single wide mode |
|
@(-93) |
if_prtr_96 96 column mode |
|
@(-94) |
if_prtr_pld 1/2 line down |
|
@(-95) |
if_prtr_plu 1/2 line up |
|
@(-96) |
if_prtr_suon Superscript mode |
|
@(-97) |
if_prtr_sbon Subscript mode |
|
@(-98) |
if_prtr_ssoff Superscript and subscript off |
|
@(-99) |
if_prtr_40 Double wide for 80 column mode (5 pitch) |
|
@(-100) |
if_prtr_48 Double wide for 96 column mode (6 pitch) |
|
@(-101) |
if_prtr_ff Top of form |
|
@(-102) |
if_prtr_80 80 column mode (10 pitch) |
|
@(-103) |
if_prtr_132 132 column mode (16 pitch) |
|
@(-104) |
if_prtr_bold Bold |
|
@(-105) |
if_prtr_ul Underline |
|
@(-106) |
if_prtr_norm Turn off bold and underline |
|
@(-107) |
if_prtr_hmi Set horizontal motion index to U-1 |
|
@(-108) |
if_prtr_vmi Set vertical motion index to U-1 |
|
@(-109) |
if_prtr_pson Proportional spacing on |
|
@(-110) |
if_prtr_psoff Proportional spacing off |
|
@(-111) |
if_prtr_1key Linefeed and backspace |
|
@(-112) |
if_prtr_2key Linefeed |
|
@(-113) |
if_prtr_3key Linefeed and space |
|
@(-114) |
if_prtr_4key Backspace |
|
@(-115) |
if_prtr_6key Space |
|
@(-116) |
if_prtr_7key Negative linefeed and backspace |
|
@(-117) |
if_prtr_8key Negative linefeed |
|
@(-118) |
if_prtr_9key Negative linefeed and space |
|
@(-119) |
if_prtr_cvd Coarse vertical distance ( 1 line = 1 inch) |
|
@(-120) |
if_prtr_mvd Medium vertical distance ( 1 line = 1/6 inch ) |
|
@(-121) |
if_prtr_type Returns slave/printer type |
|
@(-122) |
if_prtr_fvd Fine vertical distance ( 1 line = 1/48 inch) |
|
@(-123) |
if_prtr_chd Coarse horizontal distance ( 1 space = 1 inch ) |
|
@(-124) |
if_prtr_mhd Medium horizontal distance ( 1 space = 1/12 inch ) |
|
@(-125) |
if_prtr_fhd Fine horizontal distance ( 1 space = 1/120 inch ) |
|
@(-126) |
if_prtr_status Retrieve slave/printer device status |
|
@(-220) |
IF_PRTR_DUL_ON |
|
@(-221) |
IF_PRTR_DUL_OFF |
|
@(-223) |
IF_PRTR_STRIKE_ON |
|
@(-224) |
IF_PRTR_STRIKE_OFF |
|
@(-225) |
IF_PRTR_HARD_HYPHEN |
|
@(-226) |
IF_PRTR_HARD_BLANK |
|
@(-230) |
IF_PRTR_FONT_0 |
|
@(-231) |
IF_PRTR_FONT_1 |
|
@(-232) |
IF_PRTR_FONT_2 |
|
@(-233) |
IF_PRTR_FONT_3 |
|
@(-234) |
IF_PRTR_FONT_4 |
|
@(-235) |
IF_PRTR_FONT_5 |
|
@(-236) |
IF_PRTR_FONT_6 |
|
@(-237) |
IF_PRTR_FONT_7 |
|
@(-238) |
IF_PRTR_FONT_8 |
|
@(-239) |
IF_PRTR_FONT_9 |
You can generate a terminfo extension file using the jtic -x command. Ensure that the prt_video emulation flag is configured to true, for the required emulation.
Example
Generate jBASE extension tic file.
ED . Mytic TOP . 001 # My jBASE extension file for vt220 002 vt220|VT220 003 if_crt_132=My132String, 004 if_crt_80=My80String, .FI
Generate jBASE terminfo extension file.
jtic -x Mytic
This generates a jBASE extension entry for vt220 in the terminfo database. For example, /usr/lib/terminfo/v/vt220_ext_jbase.
Test terminfo produces correct result.
ED . TESTMYTIC.b TOP . 001 CRT "Output my 80 column terminfo command ":@(-28) 002 CRT "Output my 132 column terminfo command ":@(-27) .FI export TERM=vt220 export JBCEMULATE=ROS jbc -Jo TESTMYTIC.b TESTMYTIC > MyFile
The keys utility displays the keyboard input. This program does not exist on the NT/Win95 platform, however this section shows you how it can be coded.
NOEXIT = 1 LOOP ECHO OFF CRT "Hit a key :": IN ch FOR 100 ELSE NOEXIT = 0 ECHO ON WHILE NOEXIT DO IF ch <> 127 THEN CRT "." : CHAR(9): "0x0" : ch "MCDX" END ELSE CRT CHAR(ch) : CHAR(9): "0x0" :ch "MCDX" END REPEAT
The MW42 tool is designed to analyse issues that relate to a gradual buildup of resource usage over a period. It records information from a series of both jBASE and operating system tools, collecting data as system configuration, process status, memory usage, disk space, state of jBASE daemons, etc.
The command syntax is:
Mw42 {-a –f –n –pPot –pp1-p2 –t -uUser –nn1 –nn2 > output.file}
Below table shows the syntax elements and their description.
| Option | Description |
|---|---|
|
-a |
Display application account instead of currently logged on user name |
|
-f |
Display full listing. Normally display is truncated to screen size. |
|
-n |
Disable check for input (some platforms block when input is requested) |
|
-pPort |
Restrict display to port number specified |
|
0 |
Restrict display to ports in the range p1-p2 |
|
-s |
Display IO stats instead of iSeries job ID (default on other platforms) |
|
-t |
Prefix each line with time stamp |
|
-uUser |
Restrict display to specified user |
|
0 |
Interval in seconds between samples |
|
0 |
Number of samples to take |
|
> output.file |
To facilitate further investigation – It is often useful to redirect the mw42 output to a file. mw42.out is the usual convention. |
mw42 -f -a -t -n 30 1440 > mw42.out
Produce a full listing for the application account with timestamps on every line without asking for input. Sample every 30 seconds for 1440 samples and pipe the output to mw42.out.
The @USERSTATS utility allows a program to retrieve miscellaneous information about itself.
For example, if a program wants to find out how many database inputs and outputs it has performed, then the program should look like below:
info1 = @USERSTATS read1 = info1<19> EXECUTE 'COUNT fb1 WITH *A1 EQ "x"' info2 = @USERSTATS read2 = info2<19> PRINT "The COUNT command took ":(read2-read1):" READ's from the database" The following definitions have been added to JBC.h file which defines the layout of data returned either through the @USERSTATS variable or by opening file SYSTEM(1027) and reading the items in like that. * Definitions for the data returned from @USERSTATS variable or from * the record read from PROC file (using SYSTEM(1027) as file name) * EQUATE USER_PROC_PORT_NUMBER TO 1;* The port number EQUATE USER_PROC_NUM_PROGRAMS TO 2;* Number of programs running in this port EQUATE USER_PROC_START_TIME TO 3;* Time user started in UTC format EQUATE USER_PROC_PID TO 4 ;* Process ID EQUATE USER_PROC_ACCOUNT TO 5;* Name of the account EQUATE USER_PROC_USER TO 6 ;* Name of the user EQUATE USER_PROC_TERMINAL_JBASE TO 7;* Name of terminal according to jBASE EQUATE USER_PROC_TERMINAL_OS TO 8;* Name of terminal as seen by OS EQUATE USER_PROC_DATABASE TO 9;* Name of database connected to EQUATE USER_PROC_TTY TO 10;* Name of TTY device EQUATE USER_PROC_LANGUAGE TO 11;* Language EQUATE USER_PROC_LISTENING_TIME TO 12;* Time in UTC the listening thread last worked EQUATE USER_PROC_MEM_FREE TO 13;* Amount of memory in heap space free chain EQUATE USER_PROC_MEM_USED TO 14;* Amount of heap space memory in use EQUATE USER_PROC_THREAD_TYPE_INT TO 15;* Thread type expressed as an integer EQUATE USER_PROC_THREAD_TYPE_TXT TO 16;* Thread type expressed as a text string EQUATE USER_PROC_LICENSE TO 17;* License counters EQUATE USER_PROC_STATS_OPEN TO 18;* Number of OPEN's performed. EQUATE USER_PROC_STATS_READ TO 19;* Number of READ's performed. EQUATE USER_PROC_STATS_WRITE TO 20;* Number of WRITE's performed. EQUATE USER_PROC_STATS_DELETE TO 21;* Number of DELETE's performed. EQUATE USER_PROC_STATS_CLEARFILE TO 22;* Number of CLEARFILE's performed. EQUATE USER_PROC_STATS_PERFORM TO 23;* Number of PERFORM's / EXECUTE's performed. EQUATE USER_PROC_STATS_INPUT TO 24;* Number of INPUT's performed. EQUATE USER_PROC_UNUSED_1 TO 25;* Unused EQUATE USER_PROC_OPEN_FILES_VIRTUAL TO 26;* Number of files application thinks open EQUATE USER_PROC_OPEN_FILES_REAL TO 27 ;* Number of files really open by OS EQUATE USER_PROC_USER_ROOT TO 28;* Application data set by @USER.ROOT EQUATE USER_PROC_PROCESS_TXT TO 29;* Text string to identify process EQUATE USER_PROC_PROGRAM TO 41;* Program name and command line arguments EQUATE USER_PROC_LINE_NUMBER TO 42;* Line number currently being executed. EQUATE USER_PROC_SOURCE_NAME TO 43;* Name of source currently being executed. EQUATE USER_PROC_UNUSED_2 TO 44;* Unused EQUATE USER_PROC_UNUSED_3 TO 45;* Unused EQUATE USER_PROC_STATUS_TXT TO 46;* Status of program as a readable text EQUATE USER_PROC_STATUS_INT TO 47;* Status of program as an integer EQUATE USER_PROC_CPU_USR TO 48;* User CPU time EQUATE USER_PROC_CPU_SYS TO 49;* System CPU time EQUATE USER_PROC_CPU_USR_CHILD TO 50;* User CPU time used by child processes EQUATE USER_PROC_CPU_SYS_CHILD TO 51;* System CPU time used by child processes EQUATE USER_PROC_USER_THREAD TO 52;* Application data set by @USER.THREAD
The jBASE ADDD command adds two decimal numbers.
The command syntax is:
ADDD Num Num
Where, Num is a decimal number. For example,
ADDD 89 10 99
The jBASE ADDX command adds two hexadecimal numbers.
The command syntax is:
ADDX HexNum1 HexNum2
Where, Num is a hexadecimal number. For example,
ADDX 59 0A 63
The AUTOLOGOUT command enables a session to log off automatically if there is no keyboard activity for a specified time.
The command syntax is:
AUTOLOGOUT {n {program {program Args}}} {©}
Where,
- n is the number of minutes of keyboard inactivity required before logging the session off.
- program is the name of a program to run before logging the session off.
- program Args is the program specifies args for the program.
- The C option displays the name of the program to be executed.
The definition of inactivity is as a program waiting for an INPUT or IN statement. If no program is specified when it issues the AUTOLOGOUT command, it executes a program called ON.EXIT before logging off the session. You must define the functionality of ON.EXIT. To reset the auto logout, specify zero for the number of minutes, or disconnect and reconnect from jBASE.
jsh -->AUTOLOGOUT 10
Automatic logout is set for 10 minutes.
jsh -->AUTOLOGOUT 15 OFF (C
Automatic logout is set for 15 minutes.
The jBASE BREAK-KEY-ENABLE command sets the jBASE break key enabled flag. This enables the break key, when executing jBASE programs.
The command syntax is:
BREAK-KEY-ENABLE
The jBASE BREAK-KEY-OFF command resets the jBASE break key enabled flag. This disables the break key, when executing jBASE programs.
The command syntax is:
BREAK-KEY-OFF
The jBASE BREAK-KEY-ON command sets the jBASE break key enabled flag. This enables the break key, when executing jBASE programs.
The command syntax is:
BREAK-KEY-ON
The COMO utility provides a means of recording all input and output from the terminal to a specified record in a directory.
On UNIX platforms the directory is called &COMO&, while it is called COMO on Windows.
The command syntax is:
COMO ON SessionId
Turn recording on to session ID.
COMO OFF
Turn recording off.
COMO DELETE SessionId
Delete recording named session ID.
Use the UNIX command typescript for this functionality if COMO is NOT part of your legacy application. For example,
- script - Start recording
- [command execution]
- Ctrl-D - Stop recording.
You can find the recorded information in the typescript file.
The CONTROL-CHARS command controls whether or not the jBASIC INPUT statement accepts characters outside the printable range (decimal 32 through 126).
The command syntax is:
CONTROL-CHARS {ON | OFF}
Where,
- CONTROL-CHARS ON disallows the input of control characters.
- CONTROL-CHARS OFF allows the input of control characters.
- CONTROL-CHARS reports the current state.
The default behaviour is to allow the input of control characters. The jBASIC IN statement ignores the setting. For example,
CONTROL-CHARS
Control characters OFF (allowed).
The jBASE CP command utilizes the jBASE copy command to output records from a file to a spooler print job.
The command syntax is:
CP filename {recordlist} {(Options}
Where,
- filename is the name of the file from which to copy records.
- recordlist is the list of record IDs to copy. The recordlist may be supplied by an active SELECT list or default to all records in file.
- Options can be X to display in hexadecimal format.
CP CUSTOMERS SMITH
The jBASE CT command utilizes the jBASE copy command to output records from a file to the terminal.
The command syntax is:
CT filename {recordlist} {(Options}
Where,
- filename is the name of the file from which to copy records.
- recordlist is the list of record IDs to copy. The recordlist may be supplied by an active SELECT list or default to all records in file.
- Options can be X to display in hexadecimal format.
CT CUSTOMERS SMITH
This command pauses all database operations through jEDI to the jBASE database.
The command syntax is:
DB-PAUSE options
Where options are:
- -a option means that administrators (example, root users on UNIX) can still make updates to the database.
- -n option specifies the database to pause (this option is restricted to jBASE 5).
- -r option still allows read operations on the database and therefore only pauses updates.
- -t option permits users inside a transaction to continue until it terminates the transaction by either a commit (TRANSEND) or a rollback (TRANSABORT).
The command can be run a number of times with different options. For example, run it with the -a option to allow root users continued access then when sure all normal users are paused, run it again without the -a option, which will suspend the updates for all users.
# DB-PAUSE DatajBASE paused at Mon Nov 25 15:59:53 2002 For READ and WRITE operations Updates are denied also to root users Transactions will be blocked immediately.
This utility allows resumption of database operations on a previously paused jBASE database.
The command syntax is:
DB-RESUME {-n}
Where, the -n option specifies the database to resume (this option is only available in jBASE 5.2 and later.
# DB-RESUME Database is active, resumed at Mon Nov 25 16:00:33 2002 When run, it resumes all operations to the database.
This command is used to check the status of jBASE databases (running or paused).
The command syntax is:
DB-STATUS option
Where, options are:
- The -a option specifies that all databases should be shut down (this option is restricted to jBASE 5).
- The -n option specifies the database to shut down (this option is restricted to jBASE 5).
- The -t option displays users currently inside a transaction.
- The -v option is the verbose option.
- The -w option displays all users currently suspended and waiting for a DB-RESUME.
- The -V option is the verbose option and is the equivalent of -t, -v and -w together.
Run this command as any user, which also shows the status of the DB-PAUSE command.
# DB-STATUS -V DatajBASE paused at Mon Nov 25 16:13:36 2002 For READ and WRITE operations Updates are denied also to root users Existing transactions can continue until complete Port 4 is waiting for DB-RESUME Port 23 is waiting for DB-RESUME Port 31 is inside a transaction 1 ports inside a transaction, 2 ports waiting for DB-RESUME
One common usage of these commands will be to split mirrors on a mirrored disk system. One of the mirrors can then continue a jBASE operation following a DB-RESUME and the other mirror, which is now quiescent, used for a fast backup using operating system specific backup tools.
If a database update is currently in operation, the command will not stop existing updates. Normally these only last a matter of milliseconds, but could be longer depending on the application. For example, the file might have a datajBASE trigger associated with it, and as that is under the control of the application, any sort of delay might occur depending on the trigger.
It does not force any data from the kernel file cache onto disk. Hence, if you paused a database and immediately started a mirror split you would get inconsistent data and possibly corrupt files, as some of the changes to files would only be in a kernel file cache rather than disk. You should wait 1-2 minutes for your sync to flush updates to disk, but this is only guidance as each installation is different.
In both of the above scenarios, you must satisfy yourself that consistent flushing of the data to disk before attempting any operation that depends upon it.
The DB-PAUSE command is extremely effective. So much of jBASE, both internal and application wise, writes to files that once it executes the DB-PAUSE command, virtually no jBASE programs will run (the DB-PAUSE, DB-RESUME and DB-STATUS commands being the notable exceptions). Please treat with extreme caution. You might like to initially use the -a option to DB-PAUSE such that root (administrator) users can continue running jBASE.
Be wary of having jBASE commands in the login script for root user, as this is always bad practice, but even more so with DB-PAUSE. Be careful, not to pause a database and log back on to root to resume. The login script pauses because it is paused while running a jBASE program. It is best practice that you never put jBASE programs in the login script of root user.
By default, the DB-PAUSE command only affects individual updates, not transactions. Therefore, while the effect of DB-PAUSE is to make the files logically correct ready for backups or splitting mirrors, the database records will not be consistent. If your applications use transaction boundaries, you should use the -t option to DB-PAUSE, that is the transaction will complete and make your database logically correct. Using DB-STATUS -t, you can check how many (if any) users are still inside a transaction and hence able to do further data jBASE I/O and so delay and maintenance until all the users have completed their transaction.
The jBASE ECHO command sets or resets the jBASE echo enabled flag. This enables or suppresses input character echo, when using a jBASE program.
The command syntax is:
ECHO {ON|OFF}
Where, ON resume input character echo and OFF suppress input character echo.
The jBASE ECHO-OFF command resets the jBASE echo enabled flag. This suppresses input character echo, when using a jBASE program.
The command syntax is:
ECHO-OFF
The jBASE ECHO-ON command sets the jBASE echo enabled flag. This enables input character echo, when using a jBASE program.
The command syntax is:
ECHO-ON
The jBASE HUSH command resets the jBASE echo enabled flag. This suppresses input character echo, when using a jBASE program.
The command syntax is:
HUSH
The jBASE LISTDICTS command displays in page format the attribute definition entries in the MD file or the specified dictionary file.
The command syntax is:
LISTDICTS {filename}
Where, filename is the name of an alternative file.
LISTDICTS PAYROLL
The jBASE LISTF command displays in page format all MD entries with attribute one set to either D or Q.
The command syntax is:
LISTF
This shows what files a user has open. By default, it shows a summary. For example,
jsh --> list-files Polling 3 ports ... Opened files at 19:52:16 16 JUN 2003 Page 1 Port Application Open Files Actual O/S Open Files 0 258 247 1 8 8 2 4 4
Many of the new commands get their information by polling active ports. This can take 5-10 seconds.
With jBASE, 4.1, if you open the same file multiple times to different variables, then jBASE will have only a single operating system file. This is for efficiency and thread consideration. The difference between the numbers of files the application thinks it has open and the number of files jBASE actually has open with the operating system is displayed in the second and third columns. This will be more significant in multi-thread applications that might open the same file, once for each thread. In this case, there will only be a single actual file opened and the threads will share the same file handle, although this is done hidden from the application.
The (V) option will show a row for each file opened by the application.
The LISTU utility displays information on processes executing jBASE programs.
The command syntax is:
LISTU (Options)
Where, options can be P, which redirect output to printer and N, which specifies no page.
The output of the LISTU command is customized by calling the JBCUserCustomiseDisplay subroutine.
The following table shows the utilities that displays and controls locks taken by jBASE applications:
| Command | Description |
|---|---|
|
LIST-LOCKS |
List all lock types. |
|
LIST-SYSTEM-LOCKS |
List system locks. |
|
LIST-GROUP-LOCKS |
List binary or group locks. |
|
LIST-RECORD-LOCKS |
List item or record locks. |
|
LIST-EXECUTION-LOCKS |
List execution locks. |
|
SHOW-RECORD-LOCKS |
Alternative display for record locks. |
|
CLEAR-RECORD-LOCKS |
Clears record locks (permission required). |
|
CLEAR-BASIC-LOCKS |
Clears execution locks (permission required). |
This section describes the LOGON and LOGOFF utilities.
The LOGON utility logs in a background process to execute a user login. The user login executes the *.profile, which can be modified in order to execute a logon proc through the exec jsh - mechanism.
LOGON Port, UserName, Password
The LOGOFF utility is used to logoff another process. You need root privileges to logoff another process that is logged on with a different user ID.
LOGOFF Port
The jBASE MSG command sends a message to other users using either port numbers or account or user IDs.
The command syntax is:
MSG {!port | account/userid } text
Where,
- !port is the target port number for the message.
- account/userid is the target user or users for the message.
- text is the message body.
MSG !31 Happy Birthday Jim
Sends a message to the tty device associated with port number 31.
MSG Jim Can I borrow your pipe and slippers?
Sends message to the tty device for all users named Jim.
The jBASE NOHUSH command sets the jBASE echo enabled flag. This enables input character echo, when using a jBASE program.
The command syntax is:
NOHUSH
The OFF command will close all current jBASE programs, but will stop if it encounters a non-jBASE program.
To use the command effectively, run only jBASE programs.
On Unix for example, the .profile might have:
exec MAIN.PROG
or
exec jsh
If your .profile looks like this:
MAIN.PROG
or
jsh
The UNIX shell will be kept active and the effect of the OFF command will be to return to the UNIX shell.
Use PHANTOM to start a process that executes in the background. A phantom process does not require input from the terminal.
The command syntax is:
PHANTOM [BRIEF] [SQUAWK]command
Where,
- BRIEF – Output from the phantom process is redirected to the null device. Messages are not suppressed by the BRIEF option.
- SQUAWK – Displays the record ID of the record created in the &PH& file by the phantom process.
- command – The command to execute phantom from a process.
Phantom process started on Process ID pid#.
The operating system assigns the process ID number, pid#.
A phantom process cannot use any tty devices. Input to a phantom process processes can be achieved using the database statements. For example, the following paragraph runs the BASIC program MYPHANTOM and supplies input to it using two data statements:
BACKGROUND 0001: PA 0002: RUN BP MYPHANTOM 0003: DATA A
The RUN command is used to execute compiled but un-catalogued jBASE BASIC programs.
Whenever possible, you should catalogue your programs rather than RUN them. The RUN command is only maintained for compatibility with older systems.
The format of the RUN command is as follows:
RUN SourceFilename ProgramName (options
The jBASE SLEEP command causes the process to sleep either until a specified time or for a specified number of seconds.
The command syntax is:
SLEEP {time|seconds}
Where,
- time specifies the time until which the process should sleep. The time value is in the 24-hour format, HH:MM:SS.
- seconds specifies the number of seconds for which the process is to sleep.
If you invoke the debugger during SLEEP and continue the execution process, then the following prompt appears:
Continue with SLEEP (Y/N)?
If N is the response, then SLEEP will terminate.
SLEEP 13:15
The process will sleep until 1:15 p.m.
SLEEP 300
The process will sleep for 300 seconds or 5 minutes.
The jBASE SUBD command subtracts two decimal numbers.
The command syntax is :
SUBD Num1 Num2
Where, Num is a decimal number.
For example: SUBD 89 10
The output is 79.
The jBASE TERM command enables users to specify different terminal types to handle terminal characteristics.
The command syntax is:
TERM {type | parameters}
Where,
- type specifies the terminal type. The type must be one of the terminal types defined in the terminfo datajBASE. If you wish to specify a known terminal type (for example, vt220) as a different name, then you need to link the new name (for example, V) to the terminfo entry for vt220.
- Specified parameters are as follows:
- tlength is the terminal length.
- tdepth is the terminal display lines per page.
- plength is the printer length.
- pdepth is the display lines per page.
An SP-ASSIGN may result in resetting the printer line length and lines per page because of the WIDTH and DEPTH parameters associated with the specified queue’s formtype.
For example: TERM vt220
Invokes terminal characteristics for terminfo type vt220.
TERM 132,,,,,,112,30
Sets the terminal line length to 132 columns; it will format any paged output to the printer into 112 columns and 30 lines per page.
The jBASE TIME command returns the system current time and date.
The command syntax is:
TIME
Use the WHERE utility to display information on processes executing jBASE programs.
WHERE Ports (Options
Where, Ports can be a range of ports of the form Port-Port and options can be the following:
- A – All ports displayed.
- N – NOPAGE.
- P – Redirect output to printer.
- R – Raw output for scripts, no header, 1 line per logged on user.
- S – Display processes NOT waiting at jSHELL prompt.
- U – Suppress own process from display.
- V – Verbose output.
The WHO utility displays the assigned port number and user for the current process. The user string reflects the JBCLOGNAME if configured otherwise the user name is the login user id.
WHO {PortNumber}
If PortNumber is specified, then the user for that port is displayed.
For some emulations, (example, ros), it displays the system name and login user id.
Several utilities are provided to convert, add, multiply, subtract and divide numeric decimal and hexadecimal values. Currently these are available on UNIX platforms only.
| Command | Description | Example | Result |
|---|---|---|---|
|
ADDD |
Add decimal |
ADDD 10 20 |
30 |
|
ADDX |
Add hexadecimal |
ADDX A 14 |
1E |
|
SUBD |
Subtract decimal |
SUBD 20 10 |
10 |
|
SUBX |
Subtract hexadecimal |
SUBX 14 A |
A |
|
DIVD |
Divide decimal |
DIVD 20 10 |
2 |
|
DIVX |
Divide hexadecimal |
DIVX 14 A |
2 |
|
MULD |
Multiply decimal |
MULD 20 10 |
200 |
|
MULX |
Multiply hexadecimal |
MULX 14 A |
C8 |
|
DTX |
Convert decimal to hex |
DTX 10 |
A |
|
XTD |
Convert hex to decimal |
XTD A |
10 |
Add Bookmark
save your best linksView Bookmarks
Visit your best linksIn this topic
Are you sure you want to log-off?