Jbase General Utilities

  • Uploaded by: Zahid.hasan
  • 0
  • 0
  • January 2021
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Jbase General Utilities as PDF for free.

More details

  • Words: 6,673
  • Pages: 62
Loading documents preview...
jBASE General Utilities Guide

System Administration Manuals

jBASE 4.1

2

Copyright Copyright (c) 2003 TEMENOS HOLDINGS NV All rights reserved. This document contains proprietary information that is protected by copyright. No part of this document may be reproduced, transmitted, or made available directly or indirectly to a third party without the express written agreement of TEMENOS UK Limited. Receipt of this material directly from TEMENOS UK Limited constitutes its express permission to copy. Permission to use or copy this document expressly excludes modifying it for any purpose, or using it to create a derivative therefrom. TEMENOS UK Limited, makes no warranty of any kind with regard to the material contained in this manual, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. The information contained in this manual is subject to change without notice. Acknowledgements Information regarding Unicode has been provided in part courtesy of the Unicode Consortium. The Unicode Consortium is a non-profit organization founded to develop, extend and promote use of the Unicode Standard, which specifies the representation of text in modern software products and standards. The membership of the consortium represents a broad spectrum of corporations and organizations in the computer and information processing industry. The consortium is supported financially solely through membership dues. Membership in the Unicode Consortium is open to organizations and individuals anywhere in the world who support the Unicode Standard and wish to assist in its extension and implementation. Portions of the information included herein regarding IBM’s ICU has been reprinted by permission from International Business Machines Corporation copyright 2001 jBASE, jBASIC, jED, jSHELL, jLP, jEDI, jCL, jQL, j1, j2 j3 j4 and jPLUS files are trademarks of TEMENOS Holdings NV. REALITY is a trademark of Northgate Solutions Limited. PICK is a trademark of Raining Data Inc. All other trademarks are acknowledged. Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. Windows, Windows NT, and Excel are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. UNIX is a registered trademark in the United States and other countries licensed exclusively through X/Open Company Limited.

ii

Other company, product, and service names used in this publication may be trademarks or service marks of others. Errata and Comments If you have any comments regarding this manual or wish to report any errors in the documentation, please document them and send them to the address below:

Technical Publications Department TEMENOS UK Limited 6th Floor Kodak House Hemel Hempstead Hertfordshire HP1 1JY England Tel SB: +44 (0) 1442 411800 Direct

+44 (0) 1442 411808

Fax:

+44 (0) 1442 411900

Please include your name, company, address, and telephone and fax numbers, and email address if applicable. [email protected]

iii

Contents Documentation Conventions ........................................................................................ vi GENERAL UTILITIES ........................................................................................ 1 ADDD ........................................................................................................................... 1 ADDX ........................................................................................................................... 2 AUTOLOGOUT ........................................................................................................... 3 BREAK-KEY-ENABLE............................................................................................... 4 BREAK-KEY-OFF ....................................................................................................... 5 BREAK-KEY-ON......................................................................................................... 6 CLEAR-ITEM-LOCKS ................................................................................................ 7 CONTROL-CHARS ..................................................................................................... 9 CP ................................................................................................................................ 10 CT................................................................................................................................ 11 DB-PAUSE {-art} ....................................................................................................... 12 DB-RESUME.............................................................................................................. 13 DB-STATUS {-tvwV}................................................................................................ 14 ECHO .......................................................................................................................... 17 ECHO-ON ................................................................................................................... 18 ECHO-OFF ................................................................................................................. 19 HUSH .......................................................................................................................... 20 LISTDICTS ................................................................................................................. 21 LISTF .......................................................................................................................... 22 LISTU.......................................................................................................................... 23 LOGON/LOGOFF ...................................................................................................... 24 LIST-OPEN-FILES..................................................................................................... 25 NOHUSH .................................................................................................................... 27 OFF.............................................................................................................................. 28 SHOW-ITEM-LOCKS................................................................................................ 29 SLEEP ......................................................................................................................... 30 SLEEP 300 .................................................................................................................. 31 SUBD .......................................................................................................................... 32 TANDEM.................................................................................................................... 33 RESTRICTIONS......................................................................................................... 35 TERM.......................................................................................................................... 36 TIME ........................................................................................................................... 37 WHERE....................................................................................................................... 38 WHO ........................................................................................................................... 39 XTD DTX.................................................................................................................... 40 iv

Customizing the output of commands ...........................................................................2 Body Specification.........................................................................................................3 INDEX .................................................................................................................1 COMMENT SHEET .............................................................................................2 COMMENT SHEET .............................................................................................2

v

Documentation Conventions This manual uses the following conventions:

Convention

Usage

BOLD

In syntax, bold indicates commands, function names, and options. In text, bold indicates keys to press, function names, menu selections, and MSDOS commands.

UPPERCASE

In syntax, uppercase indicates JBASE commands, keywords, and options; BASIC statements and functions; and SQL statements and keywords. In text, uppercase also indicates JBASE identifiers such as filenames, account names, schema names, and Windows NT filenames and pathnames.

UPPERCASE Italic

In syntax, italic indicates information that you supply. In text, italic also indicates UNIX commands and options, filenames, and pathnames. Courier indicates examples of source code and system output.

COURIER Courier Bold In examples, courier bold indicates characters that the user COURIER BOLD

types or keys (for example, ). Brackets enclose optional items. Do not type the brackets unless indicated.

[] Braces enclose nonoptional items from which you must select at least one. {}

Do not type the braces. A vertical bar separating items indicates that you can choose only one

ITEMA | ITEMB

...

item. Do not type the vertical bar. Three periods indicate that more of the same type of item can optionally follow.

vi

A right arrow between menu options indicates you should choose each ⇒

option in sequence. For example, “Choose File ⇒Exit” means you should choose File from the menu bar, and then choose Exit from the File pulldown menu.

Syntax definitions and examples are indented for ease in reading. All punctuation marks included in the syntax—for example, commas, parentheses, or quotation marks—are required unless otherwise indicated. Syntax lines that do not fit on one line in this manual are continued on subsequent lines. The continuation lines are indented. When entering syntax, type the entire syntax entry, including the continuation lines, on the same input line.

vii

GENERAL UTILITIES ADDD Adds together two decimal numbers.

COMMAND SYNTAX ADDD Num1 Num2

SYNTAX ELEMENTS Num1 Num2

EXAMPLE ADDD 89 10

99

1

ADDX Adds together two hexadecimal numbers.

COMMAND SYNTAX ADDX HexNum1 HexNum2

SYNTAX ELEMENTS Num1 Num2

EXAMPLE ADDX 59 0A

63

2

AUTOLOGOUT Enables a program to log off automatically should there be no keyboard activity for a specified time.

COMMAND SYNTAX AUTOLOGOUT {n {program {program Args}}} {©}

SYNTAX ELEMENTS 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 specifies args for the program. The (C option displays the name of the program to be executed.

NOTES 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. The user 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.

EXAMPLES jsh -->AUTOLOGOUT 10

Automatic logout is set for 10 minutes. jsh -->AUTOLOGOUT 15 OFF (C

Automatic logout is set for 15 minutes Command to execute when invoked = ‘OFF’

3

BREAK-KEY-ENABLE Sets the program break key enabled flag. This enables the user to use the break key (Ctrl-C) program, when executing programs and to allow users to interrupt program execution and enter debugger.

COMMAND SYNTAX BREAK-KEY-ENABLE

SYNTAX ELEMENTS None

EXAMPLE BREAK-KEY-ENABLE

4

BREAK-KEY-OFF Resets the break key enabled flag. This disables the break key (Ctrl-C), when executing programs and stops user interrupting the program.

COMMAND SYNTAX BREAK-KEY-OFF

SYNTAX ELEMENTS None

EXAMPLE BREAK-KEY-OFF

5

BREAK-KEY-ON Sets the break key enabled flag. This enables the break key (Ctrl-C), when executing programs and to allow users to interrupt pprogream execution and enter debugger.

COMMAND SYNTAX BREAK-KEY-ON

SYNTAX ELEMENTS None

EXAMPLE BREAK-KEY-ON

6

CLEAR-ITEM-LOCKS Use the CLEAR-ITEM-LOCKS command to clear a specific lock or all locks taken against a specific file. Use this command with jBASE files or directories only.

COMMAND SYNTAX CLEAR-ITEM-LOCKS filename CLEAR-ITEM-LOCKS filename, itemname

NOTES Only a user with root privileges can issue this command

Refer to the SHOW-ITEM-LOCKS command If JEDI_NOSHMEM is set (i.e. JEDI_NOSHMEM=1) the CLEAR-ITEM-LOCKS will not function (?)

This command can only be used with jRLA Locking scheme and has no effect when using OS locking mechnism on NT native file locks.

7

COMO The COMO utility provides a means of recording all input and output from the terminal to a specified record in a directory. The directory is called &COMO&.

COMMAND SYNTAX

COMO ON SessionId

Turn recording on to SessionId COMO OFF

Turn recording off COMO DELETE SessionId

Delete recording named SessionId.

NOTES Use the UNIX command typescript for this functionality if COMO is NOT part of your legacy application. E.g; script - Start recording

command execution

Ctrl-D - Stop recording. You can find Recorded information in the “typescript” file.

8

CONTROL-CHARS Use to control whether or not the jBASIC INPUT statement accepts characters outside the ASCII printable range (decimal 32 through 126).

COMMAND SYNTAX CONTROL-CHARS {ON | OFF}

SYNTAX ELEMENTS CONTROL-CHARS ON

Disallows the input of control characters.

CONTROL-CHARS OFF

Allows the input of control characters.

CONTROL-CHARS

Reports the current state.

NOTES The default behavior is to allow the input of control characters. The jBASIC IN statement ignores the setting.

EXAMPLE CONTROL-CHARS Control characters OFF (allowed)

9

CP Utilizes the jBASE COPY command to output records from a file to a spooler print job.

COMMAND SYNTAX CP filename {recordlist} {(Options}

SYNTAX ELEMENTS filename is the name of the file from which to copy records. recordlist is the list of record ids which to copy, the recordlist may be supplied by an active SELECT list or default to all records in file. Options can be the following: X display in hexadecimal format.

EXAMPLE CP CUSTOMERS SMITH

10

CT Utilizes the jBASE COPY command to output records from a file to the terminal.

COMMAND SYNTAX CT filename {recordlist} {(Options}

SYNTAX ELEMENTS filename is the name of the file from which to copy records. recordlist is the list of record ids which to copy, the recordlist may be supplied by an active SELECT list or default to all records in file.

Options can be the following: X

display in hexadecimal format

EXAMPLE CT CUSTOMERS SMITH

11

DB-PAUSE {-art} This command will pause all database operations, through jEDI, to the database. For example... # 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

The -a option allows administrators (e.g. root users on UNIX) to continue making updates to the datajBASE.

The -r option still allows read operations on the datajBASE and therefore only pauses updates.

The -t option permits users inside a transaction to continue until it terminates the transaction by either a commit (TRANSEND) or a rollback (TRANSABORT). You can run the command a number of times with different options. For example, you might run it with the -a option to allow root users continued access. When you are sure all your normal users are paused, you can run it again without the -a option, which will suspend the updates for all users.

12

DB-RESUME There are no options to this command and must be run as root user. For example... # DB-RESUME DatajBASE is active, resumed at Mon Nov 25 16:00:33 2002

When run, it resumes all operations to the datajBASE.

13

DB-STATUS {-tvwV} Run this command as any user which also shows the status of the DB-PAUSE command For example # DB-STATUS DatajBASE paused at Mon Nov 25 16:00:50 2002

For READ and WRITE operations Updates are denied also to root users Transactions will be blocked immediately

Use the -t option to display users currently inside a transaction. The -v option is the verbose option. Use the -w option to display all users currently suspended and waiting for a DB-RESUME. The -V option is the very verbose option and is the equivalent of -t, -v and -w together.

EXAMPLE

# 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

14

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. Some general points on using these commands. 1.

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’s under the control of the application, any sort of delay might occur depending on the trigger.

2.

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 the files would only be in a kernel file cache rather than disk. You should wait 12 minutes for your sync demon 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 the data is consistently flushed to disk before attempting any operation that depends upon it. 3.

The DB-PAUSE command is extremely effective. So much of jBASE, both internal and application wise, writes to files that once it executes the DBPAUSE 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.

4.

Be wary of having jBASE commands in the login script for root user as this is bad practice, but even more so with DB-PAUSE. Be careful, not to pause a datajBASE, and when you 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.

5.

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 and ready for backups or splitting mirrors, the datajBASE records will not be consistent. If your applications use transaction boundaries use the -t option to DB-PAUSE meaning the transaction will complete and make your datajBASE logically correct. Using ‘DB-STATUS -t’ you can 15

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.

16

ECHO Sets or resets the jBASE echo enabled flag. This enables or suppresses input character echo, when using a jBASE program.

COMMAND SYNTAX ECHO {ON|OFF}

SYNTAX ELEMENTS ON resume input character echo . OFF suppress input character echo.

EXAMPLE ECHO OFF

17

ECHO-ON Sets the echo-enabled flag. This enables input character echo, when using a jBASE program.

COMMAND SYNTAX ECHO-ON

SYNTAX ELEMENTS None

EXAMPLE ECHO-ON

18

ECHO-OFF Resets the jBASE echo enabled flag. This suppresses input character echo, when using a jBASE program.

COMMAND SYNTAX ECHO-OFF

SYNTAX ELEMENTS None

EXAMPLE ECHO-OFF

19

HUSH The HUSH command resets the jBASE echo enabled flag. This suppresses input character echo, when using a jBASE program.

COMMAND SYNTAX HUSH{ON|OFF} – optional DEF toggles echo

SYNTAX ELEMENTS None

EXAMPLE HUSH

20

LISTDICTS The jBASE LISTDICTS command displays in page format the attribute definition entries in the MD/VOC file or the specified dictionary file.

COMMAND SYNTAX LISTDICTS {filename}

SYNTAX ELEMENTS Filename is the name of an alternative file.

EXAMPLE LISTDICTS PAYROLL

21

LISTF The jBASE LISTF command displays in page format all MD/VOC entries with attribute one set to either “D” or “Q”.

COMMAND SYNTAX LISTF

SYNTAX ELEMENTS None

EXAMPLE LISTF4 – Four column display LISTF3 - Three column display LISTF2 – Two column display

22

LISTU Use the LISTU utility to display information on processes executing jBASE programs. LISTU (Options

Option

Description

P

Redirect output to printer

N

No page

Calling the JBCUserCustomizeDisplay subroutine LIST-LOCKS customizes the output of the LISTU command. Provided to display and control locks taken by jBASE applications it provides several utilities.

Command

Description

LIST-FILES

List files option

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)

NOTE: Execution locks have been coded, as record locks on a temporary file and so will also be displayed as record locks.

23

LOGON/LOGOFF LOGON Use the LOGON utility to logon a background process to execute a user login. The user login will execute the *.profile, which can be modified in order to execute a logon proc via the “exec jsh -“ mechanism. LOGON Port, UserName, Password

LOGOFF The LOGOFF utility can be used to logoff another process. Root privileges are required to logoff another process logged on with a different user id. LOGOFF Port Port can also be in ther ange 1 - 10

24

LIST-OPEN-FILES This shows what files a user has open. By default, it shows a summary. For example

COMMAND SYNTAX jsh --> list-open-files Polling 3 ports ... Opened files at 19:52:16 Page

16 JUN 2003

1

Port

Application Open Files Actual O/S Open Files

0

258

247

1

8

8

2

4

4

NOTE: Many of the new commands get their information by polling active ports for their information. This can take 5-10 seconds.

With jBASE, 4.1 if you open the same file multiple times to different variables, then inside 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.

25

MSG The jBASE MSG command sends a message to other users using either port numbers or account/user ids.

COMMAND SYNTAX MSG {!port | account/userid } text

SYNTAX ELEMENTS !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.

EXAMPLES

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.

26

NOHUSH Sets the jBASE echo enabled flag. This enables input character echo, when using a jBASE program.

COMMAND SYNTAX NOHUSH

SYNTAX ELEMENTS None

EXAMPLE NOHUSH See also HUSH

27

OFF The OFF command will close down the current jBASE program. For example recommend using Exel to ensure no shell process to exit back to ON exception or ‘OFF’ and ensure system disconnection.on UNIX your .profile might have: exec MAIN.PROG or exec jsh If your .profile looks like this: MAIN.PROG or jsh Keep the UNIX shell active and the effect of the OFF command will be to return you to the UNIX shell.

28

SHOW-ITEM-LOCKS The SHOW-ITEM-LOCKS command displays details of locked items in jBASE-hashed files.

COMMAND SYNTAX SHOW-ITEM-LOCKS

NOTES Calling the JBCUserCustomizeDisplay subroutine can customize the output of SHOW-ITEMLOCKS. Use the CLEAR-ITEM-LOCKS command to explicitly clear a lock.

29

SLEEP The jBASE SLEEP command causes the process to sleep either until a specified time or for a specified number of seconds.

COMMAND SYNTAX SLEEP {time|seconds}

SYNTAX ELEMENTS 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.

NOTES If invoking the debugger during SLEEP and continuing execution it prompts the user: Continue with SLEEP (Y/N)?

If “N” is the response, the SLEEP will terminate.

EXAMPLE SLEEP 13:15 The process will sleep until 1:15 p.m.

30

SLEEP 300 The process will sleep for 300 seconds or 5 minutes.

31

SUBD The jBASE SUBD command subtracts two decimal numbers.

COMMAND SYNTAX SUBD Num1 Num2

SYNTAX ELEMENTS Num decimal number

NOTES Subtracts decimal number Num2 from decimal number Num1

EXAMPLE SUBD 89 10

79

32

TANDEM NOTE: (Supported through jBASE 3.4) The tandem command primarily provides users with the functionality to display output data from the specified jBASE port. In addition, use the tandem command to supply input data and the break signal to the specified jBASE port. This additional functionality enables users to control and debug jBASE programs connected to the specified port, from another terminal. The tandem command, by default, begins execution in view mode, i.e. only display output from the specified jBASE port. The specified port must be currently executing a jBASE program, i.e., jsh, when requesting tandem capabilities. TANDEM PortNo Where: PortNo is the port number of processes to view. These notes use the term Originator that refers to the process executing the tandem command and the term Target to refer to the process or processes specified by the port number. The following escape commands enable the Originator to interact with the Target.

Command

Description

ESC?

Display current mode.

ESC D

Force the current Target process into the jBASE debugger.

ESC E

Enable the Target terminal to supply input.

ESC F

Feed mode on. Enable Originator to input to the Target.

ESC I

Inhibit the Target terminal from supplying input.

ESC M

Message mode on. Send Originator input direct to the Target.

ESC R

Reset the Target terminal to raw input mode.

ESC V

View mode on. Enable Originator to view Target output. (Default).

ESC X

Exit mode. Turn off all modes and exit Originator.

ESC ESC

Send escape character from Originator, (feed or message mode).

33

TANDEM VIEW MODE COMMAND View mode allows the Originator to view all data output from the Target. View mode is the default mode selected when the tandem command begins execution. To return to view mode the Originator should enter ESC V.

TANDEM FEED MODE COMMAND Feed mode allows the Originator to provide input data to the Target. it continues to display all output from the Target on the Originator terminal. To enable feed mode the Originator should enter ESC F. Feed mode does not inhibit any input from the Target terminal.

TANDEM MESSAGE MODE COMMAND Message mode allows the Originator to output data direct to the Target terminal. The input data is not “seen” by any Target process. To enable message mode the Originator should enter ESC M. Message mode does not inhibit any input from the Target terminal or any output from the Target process.

TANDEM DEBUG COMMAND The debug command sends an enter debug request to the current Target jBASE process to enter the jBASE debugger. The debug request will be actioned irrespective of the break key status of the Target process. To issue the debug request the Originator should enter ESC D.

TANDEM EXIT COMMAND The exit command requests that the Originator resets all tandem modes and exits. The Target directs all output and input from the Target terminal. To invoke the exit command the Originator should enter ESC X.

TANDEM INHIBIT COMMAND The inhibit command suppresses input from the Target terminal. To invoke the inhibit command the Originator should enter ESC I.

TANDEM ENABLE COMMAND The enable command enables input from the Target terminal. To invoke the enable command the Originator should enter ESC E.

34

TANDEM RESET COMMAND The reset command issues a command to the Target terminal to reset the terminal for raw input. This setting is required on the Target terminal when the tandem command is in effect. Some operations by the Target process may modify this setting thus affecting the action of the tandem command, issuing a reset command may resolve any adverse affect. To invoke the reset command the Originator should enter ESC R.

RESTRICTIONS The tandem command is only available on UNIX platforms and must be executed as root. The port must be initialized and currently executing a jBASE program, i.e. jsh. Processes intervening jBASE processes on the Target port, e.g. jsh, sh, jsh, when executing the tandem command are not supported and may result in process hang-up. However, this restriction does not apply when invoking subsequent intervening processes after the execution of the tandem command. Therefore, execute the tandem command before execution of intervening processes. Certain commands cannot be supported, as they require direct interaction with the Target terminal either for system security or by design. Users should be aware that execution of the tandem command adds additional overheads to process execution and system resources.

35

TERM The jBASE TERM command enables users to specify different terminal types to handle terminal characteristics.

COMMAND SYNTAX TERM {type | parameters}

SYNTAX ELEMENTS 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, e.g. vt220, as a different name, then achieve this by linking the new name, e.g. V, to the terminfo entry for vt220. Specified parameters are as follows:

Parameters

Description

tlength

terminal line length

tdepth

terminal display lines per page

plength

printer line length

pdepth

printer display lines per page

reserved

reserved for future use

NOTES 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.

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.

36

TIME The jBASE TIME command returns the system current time and date.

COMMAND SYNTAX TIME

SYNTAX ELEMENTS None

EXAMPLE TIME 10:30:01 04 JUL 2001

37

WHERE Use the WHERE utility to display information on processes executing jBASE programs. WHERE Ports (Options

COMMAND SYNTAX Where Ports can be a range of Ports of the form Port-Port

Option

Description

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.

NOTES You can customize the output of WHERE Restricts display to save dadatbase by default. Use D option for all to override.

38

WHO 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.

COMMAND SYNTAX WHO {PortNumber} If specifying the PortNumber, it displays the user for that port. For some emulations, (e.g. ros), it displays the system name and login user id.

39

XTD DTX 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 SYNTAX

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

40

Customizing the output of commands JBASE contains a variety of utilities of which the use of some provides an alternative interface to UNIX commands while others enable or disable certain jBASE features. It is possible for a customer to modify the output characteristics of the WHERE, LISTU and SHOWITEM-LOCKS utility programs by creating a subroutine called by these programs, which are accessible to all users who will call the programs. The name of this fixed subroutine is: JBCUserCustomiseDisplay

It is passed to a single parameter, which is both the input and the output parameters and is called as a common subroutine for WHERE, LISTU and SHOW-ITEM-LOCKS. It is called once at the start of each program to present the heading information, and once again for each line of output data to the screen (or printer). The subroutine can choose to modify the headers and output data as required, and can do so differently for each command, or add it’s own options. For example: add a new command line option such as (U) on the command line to specify that it should display the user location details.

There are two ways to call a subroutine. 1. Header Specification It presents the following information to the caller in the single parameter:

attribute 1

One of “WHERE”, “LISTU” or “SHOW-ITEM-LOCKS”

attribute 2

Always 1 to show it is presenting the headers.

attribute 3

A multi-value list of the heading text, one value per column.

attribute 4

A multi-value list corresponding to attribute 3, which has numeric definitions to describe the column. Contains these definitions in the supplied JBC.h file. This makes it more portable to find, for example, in which column it displays the port number. Use this code, to find in which column number it presents the port number.

INCLUDE JBC.h LOCATE CUSTOM_TYPE_PORT_NUMBER in parameter<4> SETTING .... attribute 5

This is the width of each heading column. This value does not include the delimiter added by the jBASE program.

2

Body Specification It calls the subroutine once for each line of body data that is output by the jBASE program. When completed it presents the following information to the caller in the single parameter

attribute 1

One of “WHERE”, “LISTU” or “SHOW-ITEM-LOCKS”. Do not amend this attribute

attribute 2

Always “2” to show it is presenting the data. Do not amend this attribute.

attribute 3

A multi-value list of the data it wishes to display. Each value corresponds to the layout in the heading as presented in the first call shown above. For example, if it presented the account name in the 3rd column of the output of WHERE, then the account name will be in the 3rd multi-value of this attribute 3, and the first call, which defines the headings, will have multi-value 3 in attributes 3,4 and 5 defining the account name. If you want to remove a complete row of data, then in attribute 3 return a null string.

NOTES When finding locating in which column it holds a particular piece of information, REMEMBER: if you insert or delete fields, it could invalidate that field number. The order of finding the information is important. For example, you might use LOCATE (as in the examples) to locate the column in which the Account name appears during the WHERE command, usually by default is column 3. If you later decide to delete the Port number, in column 1, then it displays the Account name in column 2 instead of column 3.

The WHERE command, has the (V) option, which means it displays multiple lines of information for each jBASE active program. When this happens you probably want to mimic the layout of the WHERE command i.e. it only displays the columns such as Port, Device, Accounts on the first row of data for each jBASE process

The ‘Command’ column on the WHERE command and the ‘FILENAME’ and ‘RECORD KEY’ columns for the SHOW-ITEM-LOCKS commands vary in width and are initially created so the command fits the entire width of the available screen. If you modify the columns to display, the jBASE commands WHERE and SHOW-ITEM-LOCKS will re-calculate their variable length fields

3

to fits onto the screen width. The LISTU command has no such fields; therefore, the programmer must ensure all modified fields will fit onto the screen width.

EXAMPLE 1 Remove the “Device” column from the output of the WHERE command. The output of a WHERE command that is:

Port 10

Device Ttyp0

Account

PID

Command

Jbase32

8838

Jsh

8840

ED BP

TASKLIST

12

Ttyp2

JBASE32

11328

WHERE

14

Ttyp1

JBASE32bld

11327

ADD.CUSTOMER

Is changed to:

Port 10

Account

PID

Command

JBASE32

8838

Jsh

8840

ED BP

TASKLIST

*12

JBASE32

11328

WHERE

14

JBASEbld

11327

ADD.CUSTOMER

This is the required subroutine. SUBROUTINE JBCUserCustomiseDisplay(rec) Customize so that for the WHERE command only, we will not display the DEVICE column. In order to keep the functionality quicker, we will use named commons * so we aren’t permanently opening and closing files. INCLUDE JBC.h COMMON /JBCUserCustomiseDisplay/ device.column IF rec<1> EQ “WHERE” THEN ; Limit ourselves to the WHERE command IF rec<2> EQ “1” THEN

4

This is the call that defines the heading statements. * Look to see where the device name is stored. * LOCATE CUSTOM_TYPE_DEVICE_NAME IN rec<4> SETTING device.column THEN * * Delete the three values that define, for the device name, the heading * text, the heading identifier and the heading width. * DEL rec<3,device.column> DEL rec<4,device.column> DEL rec<5,device.column> END ELSE device.column = zero END END ELSE * * this is a line of data. Remove the data for the device name * as we did for the heading statement. * IF device.column THEN DEL rec<3,device.column> END END END RETURN

EXAMPLE 2 In this example we: Remove the device name column as we did in the first example. Insert a new column of our own which we will call ‘Location’; data we create ourselves will fill this column. In this example, it is simply a cross-reference between the port number and a record keyed on the port number. The account name field will change to a width of 16. This will allow us extra room to add a (S) to the account name if we find the user is in sales. Therefore, the output of WHERE will change from: 5

Port 10

Device

Account

PID

Command

Ttyp0

Progerm

8838

Jsh

8840

ED

BP

Newshell

*12

Ttyp2

JBASE32

11328

WHERE

14

Ttyp1

Dorisk

11327

ADD.CUSTOMER

to:

Port 10

Account

Location

PID

Command

Rogerm(S)

Sales Station

128838

Jsh

8840

ED

BP

Newshell

*12

JBASE32

Developer Desk

11328

WHERE

14

Dorisk

Marketing SW

11327

ADD.CUSTOMER

Here is the required code. SUBROUTINE JBCUserCustomiseDisplay (rec) Customize ourselves purely for the WHERE command. *

The output for WHERE is normally like this:

* Port

Device

Account

PID

Command

* We will modify the output in the following manners *

(a) Delete the Device column

*

(b) Insert a new “Location” field, preferably after the

* Account field *

(c) Update the Account column to be 16 characters and

* append (S) for sales * This means the heading now looks like: * Port

Account

Location

PID

Command

In order to keep the functionality quicker, we will use named commons * so we aren’t permanently opening and closing files. *

6

INCLUDE JBC.h COMMON /JBCUserCustomiseDisplay/ FILEVAR, delvalue COMMON /JBCUserCustomiseDisplay/ insvalue, accvalue COMMON /JBCUserCustomiseDisplay/ okayflag, portnumber * * This function is called by many commands other than * the WHERE command, command = rec<1> type = rec<2>

; Extract the name of the command

;* Extract the type of call.

BEGIN CASE CASE command EQ “LISTU”

;* Ignore the LISTU command (for

clarity) CASE command EQ “SHOW-ITEM-LOCKS” ;* Ditto CASE command EQ “WHERE” * It is only the WHERE command we are interested in. * The other CASE statements added for clarity of code only See if this is a heading statement or line of details * IF type EQ “1” THEN * * This is the heading definition. The rest of the ‘rec’ is made up as follows * attribute 3: Multi-value list of heading text * attribute 4: Multi-value list of heading definitions * attribute 5: Multi-value list of widths of each column Open the LOCATION file for our use. * OPEN “LOCATION” TO FILEVAR ELSE okayflag = zero RETURN END okayflag = one * * Find out where we can extract the port number from. * LOCATE CUSTOM_TYPE_PORT_NUMBER IN rec<4> SETTING portnumber ELSE

7

okayflag = 0 rec = recsave RETURN END * * (a) Find the Device Name to delete recsave = rec LOCATE CUSTOM_TYPE_DEVICE_NAME IN rec<4> SETTING delvalue THEN DEL rec<3,delvalue>

; Delete the heading text

DEL rec<4,delvalue>

;* Delete the definition

DEL rec<5,delvalue>

;* Delete the width

END ELSE delvalue = 0

;* Cannot find the heading

END (b) We will add the ‘Location’ value AFTER the account name LOCATE CUSTOM_TYPE_ACCOUNT_NAME IN rec<4> SETTING insvalue THEN insvalue++

; This is the value we insert BEFORE

END ELSE insvalue = 2

;* Default to becoming the second

column END INS “Location” BEFORE rec<3,insvalue> ;* Insert the text INS “99” BEFORE rec<4,insvalue>

;* Insert a dummy

value for the heading definition INS “20” BEFORE rec<5,insvalue>

;* Insert the width

to use (c) Find the column of the Account definition * LOCATE CUSTOM_TYPE_ACCOUNT_NAME IN rec<4> SETTING accvalue ELSE accvalue = 0 END* END ELSE

8

This is a line of data in attribute 3 Each column is * multi-valued We will amend this line of data according * to the data we extracted earlier. Make sure the OPEN went okay * IF NOT(okayflag) THEN RETURN END * * Extract the port number before we do anything else. * port = rec<3,portnumber> * * (a) Delete the Device Name * IF delvalue THEN DEL rec<3,delvalue> END * * (b) Insert the LOCATION information. * IF port NE “” THEN READ location FROM FILEVAR, port ELSE location = “UNKNOWN” END END ELSE location = “” END IF insvalue THEN INS location<1> BEFORE rec<3,insvalue> END * * (c) Amend the account name to have (S) appended if a sales account accname = rec<3,accvalue> IF NOT(LEN(accname)) THEN location = “” END

9

; The account name or “”

IF location<2> = “SALES” AND LEN(accname) THEN rec<3,accvalue> = accname :” (S)” END END END CASE RETURN

10

INDEX A

L

ACCOUNT ........................................7 ADD.CUSTOMER........................4, 6 ADDD..........................................9, 47 ADDX........................................10, 47 attribute 1 .......................................2, 3 attribute 2 .......................................2, 3 attribute 3 ...................................2, 3, 7 attribute 4 .......................................2, 7 attribute 5 .......................................3, 7 AUTOLOGOUT..............................11

LISTDICTS ..................................... 29 LIST-EXECUTION-LOCKS.......... 31 LISTF .............................................. 30 LIST-GROUP-LOCKS ................... 31 LIST-LOCKS .................................. 31 LIST-RECORD-LOCKS................. 31 LIST-SYSTEM-LOCKS ................. 31 LISTU.............................. 2, 3, 4, 6, 31 LOGOFF ......................................... 32 LOGON ........................................... 32

B

M

BREAK-KEY-ENABLE .................12 BREAK-KEY-OFF .........................13

MSG ................................................ 34

C

NOHUSH ........................................ 35

CLEAR-BASIC-LOCKS.................31 CLEAR-ITEM-LOCKS.............15, 37 CLEAR-RECORD-LOCKS ............31 COMO .............................................16 CONTROL-CHARS........................17 CP ....................................................18 CT ....................................................19 D DB-PAUSE {-art} ...........................20 DB-RESUME ......................21, 22, 23 E ECHO ..................................25, 26, 27 ECHO-OFF......................................27 ECHO-ON .......................................26 H HUSH ..............................................28 J JBCLOGNAME ..............................46 jEDI ...........................................19, 20 jSHELL............................................45

N

O OFF.................... 11, 16, 17, 25, 27, 36 OPEN................................................. 7 P pdepth .............................................. 43 plength ............................................. 43 PORT............................................. 2, 7 PROG .............................................. 36 R reserved ........................................... 43 S SHOW-ITEM-LOCKS.. 2, 3, 6, 15, 37 SHOW-RECORD-LOCKS ............. 31 SLEEP ....................................... 38, 39 SP-ASSIGN Use to assign formqueue ............. 43 STATUS.................................... 22, 23 SUBD ........................................ 39, 47 T Tandem Feed Mode Command ................. 40

1

Message Mode Command ........... 40 TANDEM............................ 40, 41, 42 View Mode Command ................ 40 TANDEM DEBUG COMMAND... 41 TANDEM ENABLE COMMAND. 41 TANDEM EXIT COMMAND ....... 41 TANDEM FEED MODE COMMAND................................ 41 TANDEM MESSAGE MODE COMMAND................................ 41 TANDEM RESET COMMAND .... 42 tdepth ............................................... 43 TERM.............................................. 43

ii

TERM 132,,,,,,112,30.......................43 TERM vt220 ....................................43 TIME................................................44 tlength...............................................43 TYPE..........................................2, 5, 7 W WHERE .......................2, 3, 4, 5, 6, 45 WHO ................................................46 X XTD DTX ........................................47

COMMENT SHEET Please give page number and description for any errors found: Page

Error

Please use the box below to describe any material you think is missing; describe any material which is not easily understood; enter any suggestions for improvement; provide any specific examples of how you use your system which you think would be useful to readers of this manual. Continue on a separate sheet if necessary.

Copy and paste this page to a word document and include your name address and telephone number. Email to [email protected]

2

Related Documents

Jbase General Utilities
January 2021 1
Jbase Configuration
January 2021 1
Jbase Tools
January 2021 1
11 Utilities
January 2021 0
Jbase Query Language
January 2021 1
Jbase Command Language
January 2021 1