Technical Manual
Technical Manual
Technical Manual
A publication of:
Baan Development B.V.
P.O.Box 143
3770 AC Barneveld
The Netherlands
Technical Manual
i
Table of contents
Technical Manual
ii
Table of contents
Technical Manual
iii
Table of contents
Network 9-17
TRITON Super Set 9-18
Time zone utilities 9-20
Middleware 9-20
UNIX equivalents 9-20
Miscellaneous 9-21
10 Errors 10-1
General 10-1
UNIX errors 10-1
Database errors 10-4
11 Shared memory management 11-1
General 11-1
Using the shared memory manager 11-1
Installation of shared memory 11-2
Create an entry in the file shm_param file 11-2
Determine shared-memory parameters 11-3
Using shmvalues6.2 11-3
Using shmmanager6.2 11-4
Fill the entry in the shm_param parameter file 11-5
Installation of shared memory 11-6
Starting shmtimer6.2 11-6
Error messages during installation 11-7
Syntax srdd_tab 11-9
Filling shared memory 11-10
Kernel requirements 11-11
General description of adjusting UNIX kernels 11-11
Kernel parameters 11-12
General kernel parameters 11-17
Example parameter file shm_param 11-18
12 Remote databases 12-1
General 12-1
Settings for remote database configurations 12-2
Local host 12-3
Remote 12-4
Local 12-4
tabledef6.2 12-5
User files 12-5
Remote 12-7
Local and remote tables 12-8
Settings for remote menus/forms/objects 12-8
Technical Manual
iv
Table of contents
Technical Manual
v
Table of contents
Authorizations 14-20
Format of audit files 14-22
auditdef6.2 14-22
Information file 14-23
Sequence file 14-26
audit_spec file 14-31
15 OLE Automation 15-1
General 15-1
BaanERP as OLE Automation server 15-2
Restrictions 15-4
Example: Import BaanERP users 15-4
DLL function example 15-5
Visual Basic example 15-6
Example: Using BaanERP SQL 15-7
DLL information 15-7
Technical Manual
vi
About this document
This document is a reference guide explaining how you can customize the
BaanERP application for use by specific organizations. It is intended for use by
BaanERP application developers and application managers. You can use this
reference guide to set up and maintain a BaanERP application.
In this document you will find information about database tools and
management, audit management, native language support, and terminal
information, as well as some limited installation instructions.
Chapter 1, “Installing BaanERP Windows (BW),” describes how to install
BaanERP Windows (BW). This assumes that you already have BaanERP
installed on the server.
Chapter 2, “BI server,” summarizes how to install the BaanERP Internet Server
application, which is used as a gateway between the BaanERP Internet client
(BI) and the BaanERP application server (Bshell), to expose the BaanERP
functionality to the Internet domain.
Chapter 3, “Database tools,” describes tools you can use for the following tasks:
n Convert a database table to a sequential file (bdbpre)
n Create a database table from a sequential dump or append data to an existing
database table (bdbpost)
n Reconfigure a database table according to a new data dictionary
(bdbreconfig)
n Check or repair the referential integrity within the database (refint)
Chapter 4, “Database management,” discusses the working and usage of several
protocols that can be used for local and remote communication.
Chapter 5, “Native language support,” describes the communication between the
character set of a terminal and that of Bshell6.2.
Chapter 6, “Information files,” describes terminal information files, which store
information such as the type of terminal, terminal operations, how to access keys
on the keyboard, color support, cursor movements, and whether code features are
blinking, bold, or reverse.
Technical Manual
vii
About this document
Chapter 7, “User Interface (UI) Page mode,” describes the User Interface (UI)
Page mode in BaanERP. In normal mode, the 4GL Engine validates the entered
data per field. In the UI Page mode, the 4GL Engine validates data per page
rather than per field. The synchronous interaction between the UI driver and the
Bshell is therefore significantly reduced, which improves response times.
Chapter 8, “Customer support tools,” describes two functions used for solving
errors in a Bshell environment: error logging and the bserel6.2 program. Error
logging is keeping a record of error messages in a log file. The program bserel6.2
provides information on the BSE environment as installed on your system.
Chapter 9, “Executable programs,” describes all of the executable programs used
for database management.
Chapter 10, “Errors,” describes all the errors that can occur when you are
working in the BaanERP environment, and offers a solution.
Chapter 11, “Shared memory management,” discusses shared memory, which is
a part of the internal memory intended for common usage.
Chapter 12, “Remote databases,” explains how the BaanERP client/server
architecture enables the user to work with databases distributed over one or more
systems.
Chapter 13, “Multibyte Management,” explains how to use the 32-bit wide
character space, which has been implemented in BaanERP Tools to support all
possible character sets.
Chapter 14, “Audit Management,” describes the audit management facility
including the audit server, the audit management utility, and where audit data is
stored.
Chapter 15, “OLE Automation,” describes how BaanERP works with OLE
Automation, an industry standard that applications use to expose their OLE
objects to development tools, macro languages, and other applications that
support OLE Automation.
Technical Manual
viii
1 Installing BaanERP Windows (BW)
This chapter describes how to install BaanERP Windows (BW). It assumes that
BaanERP is already installed on the server. If this is not the case, refer to the
database-specific installation guide.
BaanERP Windows (BW) is a graphical user interface (GUI) program in
BaanERP. BW runs on an Intel compatible PC in a Windows 95 or Windows NT
environment. BW displays BaanERP as an application with the same look and
feel as a native Windows application.
This chapter describes:
n The hardware and software requirements
n How to install the BaanERP Windows (BW) software
n The installation directory of BaanERP Windows (BW)
n The BaanERP Windows (BW) environment variables
Technical Manual
1-1
Installing BaanERP Windows (BW)
Technical Manual
1-2
Installing BaanERP Windows (BW)
Click Install new environment if you perform a fresh installation, and enter
a name for the new installation. If you want to upgrade an existing BW
installation, you must click Select existing environment to choose the
existing environment to be upgraded. Choose Next to continue.
5 The Choose Destination Location dialog box is displayed. The layout of the
dialog box depends on whether you are installing BW on a PC client or a
Windows NT server.
If you are installing on a PC client, the following dialog box is displayed:
Technical Manual
1-3
Installing BaanERP Windows (BW)
Accept the default path or choose Browse to enter another path. Choose Next
to continue.
6 The Setup Type dialog box is displayed:
Technical Manual
1-4
Installing BaanERP Windows (BW)
Technical Manual
1-5
Installing BaanERP Windows (BW)
− Connect As
Enter a valid user name as known on the BaanERP server.
− Ask password at startup
If this check box is selected, you can only supply the password during the
BaanERP login procedure.
− Use saved password
If this check box is selected, the BaanERP logon procedure is skipped,
and the saved password is used.
− Current user
Select this check box to make use of the Windows Integrated Security
feature. In this case you will use your current user identity to log on to the
BaanERP Windows NT server.
NOTE For Windows 95 the unified logon feature will only work if you are
actually logged on to Windows 95.
NOTE You can only make use of the Windows Integrated Security feature, if
your BaanERP server is a Windows NT server.
− BSE
Enter the path to the BSE environment on the BaanERP server (equals the
BSE environment variable on the BaanERP server).
− Bshell name
Enter the application logic to use on the remote BaanERP host (changing
the default of bshell will only be useful during debugging).
− Command
Enter the option you want to pass to the bshell. You can, for example,
define environment variables by using the following syntax:
-- -set Environment Variable1=xxx -set Environment Variable2=yyy
Technical Manual
1-6
Installing BaanERP Windows (BW)
NOTE The BaanERP .bwc files are registered by the Windows NT or Windows 95
operating system. You can find the .bwc files in the directory Lib\User under
the installation directory of the BaanERP client software. This implies that
you can start a BaanERP logon procedure by double-clicking the icon in front
of the relevant .bwc file in the File Manager. You can also make BaanERP
program icons by dragging the .bwc configuration files to a Program Group.
Technical Manual
1-7
Installing BaanERP Windows (BW)
Technical Manual
1-8
Installing BaanERP Windows (BW)
Technical Manual
1-9
Installing BaanERP Windows (BW)
Functionality of BECS
The BECS utility offers the following functionality:
n It takes the ownership of files with the extension .bwc. By doing this, it
resolves the potential conflict described above. After BECS is correctly
installed, you will start BECS by double clicking on a .bwc file. Based on the
location of your .bwc file, BECS will locate the associated BW version, and
start this BW version accordingly. For this, your .bwc file must be stored in
the lib\user subdirectory of the directory where you installed the BW version.
BECS will start bin\BW.exe in this same directory.
n It can show you the different BW-versions installed on your system. Once the
BW versions have been registered, you will get an overview of all the .bwc
files for the BW versions if you start BECS. This enables you to go to the
configuration screen for each of the .bwc files, and to launch BW using the
selected configuration screen.
Technical Manual
1-10
Installing BaanERP Windows (BW)
3 Please edit this file, and replace the portion $(BSE)\bin\BECS.exe by the
path of your choice, for example, C:\Program Files\Baan\BECS.exe.
4 Execute the file BECS.reg by double clicking it. This will make BECS.exe
the owner of all .bwc files.
Registering BW environments
To let BECS.exe show all available .bwc files, you must create registry keys for
all BW environments. You can do so by following the steps below:
1 Start regedit
2 Go to HKEY_LOCAL_MACHINE\SOFTWARE\Baan
3 Create a new key for each BW environment you want to register, for
example, both Baan4 and Baan5. Within each key you must add a new string
value named BSE, containing the patname to the directory where you
installed the BW version. For example, the settings could look like the ones
below:
[HKEY_LOCAL_MACHINE\SOFTWARE\Baan\Baan4]
"BSE"="C:\\Program Files\\Baan\\Bw4"
[HKEY_LOCAL_MACHINE\SOFTWARE\Baan\Baan5]
"BSE"="C:\\Program Files\\Baan\\Bw5"
Technical Manual
1-11
Installing BaanERP Windows (BW)
Technical Manual
1-12
2 BI server
Introduction
The BaanERP Internet Server ap
plication (BI server) is used as a gateway between the BaanERP Internet client
(BI) and the BaanERP application server (Bshell), to expose the BaanERP
functionality to the Internet domain.
Architecture
The architecture of the BI server is shown in the following figure:
Technical Manual
2-1
BI server
One of the HTML pages, which is managed by the HTTP server, contains a
reference to the BI applet. When a browser performs a GET for this page, the
BI applet is downloaded to the requesting browser. The HTTP-server system
and the application-server system can be one system or they can be two
distinct systems.
n A client system running a Java-enabled HTML browser. The BI applet runs
within this browser. The BI applet establishes a direct TCP/IP connection
with the BI server running on the HTTP-server system or on another system.
The following figure shows a timing diagram for setting up the connection
between a BI applet and a Bshell using the BI server.
Technical Manual
2-2
BI server
Security is important when you offer application functionality over the Internet.
Security provision is available at three levels:
1 The HTTP server security mechanisms can be used to offer secure access to
the HTML page containing the BI applet.
2 Secure communication between the BI server and the BI applet is supported
using the Secure Sockets Layer (SSL) v3.0 protocol.
3 Application-server system authentication.
The first level can be used to restrict access to the BI applet to a set of registered
users. This feature is completely dependent on the HTTP server and is not
described here.
The second level offers secure communication between the BI server and the BI
applet. At this level the SSL protocol is supported. The SSL protocol provides
connection security that has these basic properties:
n The connection is private. Encryption is used after an initial handshake to
define a secret key. Symmetric cryptography is used for data encryption.
n The peer’s identity can be authenticated by using asymmetric or public key
cryptography.
n The connection is reliable. Message transport includes a message integrity
check using a message authentication code (MAC).
The BI server uses a CipherSuite that does not offer server-side certification or
client-side authentication. Furthermore, the CipherSuite uses exportable versions
of the cryptographic algorithms so that the software can be delivered to all
countries.
Note that Secure Sockets Layer (SSL) client-side certification is not used,
because this would require that each client get and store a certificate from a
certification authority. Instead, client authentication relies on the user name and
password validation used to connect to the application-server system. When you
use a Secure Sockets Layer (SSL) connection, this user name and password are
encrypted when they are transmitted from the BI applet to the BI server. In
addition, you can restrict access to the HTML-page containing the BI applet by
using the HTTP server security mechanisms, which might also require client
authentication.
The BI server can be configured to use:
n No Secure Sockets Layer (SSL) security
n Secure Sockets Layer (SSL) security
Technical Manual
2-3
BI server
Configuration
The BI server allows for configuration of important communication parameters
by a system administrator. These configuration parameters include:
n Listener port
n Enable/disable Secure Sockets Layer (SSL) security
n Application-server system name or IP address
n Enable/disable logging of access history and errors
n When logging is enabled, the log file name
Performance requirements
The number of clients that can be supported by a single BI server application is
not restricted by the BI server. However, the Java virtual machine or the
underlying operating system can limit the number of simultaneous clients
supported by one instantiation of the BI server.
Technical Manual
2-4
BI server
Installation requirements
These are the requirements for installing the BI server and BI client components
on the HTTP-server system.
Before installing the BI components on the HTTP-server system, you must
install and configure the following third-party products:
n An HTTP server. The operating system of the HTTP-server system
determines which HTTP server must be installed. To run the HTTP server on
a Windows NT server, you must install Microsoft Internet Information Server
(IIS). If your server is running on a UNIX system you can, for example,
install Netscape Enterprise servers or Apache.
n A Java virtual machine compatible with Java 1.1. The operating system of the
HTTP-server system determines which Java virtual machine must be
installed. Contact your operating system supplier to get an implementation of
a Java virtual machine.
The java string is the name of the Java interpreter. This name is supplier-
dependent (for example, jview for the Microsoft Java virtual machine).
Technical Manual
2-5
BI server
Technical Manual
2-6
BI server
Technical Manual
2-7
BI server
Options
–s
When this option is specified, the Secure Sockets Layer (SSL) is enabled . When
this option is not specified, SSL is disabled. When security is enabled, the BI
applet must also use SSL for communication with the BI server. The BI applet
gets this information through the applet parameters in the HTML page. See the
parameter SECURITY in the section “Adjusting the BI HTML-page.”
–l logfile
When this command is specified, logging of access history and errors is
redirected to the file defined by the logfile placeholder. When this command is
omitted, logging information is sent to the standard output, the Java console. The
level of logging detail is set with the –t command.
–c
When this option is specified, the logging file indicated with the option –l is first
cleared, that is, truncated. If this option is not specified and the logging file
specified with the –l option already existed, all logging information is appended
to this file.
–t level
When this option is specified the level of detail for logging can be specified. A
higher level gives more detail. Level 0 disables logging. The default for this
option is level 1. The maximum level is 3.
–p port
This mandatory option is used to specify the port number on which this BI server
listens for incoming BI applet connections. Usually a port number higher than
1024 must be chosen, because lower numbers are reserved for system services.
The BI applet must also use this port number when connecting to the BI server.
The BI applets gets this port number via the applet parameters in the HTML
page. See the parameter PORT in the section “Adjusting the BI HTML-page.”
–a appserver
This mandatory parameter specifies the application-server system. The appserver
can be the hostname of the application-server system or its IP address.
Technical Manual
2-8
BI server
4 Start a registry editor, for example, regedt32, and perform the following
steps:
− Look up HKEY_LOCAL_MACHINE\SYSTEM\
CurrentControlSet\Services\BiService1.
− Add another key under this key named: Parameters
− Add the values listed in the following table to this key:
Registry values
Value name Value type Value string
Technical Manual
2-9
BI server
Technical Manual
2-10
BI server
Client issues
At the time of writing this document, no detailed information about the supported
browsers at the client side could be given. For the most up-to-date information
about the supported browsers refer to the file
$PUBLIC_HTML/$TARGET_DIR/client/readme.txt, installed on the HTTP-
server system.
Technical Manual
2-11
BI server
Technical Manual
2-12
3 Database tools
General
The database tools are designed for database management, and are independent
of how the database is organized. At run time the system selects a database driver
depending on the contents of the file tabledef. You can then use these database
tools to:
n Convert a database table to a sequential file (bdbpre)
n Create a database table from a sequential dump or append data to an existing
database table (bdbpost)
n Reconfigure a database table according to a new data dictionary
(bdbreconfig)
n Check or repair the referential integrity within the database (refint)
If there are changes in the data dictionary, for example, if fields are added or
field lengths are changed, you can reconfigure the old table to a new one. The
data dictionary changes are incorporated in the new table, which also contains
the data dictionary table data.
The system you use determines the extension for the database tool name. For
example, bdbpre used on Windows NT is called bdbpre.exe, and on UNIX it is
called bdbpre6.2.
The following is a description of each of the database tools.
bdbpre
NAME
bdbpre
Convert database tables to a sequential file.
SYNOPSIS
bdbpre [–q output file] [–uUvVsrxyzkK][–p pack_comb][–t sep][–o dir]
[–d driver type][–N table [table ..]][–I file][–E file][–O file]
[–C company number list/range]
Technical Manual
3-1
Database tools
DESCRIPTION
The bdbpre tool reads tables for given company numbers, converts them into
sequential data and writes them to standard output. This output can be redirected
to a file that can be used as input for bdbpost.
The bdbpre tool prints information such as names, the number of records, and
any errors. You can use the –s option to suppress the messages produced by
bdbpre at run time. This option is useful when you use the output of bdbpre as
the direct input to bdbpost.
The file fd6.2.package combination is always used for searching dictionary
information. The following examples use $BSE/lib/tabledef6.2 to get
information about the database type and driver. If you want to use a specific
database driver for a particular conversion, you can use the –d option. If you use
this option, tabledef6.2 is not read.
You can use bdbpre in the following ways:
n You can convert a database table for more than one company number by
specifying a range of company numbers. For example:
bdbpre –Ntimcs099 –C000-005 > timcs099_dump
n You can convert a database table for given company numbers. For example:
bdbpre –Ntimcs088 –C000 004 005 > timcs088_dump
n You can specify all the tables for which you want to create a sequential dump
in some file in package module format. The –I option reads this file and
creates a sequential dump for each table and the specified company numbers.
For example:
bdbpre –Iseqfile –C000-009 > BIGdump
Type cat seqfile to view the contents of seqfile:
timcs001
timcs002
timcs003
........
timcs099
Technical Manual
3-2
Database tools
Technical Manual
3-3
Database tools
–N
Database table name. Specify specific table names, for example, –N timcs000
timcs016. The –I and –N options are mutually exclusive.
–I
Input file with table names. The –I and –N options are mutually exclusive.
–E file
Redirects errors to file
–O file
Redirects output to file
–q output file
Redirect terminal output to file output file
–k
Drop table after dump is created.
–K
Drop table. Create a backup before dropping. This is only possible if the DBMS
supports this.
–t
Used to insert a separator (Default \0). Useful for separating the fields when
downloading records from the Bshell.
EXAMPLE You want to download your database to UNIFY which uses | as a separator.
Whenever you specify the –t parameter, a sequential file (.S) is created for each
table in the current directory unless the –o option is specified.
EXAMPLE bdbpre –t"|" –Ntimcs016 –C000 creates timcs016000.S in the current
directory. This sequential file is an ASCII dump of table timcs016000, in which
case the fields are separated by |. You can load this file directly into Oracle,
UNIFY, and so on, using SQL.
The options –x and –t are mutually exclusive.
–x
Creates an ASCII dump with a fixed-length record and without any separators.
This option is useful for downloading to databases such as dBASEIII, which
require fixed-length records without any separators.
In some cases a value is printed in the dump file that does not match the number
of digits before decimal points (DIGV). For example, suppose DIGV=3 and the
printed value=1234. The whole value, more than 3 digits, is written in the dump
file, and an error message appears. To prevent this, you can use the following
options in combination with the –x option:
Technical Manual
3-4
Database tools
–y
Skip out-of-domain records for fixed-length dumps. See –x.
–z
Set value to 0 (zero) if value and DIGV do not match, that is, nullifies out-of-
domain records. Creates individual, fixed-length ASCII File with the extension
.F. See –x.
EXAMPLE bdbpre –x –Ntimcs016 –C000 creates timcs016000.F, which is an ASCII dump
with fixed-length records. This file can be loaded directly into dBaseIII.
–o
Can be specified with the options –x and –t to specify the directory name in
which the sequential file is created (.S or .F).
EXAMPLES Convert Informix database to a sequential dump. The database driver is explicitly
Informix.
bdbpre –dinformix –Ntimcs000 –C000-004 > timcs000_dump
The database driver is retrieved from $BSE/lib/tabledef6.2
bdbpre –Ntimcs000 –C000-005 > timcs000_dump
Convert Oracle to Informix.
bdbpre –s –doracle –Nttadv099 –C000 001 | bdbpost –dinformix
Transport the file to another database:
bdbpre –t"|" –d"oracle(ORACLE_SID=D1)" –Ntimcs016 –C000 –oor_dump_016
bdbpre –x –dinformix –Ntimcs016 –C000 –oci_dump_016
SEE ALSO
bdbpost
NOTES If you are piping your bdbpre output directly to bdbpost without giving the –s
option, messages on the screen are jumbled.
If the –d option is not used, the database driver is taken from
$BSE/lib/tabledef6.2. Also, if a remote driver is specified in tabledef6.2 the
database table from the remote machine is used, but the data dictionary is taken
from the current machine, which can cause great difficulties.
Technical Manual
3-5
Database tools
bdbpost
NAME
bdbpost
Create a database table from a sequential dump or append data to an existing
database table.
SYNOPSIS
bdbpost [–I input file][–O output file][–{qE} output file]
[–uUvVARfilxnmkK][–p pack_comb][–e file][–d driver type][–D seq_dir]
[–t sep] [–c compnr][–C compnr range][pattern]
DESCRIPTION
The bdbpost tool reads from either the argument you supply or from the
standard input and creates a new database table if that table does not exist. If the
append option is turned on, it appends data to an existing table. The bdbpost
tool also compares current data dictionary information with the information in
the dump. If they do not match, the bdbpost tool gives an error. If the current
data dictionary is not present, it creates a data dictionary based on the dump. For
each table, bdbpost prints information such as the table name, indexes, the
number of records, and any errors.
The bdbpost tool can be run using a sequential dump created by bdbpre or by
using sequential dumps from other databases. The different methods are shown
in the following examples:
This example shows how to use a sequential dump created by bdbpre.
On system 1:
bdbpre –doracle –Ntimcs016 –C000-003 > timcs_dump
On system 2:
bdbpost < timcs_dump
This example shows the use of sequential dumps (–x or –t option of bdbpre)
from other databases. In this case the –D option is mandatory to get the directory
name in which .S files are stored.
bdbpost –dinformix –t"|" –D./seqdir
bdbpost –doracle –x –D./seqdir
Options –x, –t, and –D are required when you upload ASCII files from another
database to the Bshell format.
Technical Manual
3-6
Database tools
–D
Path for sequential files, which have the extension .S or .F.
–t
Separator. If you want to load a sequential dump containing separators
(for example, dump from UNIFY has separator |), make sure the file name is the
table name with the extension .S.
EXAMPLE If you want to load a UNIFY sequential dump into the table ttimcs016000, first
move the sequential dump to the ttimcs directory with name ttimcs016000.S.
bdbpost –Dttimcs –t"|" searches for a .S file in ttimcs and if that file is found,
the corresponding tables are created or appended.
CAUTION With the –D option all .S files in that directory are used to create/append the
tables, so be sure to remove unwanted .S files before running bdbpost.
–x
If you want to load a sequential dump with a fixed-length record without any
separators (.F files, for example dump from dBase-III), make sure the file name
is the table name with the extension .F.
EXAMPLE Suppose you want to load a dBASEIII sequential dump into the timcs016000
table (Oracle organization). bdbpost –doracle –Ddbase –x searches for an .F
file in dbase and if that file is found the corresponding table is created or
appended.
In some of these examples the database driver type is retrieved from
$BSE/lib/tabledef6.2. If you want to use a specific database driver for a
particular conversion, you can use the –d option.
The database driver can be of the following types:
n Sybase (sybase)
n Oracle (oracle)
n Informix Online (informix)
n DB2 (db2)
n Microsoft-SQL Server (msql)
Enter the driver name of the database driver between the parentheses. See also
the section “bdbpre.”
The following parameters can be used for bdbpost:
–u/U
Print usage information.
–v/V
Print information about the version of bdbpost.
Technical Manual
3-7
Database tools
–p
Define package combination
<pattern>
Pattern to specify tables that are filtered out of the dump. Wildcards such as *
and ? are allowed.
–c
Company number for the tables to be created.
–C
Range of customer numbers on which to perform the bdbpost operation. This
must be the last option specified in the command, other than the <pattern>
option.
–d
Database driver type, as follows:
O (Oracle) I (Informix) S (Sybase) D (DB2) M (Microsoft SQL-Server)
You can use the -d option to copy data from one instance of a database to
another, for example:
-d “oracle(ORACLE_HOME=/usr/oracle, ORACLE_SID=D1)”
–x
Load ASCII file (.F) with fixed-length records.
–D
The directory name for ASCII files to be loaded.
–e
File to store the names of unsuccessfully created tables.
–k
The existing tables are deleted.
–K
The existing tables are deleted after a backup is made (if DBMS supports this).
–l
Display contents of input.
–I <file>
Redirects input from input file <file>.
–O <file>
Redirects output to output file <file>.
–E <file>
Redirects errors to error file <file>.
Technical Manual
3-8
Database tools
–q <output file>
Redirect terminal output to output file.
–m
Disable domain constraints.
–i
Ignore domain range error and skip record.
–n
Ignore referential integrity constraints.
–A
Append to an existing table. If duplicate records exist, do not overwrite them
from the dump. Print duplicate record summary at the end. Create table if it does
not exist.
–R
Append to an existing table or create a new one. If a record already exists, the
record in the dump replaces it. A summary is given at the end. Note that only the
existence of the primary key is checked. If a primary key exists, the record is
replaced. If the primary key does not exists but a secondary key exists, error 100
(duplicate record) occurs.
–t
Specify the used separator. The –t option is used when loading an ASCII file
from another database.
–f
Fast mode. Tables are created by first inserting all rows and then creating the
indexes (if DBMS supports this). When using the –f option be aware of the
following:
n Interrupting bdbpost results in table inconsistency
n An index cannot be created in case of a duplicate conflict
n For large tables, the adding of indexes can take a long time (> 15 minutes)
EXAMPLES bdbpre –doracle –Nttadv000 –C000-010 > dump
bdbpost –doracle < dump
Creates (appends) all tables in dump
bdbpost –l < dump
Gives you names of tables in dump
bdbpost –C000-005 < dump
Creates/appends tables only in the given customer range
bdbpre –doracle –Nticom000 –C000-010 > dump
Technical Manual
3-9
Database tools
bdbreconfig
NAME
bdbreconfig
Reconfigure database table according to new data dictionary.
SYNOPSIS
bdbreconfig [–uUvVpscinmfTZ][–t dir][–o file][–e file][–d driver type]
[–N table [table [..]] [–I file][–O file][–E file][–S number][–C company
numbers]
Technical Manual
3-10
Database tools
DESCRIPTION
The bdbreconfig tool reads a table name and company numbers as arguments
and converts them into a new table definition that matches a new data dictionary
definition. The bdbreconfig tool requires the following:
n A new data dictionary with a .new extension
n The current data dictionary (for example dtimcs016)
n Tables matching those in the current data dictionary
After successful completion, old tables are deleted and new tables are generated.
The bdbreconfig tool finds the optimum way to reconfigure. If there is no real
change in the old and new data dictionaries, it prints the message “No conversion
required.” It also sees to it that a database remains consistent.
You can perform some reconfigurations by modifying the old data dictionary.
Otherwise the reconfiguration steps are:
1 Compare the current and new data dictionaries.
2 If reconfiguration is required, create a sequential dump
(R.<table name>, for example R.timcs016244) for the specified tables.
3 Delete old tables.
4 From the sequential dump, build new tables that match the new data
dictionary definition.
The following options are available with bdbreconfig:
–U/u
Usage information.
–V/v
Version information.
–p
The name of the used package combination.
–p <pack. comb.>
Define the package combination.
–s
This suppresses error messages and other information.
–C
Company numbers for a given table in these formats:
n Specific company numbers (for example 001 002)
n Range of company numbers (for example 001-010)
Technical Manual
3-11
Database tools
–d
Database driver type, as follows:
O (Oracle) I (Informix) S (Sybase) D (DB2) M (Microsoft SQL-Server)
You can use the -d option to copy data from one instance of a database to
another, for example:
-d “oracle(ORACLE_HOME=/usr/oracle, ORACLE_SID=D1)”
–T
If the domain changes, the table is not reconfigured.
–B
Backup table instead of dropping.
–Z
Reorganize, that is, clean up, the table.
–I
The file with table names.
–i
Ignore errors during reconfiguration, for example, duplicates.
–n
Ignore referential integrity constraints.
–m
Disable domain constraints.
–f
Fast rebuild of table (first rows, then indexes).
–N
List of tables to be reconfigured.
–c
This compares two data dictionaries and checks whether reconfiguration is
required.
–t
The directory name for temporary dump files.
–I
File with table names to reconfigure.
–o
File with successfully reconfigured tables.
–e
File with unsuccessfully reconfigured tables.
Technical Manual
3-12
Database tools
–O file
Redirects output to output file file.
–E file
Redirects errors to error file file.
–S number
number is the maximum size per sequence. number can be specified as any
number or a number followed by K for kilobytes, M for megabytes, and G for
gigabytes. The default size is 2G per dump sequence.
The bdbreconfig tool reconfigures only one table of given company numbers at
a time.
EXAMPLE bdbreconfig –Ntimcs016 –C001
Reconfigures timcs016 for company no. 001.
bdbreconfig –Ntimcs016 –C000-010
Reconfigures timcs016 for a range of company numbers.
If bdbreconfig is used without the –c option, the exit status is either 0 or 1,
depending on successful or unsuccessful completion. If the exit status is 1
(unsuccessful) the file specified at the –o option contains tables that can be
reconfigured, and the file at the –e option contains the tables that cannot be
reconfigured.
If bdbreconfig is used with the –c option, the file specified at the -o option
contains the table names which are found correct, and the file specified at the
-e option contains the table names that must be reconfigured.
CAUTION Make a copy of the dump before executing the following.
In case of interrupted reconfiguration while the R.table file still exists, the
following command uses the dump R.ttadv100222 to rebuild the table.
bdbreconfig –N ttadv100222+
EXAMPLE bdbreconfig –Ntimcs016 –C000-003
Reconfigures timcs016 for some company numbers according to the new data
dictionary, provided that dtimcs/dtimcs016 and dtimcs/dtimcs016.new are
present.
bdbreconfig –dsybase –Ntimcs016 –C000
Reconfigures Sybase table timcs016000.
When the –m or –n option is used, the data in the database can violate the Baan
integrity constraints. Data can violate the Baan domains or it can violate Baan
referential integrity.
Technical Manual
3-13
Database tools
refint
NAME
refint
Check or repair the referential integrity within the database.
SYNOPSIS
refint [–uU][-vV][-b|-B file][-a |-A file][-l |-L file][-c][-n][-r][-s]
[-p package][-I infile][-O outfile][-E errfile][-N table [table [..]]]
[-C compnr [compnr [..]]]
DESCRIPTION
The refint tool checks the integrity of references in the database. You can also
use it to repair the integrity of a corrupted database. Integrity refers to the
accuracy or validity of data.
The environment variable KEY_BUFFER specifies the number of keys stored in
a buffer before updating the database. Default KEY_BUFFER=10000.
You can use the following options:
–u/U
Print usage information.
–v/V
Print version information.
–p
Define package combination.
–C
Specify company numbers.
–b/B
List references before repair (-b output file is ref_before).
–a/A
List references after repair (-a output file is ref_after).
–c
Check validity of references.
–n
Nullify undefined references, all references to the specified tables are checked.
Technical Manual
3-14
Database tools
–r
Repair reference counter, from all specified tables the reference counters are
checked and changed if necessary. Undefined references to the specified tables
are displayed on the screen.
–l/L
File for undefined references. (-l file is ref_undefined).
–I
File containing table names to be checked.
–N <table>
Specify table (format: ttadv100 or ttadv100999).
–s
Handle one single-parent table only.
EXAMPLES refint –Iref_tables –c –n –C100
refint –Ntimcs016 –l
Technical Manual
3-15
Database tools
Technical Manual
3-16
4 Database management
General
Database servers and user interface servers perform processes different from
those performed by the client, the Bshell. They communicate with the Bshell
using a communication protocol. This section discusses the working and usage of
several protocols that can be used for local and remote communication.
Local communication means that server and client are started on the same host
machine. Remote communication means that server and client are on different
machines.
Accessing tables
Tables can be distributed as follows:
n Local: the tables and the Bshell are on one system
n Remote: the Bshell is on one system; all the tables are on another system
n Combination: some tables and the Bshell are on one system; some tables are
on another system
To access a table, the Bshell and database drivers must know the database type
and the location of the table. This information has been stored in the following
files:
n tabledef6.2
n fd6.2.package combination
tabledef6.2
Table references that refer to a database type are stored in the file tabledef6.2.
This file is located in the directory $BSE/lib. To fill this file, use the Tables by
Database (ttaad4111m000) and Database Definitions (ttaad4510m000) sessions
on the BaanERP ToolsÈDatabase ManagementÈDatabase Definitions and
Directories. If the tables are on a different system, you specify the host name of
the remote system instead of entering the database type. The Bshell knows which
database server must be started and in which database the required tables can be
found.
Technical Manual
4-1
Database management
fd6.2.package combination
The file fd6.2.package combination is used to refer the following dictionary
types to a specific directory (path) for a specific package combination:
n Forms
n Menus
n Objects
n Program scripts
n Functions
n Report scripts
The file fd6.2.package combination is located in the directory $BSE/lib. To fill
this file, use the Directories of Software Components (ttadv1115m000) session in
the BaanERP ToolsÈ Application CustomizationÈ Packages and Modules
menu. The specific directory path of the table definitions must be entered in the
Package Combinations (ttaad1520m000) session and is also placed in the
fd6.2.package combination file. You can access this session through the
BaanERP ToolsÈ Application DevelopmentÈ Packages and Modules menu.
Database drivers
When an action is carried out on a table, a database driver (server) is started in
the background for the database type in question.
Technical Manual
4-2
Database management
Audit trail
Audit trail is a method by which actions on a record are logged in several audit
files using an audit server. To work with audit trails, you must place the server
name in the file $BSE/lib/ipc_info. In addition, you must specify in tabledef6.2
that you are using audit trail. To do this, set the Audit Trail field to Y or make
the audit server the mirror server. See the section, “Database mirroring.” When
the client performs an action on a table, the action is logged in an audit file
through the audit server. See also the chapter “Audit management.”
Database mirroring
Tables can be stored in one or more database systems. The file tabledef6.2
contains references to the database where the tables are saved and/or read. For
each reference you can specify one or more database systems where the tables
are positioned. An example is:
tccom:*:oracle&host2.
This reference indicates that all tables of the tccom are in the Oracle database and
on the system host2.
Technical Manual
4-3
Database management
The tables from the previous example are copies. A change applied to a table
from tccom is carried through in the Oracle database on the local system and on
the remote system host2. Also, a change to the tccom tables on the remote system
must be carried through in the database on the local system. This means that
tabledef6.2 on the remote system must contain a reference to the local system.
If the system refers to a remote system, tabledef6.2 on that system is read. This
file contains a reference to both the tables from tccom and to the systems where
copies of the tccom tables are stored.
In case of a read action, if there is a local database for the tables, it is used
without a lock to enhance performance. If no local database has been defined, a
remote database is used.
The principle of database mirroring is outlined in the following figure.
Technical Manual
4-4
Database management
Alternative databases
The file tabledef6.2 contains references to the database where the tables are
saved and/or read. For each reference you can specify an alternative database
driver or host where the table is located.
Assume tabledef6.2 contains the following line:
*:*:host1|oracle
The previous example indicates that a table is searched or stored on host1. If that
operation fails, the table is searched or stored in a local Oracle database. If this
also fails, the table cannot be accessed.
If you are using mirroring databases, you can specify an alternative database
driver or host for each database system.
*:*:oracle&host1|host2
The previous example means that a table must be accessible in a local Oracle
database. Besides that, it is searched or stored on host1. If host1 is not available,
the table is searched or stored on host2.
Communication protocols
Communication between the client and the server includes both local and remote
communication. Local communication means that both the client and the server
are on the same system, which does not apply to remote communication.
Depending on the hardware configuration, you can choose the following
protocols for the communication between the client and the server:
n Sockets (local or remote)
n Pipes
n Message queues
Only the remote socket protocol can be used for remote communication.
For the communication between client and servers, the following files and/or
directories are needed:
n ipc_info (in the $BSE/lib directory)
n A remote user file (ruser name). This file is located in the $BSE/lib/user
directory, and is described in detail in the chapter “Remote databases.”
Technical Manual
4-5
Database management
The semaphore key and message key have not been implemented either.
You can choose from the following protocols:
n Socket (s)
n Message queue (m)
n Pipes (p)
These protocols are described in more detail in the following sections.
The server’s path can include environment variables, for example $BSE, which
must be used as ${BSE}. An example of the ipc_info file is shown in Example
ipc_info File.
Technical Manual
4-6
Database management
Socket protocol
A socket is a UNIX function that enables processes to communicate in both
directions. The socket protocol is subdivided into local and remote sockets. Local
sockets are used for local communication; remote sockets for remote
communication. The client uses a local socket address if it is free at that moment.
Both sockets are described in the following paragraphs.
Local sockets
When a client (Bshell) opens a table, the client reads tabledef6.2. If this file
refers to a certain server, the client reads data about that server from the file
ipc_info. The file ipc_info contains data such as the protocol to be used and the
position of the executable server. Next, the client uses a socket to start the server
and establish communication with the server.
Technical Manual
4-7
Database management
The client uses a remote execute call (rexec()) to start ipc_boot6.2 on host B,
which starts fs6.2. fs6.2 is used to open, read, and write data from a remote $BSE
directory.
The ipc_boot process reads ipc_info to find the directory in which fs6.2 is
located. Then an exec() call is done, so that the ipc_boot6.2 process changes to
fs6.2.
The client searches tabledef6.2 on host B, to determine which driver must be
used to open the desired table, for example, Oracle.
Another remote execute call is done; this time to start the Oracle driver on host
B. Again ipc_boot6.2 is started and reads ipc_info for the path of the Oracle
driver. Now icp_boot6.2 does an exec() call to the Oracle driver.
Communication then proceeds normally between client and Oracle driver.
Pipes protocol
The pipes protocol is analogous to the local socket protocol. In pipes protocol,
the client and server communicate through unnamed pipes streams. A pipe is a
UNIX function that enables processes to communicate in one direction. The
communication between the client and the server takes place through two pipes.
Technical Manual
4-8
Database management
For example, suppose the client wants to send information to the server. This
information or message is put in a message queue, and the semaphore key is
given the value of 1. The semaphore key shows the server that information has
been sent, so that the server can read it. After the server reads it, the semaphore
flag is reset and released, so that the client knows its information has been read.
If the client process is canceled, the client will not put data in the message queue.
However, the semaphore key is decremented using an undo value. The server
reads the message queue and finds no message. Thus, the server knows that the
client process has been terminated and stops its own process.
Technical Manual
4-9
Database management
Technical Manual
4-10
5 Native language support
General
Native Language Support controls the communication between the character set
of a terminal and that of Bshell6.2.
Bshell6.2 has the 8-bit character set of ISO 8859-1. Most terminals and printers
do not support this character set, so Native Language Support techniques are
implemented.
The character set of the terminal is uniform. However, various country-
dependent keyboards can be used with the same terminal. Not all the characters
of the terminal character set can be found on the keyboard. The remaining
characters must be composed. How to compose characters is described in the
section “Composed characters.”
An input conversion table is used to convert the character set of a terminal to that
of the Bshell. In this table a character from the terminal character set is converted
to the corresponding value from the ISO 8859-1. This means that characters from
the Bshell must be converted again to correctly control the terminal or printer.
Both the printer and the terminal need an output conversion table. For a
description of the conversion tables, see the section “Conversion tables.”
To maintain the conversion tables you can use the NLS editor. This editor is
described in the section “NLS editor.”
Composed characters
Characters that are not found on a keyboard must be composed by a unique
combination of two or more existing characters. An example of a list of
composed characters is contained in the section “List of compose sequences.”
Prior to entering the combination, you must press a compose key. The compose
key is defined in the terminal information file of the terminal. For more
information see the section “NLS-related files.”
The compose key can be linked to a special key on the keyboard, for example, a
function key. You can also compose characters by using the Compose character
key, if it is present on the keyboard. This key has the same function as the
compose key.
Technical Manual
5-1
Native language support
The manufacturer of the terminal has defined the composed characters. The user
documentation of the terminal contains a list of these composed characters.
Conversion tables
You need two kinds of conversion to make the character sets of Bshell and the
terminal or printer compatible: input conversion and output conversion.
Technical Manual
5-2
Native language support
Technical Manual
5-3
Native language support
NLS editor
Use the NLS editor to maintain input and output conversion tables. To start the
editor, type nlsedit6.2. To maintain printer output tables, use the –p option
followed by the printer name. To maintain a terminal conversion table, the shell
variable TERM must have the value corresponding to your terminal type.
For an X-terminal to display the characters of ISO 8859-1, you must have the
right font. The section “NLS-related files” contains an example of suitable fonts.
After you have started the editor, the upper part of the ISO character set (160-
255) is displayed. If a character cannot be displayed on your screen, it might be
because it is not found in the character set of the terminal.
You can display feasible options by typing ?. Exit the editor by typing Q.
Technical Manual
5-4
Native language support
The left column, input, contains the compose sequence of the input characters.
This column also contains single input characters not transparent with the ISO
character set.
The second column, int, displays the values of the characters in the ISO character
set.
The third column, s, shows the characters as they are represented after output
conversion.
Technical Manual
5-5
Native language support
The fourth column, #, contains the character set number. Character sets are
defined at the terminal or printer. The possible values are 0-9, and the default is
0.
The last column, output, contains the output sequence of the characters. You can
type the output sequence in decimal, hexadecimal or octal code.
The bottom of the screen shows the display mode in which the values of the
characters are displayed. The last line indicates the marked character. The
numeric representations and description are also included.
Feasible options to maintain conversion tables are:
–D/H/O set decimal/hexadecimal/octal display mode
-N toggle numeric/alpha mode compose sequence
–ARROW DOWN next line
–ARROW UP previous line
–CTRL+N next page
–CTRL+P previous page
–K single key
–C enter compose sequence
–S enter output sequence
–W write nls_in and nls_out file
–+/- increment/decrement character set number
With the options -D, -H, and -O you can change the display mode of the
character values into decimal, hexadecimal, or octal.
The -N option converts alphanumeric characters from the input and output table
to their numeric values, and vice versa.
To move the bar to the following or previous line, use the key ARROW DOWN or
ARROW UP.
Pressing CTRL+N or CTRL+P moves the bar 15 lines forward or backward.
To enter the input sequence of a single key, press -K. The editor asks you to
press the required key. That character is included directly in the table. You do not
need to press ENTER after you have entered the character.
After pressing -C you can enter the compose sequence. You can enter up to 35
characters.
Technical Manual
5-6
Native language support
To type the output sequence, enter -S. You can enter up to 35 characters.
After any modification, you can store the input and output tables by entering -W.
NLS-related files
To work with NLS you must have the following files in your BSE environment:
n Terminal information file$BSE/lib/terminf/...
n Printer information file$BSE/lib/printinf/...
n Input conversion table$BSE/lib/nlsinf/...
n Output conversion table$BSE/lib/nlsinf/...
You must also have the right terminal setup, shell variable TERM, and font. For
some additional features you can use sort tables and shift tables.
Technical Manual
5-7
Native language support
Technical Manual
5-8
Native language support
Terminal setup
The communication mode of the terminal must be 8-bit no parity. The shell
variable TERM must have the name of the terminal information file of the
terminal.
Sort tables
You can use a sort that differs from the default sort method. To do this you can
use a sort table to specify the weight of characters.
The file with the sort table has the default name:
$BSE/lib/nlsinf/sort.tab
You can make your own sort table by filling the environment variable
SORT_TABLE with the name of your own sorting file. A sort table has two
columns. The first one contains the character, the second contains the weight of
that character.
Technical Manual
5-9
Native language support
For example, to sort the B before the A, create a sort table with the following
contents:
\65 \66 or A B
\66 \65 B A
You can use escape and control codes, like \012, \e, ^A. See the section “Input
and output conversion table” for more information.
Shift tables
Shift tables can be used to specify lowercase and uppercase characters that
belong together.
The file with the shift table has the default name:
$BSE/lib/nlsinf/shift.tab
You can make your own shift table by filling the environment variable
SH_TABLE with the name of the file with your own shift table. A shift table has
two columns. The first one contains the uppercase character, the second contains
the lowercase character.
For example, to specify the lowercase and uppercase character c with cedilla,
create a shift table with the following contents:
\199 \231
Technical Manual
5-10
Native language support
Technical Manual
5-11
Native language support
Technical Manual
5-12
Native language support
Technical Manual
5-13
Native language support
12 28 44 60 76 92 108 124
FF FS ‘ < L \ l |
C 1C 2C 3C 4C 5C 6C 7C
13 29 45 61 77 93 109 125
CR GS – = M ] m }
D 1D 2D 3D 4D 5D 6D 7D
14 30 46 62 78 94 110 126
SO RS . > N ^ n –
E 1E 2E 3E 4E 5E 6E 7E
15 31 47 63 79 95 111 127
SI US / ? O _ o DEL
F 1F 2F 3F 4F 5F 6F 7F
Technical Manual
5-14
Native language support
Technical Manual
5-15
Native language support
Technical Manual
5-16
Native language support
Technical Manual
5-17
Native language support
Technical Manual
5-18
Native language support
Technical Manual
5-19
Native language support
Technical Manual
5-20
Native language support
\181 /u
\182 p!
\183 .\^
\184 ,,
\185 1^
\186 o_
\187 >>
\188 14
\189 12
\190 34
\191 ??
\192 A‘
\193 A’
\194 A\^
\195 A~
\196 A"
\197 A*
\198 AE
\199 C,
\200 E‘
\201 E’
\202 E\^
\203 E"
\204 I‘
\205 I’
\206 I\^
\207 I"
Technical Manual
5-21
Native language support
\208 D-
\209 N~
\210 O‘
\211 O’
\212 O\^
\213 O~
\214 O"
\215 xx
\216 O/
\217 U‘
\218 U’
\219 U\^
\220 U"
\221 Y’
\222 TH
\223 ss
\224 a‘
\225 a’
\226 a\^
\227 a~
\228 a"
\229 a*
\230 ae
\231 c,
\232 e‘
\233 e’
\234 e\^
Technical Manual
5-22
Native language support
\235 e"
\236 i‘
\237 i’
\238 i\^
\239 i"
\240 d-
\241 n~
\242 o‘
\243 o’
\244 o\^
\245 o~
\246 o"
\247 :-
\248 o/
\249 u‘
\250 u’
\251 u\^
\252 u"
\253 y’
\254 th
\255 y"
Technical Manual
5-23
Native language support
Output table
\160 \s
\164 \168
\166 |
\168 "
\172 \183
\173 -
\174 \183
\175 \183
\180 \183
\184 \183
\190 \183
\208 D
\215 x
\222 P
\240 \183
\247 /
\253 y
\254 p
\255 \253
Technical Manual
5-24
Native language support
Technical Manual
5-25
Native language support
\185 \s
\186 \250
\187 >>
\188 \247
\189 \248
\190 \s
\191 \185
\192 \161
\193 \224
\194 \162
\195 \225
\196 \216
\197 \208
\198 \211
\199 \180
\200 \163
\201 \220
\202 \164
\203 \165
\204 \230
\205 \229
\206 \166
\207 \167
\208 \227
\209 \182
\210 \232
\211 \231
Technical Manual
5-26
Native language support
\212 \223
\213 \233
\214 \218
\215 x
\216 \210
\217 \173
\218 \237
\219 \174
\220 \219
\221 \89
\222 \240
\223 \222
\224 \200
\225 \196
\226 \192
\227 \226
\228 \204
\229 \212
\230 \215
\231 \181
\232 \201
\233 \197
\234 \193
\235 \205
\236 \217
\237 \213
\238 \209
Technical Manual
5-27
Native language support
\239 \221
\240 \228
\241 \183
\242 \202
\243 \198
\244 \194
\245 \234
\246 \206
\247 /
\248 \214
\249 \203
\250 \199
\251 \195
\252 \207
\253 y\b\168
\254 \241
\255 \239
Technical Manual
5-28
Native language support
Technical Manual
5-29
Native language support
Technical Manual
5-30
6 Information files
Boolean entries
A Boolean entry reflects a feature of the terminal. A Boolean entry is set to true
by including it in the terminal information file. It is set to false either by not
including it or by prefixing it by an exclamation point (!), for example, !vt100.
Here are the available Booleans and what they mean when set to true:
aux_dual
Indicates that output to the aux port also appears on the terminal screen. The
terminal screen is disabled during aux printing.
color_cf
Provides color control in combination with code features.
Technical Manual
6-1
Information files
color_sep
Colors and code features are controlled separately.
mcf
You can move the cursor when the code feature (cf) is active.
mgr
You can move the cursor when the program is in graphics mode.
nclrwc
The terminal does not clear the screen when the width is switched from 80 to 132
columns or vice versa (No CLeaR on Window (width) Change).
vt100
After a character is entered on the last position (80 or 132), the cursor remains on
that position. The following character causes the cursor to jump to the next line.
xhp
Code features and graphic characters are not removed when they are overwritten
by characters in normal mode, but have to be removed explicitly (HP terminals).
Numbers
Numbers are variables that indicate the size of the terminal or particular features.
The following numbers are available:
cf_pos=
Number of positions required to switch a code feature on and off. The default
value is 0. The maximum value depends on the terminal type.
cols=
Number of available columns on the screen. The maximum is 132. If this value is
set to 80 you cannot switch the display to 132 positions.
disp_vt100=
Number of columns the cursor is to move if, in the last column (80th or 132nd),
the terminal receives a backspace (vt100 mode). The default value is 1. The
maximum value depends on the terminal type.
gr_pos=
Number of positions required to switch the graphics mode on and off. The
default value is 0. The maximum value depends on the terminal type.
lines=
Number of lines on screen (variable). The environment variable LINES can
overwrite this value.
Technical Manual
6-2
Information files
tmo=
Timeout sequence after pressing ESC. The given number divided by 10 specifies
the time (in seconds) in which a sequence can be typed in after ESC. If no
character is pressed between this time, the pressing of ESC is handled normally.
The default timeout sequence is 5 (0.5 second).
Strings
String variables are filled with a sequence of characters that can be used to
perform particular terminal operations.
You can use the following special characters to assign string variables:
You can also use an octal value instead of an alphabetical representation. For
example, “escape” becomes \033. The control codes are converted to the ASCII
codes 1 to 31. For example, ^B equals the ASCII character with decimal value 2
(STX).
The following string variables are possible:
aux_off=
Closes the auxiliary port. All data is displayed on the terminal.
aux_on=
Opens the auxiliary port. All data sent to the terminal is passed to the aux port.
bell=
Audible signal (usual value: ^G).
cadr=
Absolute column positioning string. See the section “Parameterized strings”
about the use of a parameterized string.
Technical Manual
6-3
Information files
cbl=
Character used in graphics mode to display the lower left corner (+). If it is not
available, a viable alternative is +. Do not leave the variable empty, because this
can result in screen layout problems.
cbr=
Character used in graphics mode to display the lower right corner (+). If it is not
available, a viable alternative is +. Do not leave the variable empty, because this
can result in screen layout problems.
cf_b=
Code feature, blinking.
cf_br=
Code feature, blinking, and reverse.
cf_bru=
Code feature, blinking, reverse, and underlined.
cf_bu=
Code feature, blinking, and underlined.
cf_B=
Code feature, bold.
cf_Bb=
Code feature, bold, and blinking.
cf_Bbr=
Code feature, bold, blinking, and reverse.
cf_Bbru=
Code feature, bold, blinking, reverse, and underlined.
cf_Bbu=
Code feature, bold, blinking, and underlined.
cf_Br=
Code feature, bold, and reverse.
cf_Bru=
Code feature, bold, reverse, and underlined.
cf_Bu=
Code feature, bold, and underlined.
cf_n=
Code feature, normal.
cf_r=
Code feature, reverse.
Technical Manual
6-4
Information files
cf_ru=
Code feature, reverse, and underlined.
cf_u=
Code feature, underlined.
clear=
Clears the entire display and moves the cursor to the top left corner of the screen.
csr=
Character sequence for changing the scrolling region. The first parameter
indicates the start line. The second parameter indicates the end line of the
scrolling region. See also the section “Parameterized strings.”
ctl=
Character used in graphics mode to display the upper left corner (+). If it is not
available, a viable alternative is +. Do not leave the variable empty, because this
can result in screen layout problems.
ctr=
Character used in graphics mode to display the upper right corner (+). If it is not
available, a viable alternative is +. Do not leave the variable empty, because this
can result in screen layout problems.
cu_off=
Cursor off (invisible).
cu_on=
Cursor on (visible).
cub=
The cursor moves back the specified number of columns. See the section
“Parameterized strings.”
cub1=
The cursor moves back one position.
cud=
The cursor moves down the specified number of rows. See the section
“Parameterized strings.”
cud1=
The cursor moves down one row.
cuf=
Move the cursor forward by the specified number of columns. See the section
“Parameterized strings.”
cuf1=
The cursor moves forward one position.
Technical Manual
6-5
Information files
cup=
Absolute cursor positioning. See the section “Parameterized strings.”
cuu=
The cursor moves up by the specified number of rows. See the section
“Parameterized strings.”
cuu1=
The cursor moves up one row.
delch=
Deletes the character below the cursor.
delli=
Deletes one line.
dt=
Character used in graphics mode to display the lower T-bar. If it is not available,
a viable alternative is +. Do not leave the variable empty, because this can result
in screen layout problems.
el=
Deletes to the end of the row.
es=
Deletes to the end of the screen.
ewin=
Erases the current window.
flash=
Flashes the screen instead of beeping when an error occurs.
gr_off=
Turns graphics mode off.
gr_offB=
Turns bold graphics mode off.
gr_on=
Turns graphics mode on.
gr_onB=
Turns bold graphics mode on.
hb=
Character used in graphics mode to display the horizontal bar. If it is not
available, a viable alternative is –. Do not leave the variable empty, because this
can result in screen layout problems.
Technical Manual
6-6
Information files
home=
Positions the cursor in the upper left corner of the screen.
if=
Name of file containing codes to initialize the terminal. This initialization is done
after the initialization string in init and before the string in init2. Within the file
you can, for example, specify a large number of codes that do not fit in a string
of soft font codes.
inch=
Insert one character, usually a space at the current cursor position.
init=
Initialization string sent to the terminal to set it up for proper use by the Bshell.
This string is sent before any other output.
init2=
Initialization string sent to the terminal to set up. This string is sent during
initialization of the terminal, after the string init and the codes in the file
specified at entry if.
inli=
Insert one line.
kr=
Character used in graphics mode to display the center crossbar (+). If it is not
available, a viable alternative is +. Do not leave the variable empty, because this
can result in screen layout problems.
ladr=
Absolute line positioning string. See the UNIX manual TERMINFO(4) and the
section “Parameterized strings” about defining such a string with one parameter.
lt=
Character used in graphics mode to display the left T-bar. If it is not available, a
viable alternative is +. Do not leave the variable empty, because this can result in
screen layout problems.
nls_in=
Name of NLS input conversion table. See the NLS4.2 user manual.
nls_out=
Name of NLS output conversion table. See the NLS4.2 user manual.
rc=
Restores cursor position and attributes saved with the character sequence
specified with entry sc.
Technical Manual
6-7
Information files
reset=
Reset initialization string. The terminal is set up in such a way that it can be used
in UNIX or other programs. The string is sent after the Bshell terminates
execution.
rt=
Character used in graphics mode to display the right T-bar. If it is not available, a
viable alternative is +. Do not leave the variable empty, because this can result in
screen layout problems.
sc=
Save cursor position and attributes.
set0=, to set9=
Set a character set of the terminal. The default set is set0.
set80=
Set the display width to 80 column.
set132=
Set the display width to 132 columns.
ut=
Character used in graphics mode to display the upper T-bar. If it is not available,
a viable alternative is +. Do not leave the variable empty, because this can result
in screen layout problems.
vb=
Character used in graphics mode to display the vertical bar. If it is not available,
a viable alternative is | (pipeline). Do not leave the variable empty, because this
can result in screen layout problems.
The following dim code features are used in graphics mode if the normal code
features are defective. (Poppy and Wyse terminals):
cblB=. See cbl, but bold.
cbrB=. See cbr, but bold.
ctlB=. See ctl, but bold.
ctrB=. See ctr, but bold.
dtB=. See dt, but bold.
hbB=. See hb, but bold.
krB=. See kr, but bold.
ltB=. See lt, but bold.
rtB=. See rt, but bold.
Technical Manual
6-8
Information files
Keys
This section describes how you can access keys on the keyboard. Use the string
assigned to each entry to specify either the sequence that simulates the key or the
sequence that is generated when the user presses the key.
If you want to use a special key in the Bshell, you have to specify this key in the
terminal information file. If the key is present on the keyboard, you must assign
the corresponding sequence to it. If the key is not present, you can assign another
sequence.
For several key entries, a default value is given along with the ASCII code and
decimal code. For example:
CTRL+J (LF, 10d)
The following keyboard entries are possible:
k1=, to k20=
Specifies the function keys F1 to F20.
k1c=, to k20c=
Specifies the function keys when the CTRL key is held down.
k1s=, to k20s=
Specifies the function keys when the SHIFT key is held down.
k1sc=, to k20sc=
Specifies the function keys when the SHIFT and CTRL keys are held down.
kbs=
Backspace; moves cursor one position back. Default: CTRL+H (BS, 8d).
kbtab=
Specifies the back tab key.
kcompose=
Key compose; used to define a code for NLS character composition.
kcs=
Key column switch. If it cannot display all 132 columns at once, switches
function between the left and right half of the display (usually \eC or \ec).
kd=
Key down; moves cursor one position down. Default: CTRL+J (LF, 10d).
Technical Manual
6-9
Information files
kdc=
Key delete character; removes one character. Default: <Del> (127d).
kdo=
Key do.
kesc=
Key escape.
kf=
Key forward; moves cursor one position to the right. Default: CTRL+L (FF, 12d).
kfind=
Key find.
khlp=
Key help.
khome=
Key home; moves the cursor to the upper left corner of the screen. Default:
CTRL+^ (RS, 31d).
kid=
Key interrupt debugging.
kinshere=
Key insert.
kkill=
Key kill.
kl=
Key left; moves the cursor one position to the left. Default: CTRL+H (BS, 8d)
knscreen=
Key page down.
kpr=
Key print.
kpscreen=
Key page up.
kre=
Key refresh; rewrites screen (usually \eR or \er).
kremove=
Key remove.
kselect=
Key select.
Technical Manual
6-10
Information files
ktab=
Key tab.
ku=
Key up; moves the cursor up one line. Default: CTRL+K (VT, 11d).
pf1=, to pf4=
DEC vt100 “gold” keys. NOTE (only for Baan-C programmers):
Using event functions, your program can catch the keys defined in your terminal
information file. When the program catches a key-press event, it returns a code
for that key. The codes used for the keys are shown in the header file
$BSE/include6.2/bic_key.
For example, a line in the header file is:
#define KEY_F(1) 1024
This indicates that the F1 function key (k1 in a terminal information file) is
identified by code 1024. You can use the macro KEY_F(1) in your program to
check if the defined sequence for the F1 function key is given.
See the section ”Example of terminal information files” for an extensive example
of terminal information files.
Color support
Colors can be sent to the screen separately or in combination with code features,
depending on the capabilities of the terminal. This is set in the terminal
information file with the Boolean values color_cf and color_sep.
color_cf
The code feature can be sent together with the color codes in one single escape
sequence.
color_sep
The color codes cannot be combined with the code features.
Technical Manual
6-11
Information files
bg_yellow=
bg_blue=
bg_magenta=
bg_cyan=
bg_white=,
fg_black=
fg_red=
fg_green=
fg_yellow=
fg_blue=
fg_magenta=
fg_cyan=
fg_white=
You can also assign escape sequences to these entries. For example:
color_sep
bg_black=\e[40m
bg_red=\e[41m
bg_green=\e[42m
bg_yellow=\e[43m
bg_blue=\e[44m
bg_magenta=\e[45m
bg_cyan=\e[46m
bg_white=\e[47m,
fg_black=\e[30m
fg_red=\e[31m
fg_green=\e[32m
fg_yellow=\e[33m
fg_blue=\e[34m
fg_magenta=\e[35m
fg_cyan=\e[36m
Technical Manual
6-12
Information files
fg_white=\e[37m,
Technical Manual
6-13
Information files
Parameterized strings
Some of the string entries described in the section “Terminal information file”
require a number of parameters. For example, to address the cursor, the cup entry
requires two parameters: the row and column to address to. The use of
parameters within a string entry is described in this section.
The parameter mechanism uses a stack and special codes, starting with % to
manipulate the stack.
Technical Manual
6-14
Information files
Code Meaning
%d Take a number from the stack (pop())
%2d Take a number with a minimum of two digits
%3d Take a number with a minimum of three digits
%02d Take a number with exactly two digits
%03d Take a number with exactly three digits
%c Take a character from the stack
%s Take a string from the stack
%P[a-z] Take a variable [a-z] from the stack
%p[1-9] Push a parameter [1-9] onto the stack
%g[a-z] Get a variable [a-z] and push it onto the stack
%{nn} Push a decimal constant nn onto the stack
%+ Take two numbers from the stack and push their sum
%- Take two numbers from the stack and push their subtraction; push(pop() – pop())
%* Take two numbers from the stack and push their multiplication
%/ Take two numbers from the stack and push their division; push(pop() / pop())
%m Take two numbers from the stack and push the modulus of their division;
push(pop() mod pop())
%& Take two numbers from the stack and push the result of their logical AND.
%| Take two numbers from the stack and push the result of their logical OR.
%\^ Take two numbers from the stack and push the result of their logical EXOR.
%= Take two numbers from the stack and compare them. Dependent on the equality,
TRUE or FALSE is pushed onto the stack.
%> Take two numbers from the stack and compare them. If the first number is greater
than the second, TRUE is pushed onto the stack, otherwise FALSE is pushed.
%< Take two numbers from the stack and compare them. If the first number is less
than the second, TRUE is pushed onto the stack, otherwise FALSE is pushed.
%! Take a number from the stack and push its negative value onto the stack.
%\~ Take a number from the stack and push the result of its logical NOT.
%I Add 1 to the first two parameters (for ANSI terminals). Binary operations are in
postfix form with the operands in the usual order. That is, to get x – 5, you must
use %gx%{5}%-
EXAMPLES %i\e[%p1%d;p2%dr
This example is used for changing the scrolling region on C.Itoh terminals. The
first parameter +1 specifies the start row, the second parameter +1 specifies the
end row of the region. Both are used as numerics in the escape sequence.
Technical Manual
6-15
Information files
\e[0;22;%p1%{30}%+%d;%p2%{40}%+%dm
The sequence in this example is used for setting a color and code feature. The
code feature normal is set, the foreground color is set to the first parameter +30,
and the background color is set to the second parameter +40.
Technical Manual
6-16
Information files
#*****************************
# Booleans
#*****************************
vt100
#nclrwc
mcf
mgr,
#*****************************
# Numbers
#*****************************
cols=132
lines=24
cf_pos=0
gr_pos=0
tmo=5
disp_vt100=0,
#*****************************
# Strings
#*****************************
# Setup
#
# init \e[?3l set 80 cols
# \e[0;1m reset attributes and set bold
# \e> set keypad mode to numeric
# \e[1l set cursor key mode to normal
# \e[?25l set cursor mode to visible
# init2 \e(B ASCII –> G0
# (fonts) \e-A Latin-1 –> G1
# ^O (SI) invoke G0 into GL
# gr_on \e(0 Spec.Graph –> G0
# reset \e[0m reset attributes
# \e[H cursor position 0,0
# \e[2J reset entire screen
#
init=\e[?3l\e[0;1m\e>\e[1l\e[?25l
init2=\e(B^O\e-A
reset=\e[0m\e[0;0H\e[2J\e(B^O\e-A,
set80=\e[?3l
set132=\e[?3h,
bell=^G
tmo=20,
csr=%i\e[%p1%d;%p2%dr,
# Line Draw Chars (Char.set: DEC Special Graphic)
#
gr_on=\e(0^O
gr_ond=\e(0^O\e[0m
Technical Manual
6-17
Information files
gr_off=\e(B^O
gr_offd=\e(B^O\e[0m,
cbl=m
cbld=m
cbr=j
cbrd=j
ctl=l
ctld=l
ctr=k
ctrd=k
dt=v
dtd=v
ut=w
utd=w
lt=t
ltd=t
rt=u
rtd=u
kr=n
krd=n
hb=q
hbd=q
vb=x
vbd=x,
# Code Features
#
cf_n=\e[0m
cf_d=\e[0;1m
cf_b=\e[0;5m
cf_db=\e[0;1;5m
cf_r=\e[0;7m
cf_dr=\e[0;1;7m
cf_br=\e[0;5;7m
cf_dbr=\e[0;1;5;7m
cf_u=\e[0;4m
cf_du=\e[0;1;4m
cf_bu=\e[0;4;5m
cf_dbu=\e[0;1;4;5m
cf_ru=\e[0;4;7m
cf_dru=\e[0;1;4;7m
cf_bru=\e[0;4;5;7m
cf_dbru=\e[0;1;4;5;7m,
# Cursor Control & Positioning
#
cu_on=\e[?25h
cu_off=\e[?25l
Technical Manual
6-18
Information files
cup=%i\e[%p1%d;%p2%dH,
cuu=\e[%p1%dA
cuu1=\e[1A
cud=\e[%p1%dB
cud1=\e[1B
cuf=\e[%p1%dC
cuf1=\e[1C
cub=\e[%p1%dD
cub1=\e[1D,
home=\e[0;0H
clear=\e[0;0H\e[2J\e[?25l,
# Editing
#
inch=\e[@
delch=\e[P
inli=\e[L
delli=\e[M
el=\e[0K
es=\e[0J
#ewin=,
# Printer Control
#
aux_on=\e[5i
aux_off=\e[4i,
# Nls
#
nls_in=generic.in,
#********************************************************
# @(#)
# @(#) File : vtansi.fkeys
# @(#)
# @(#) Comment : Include-file for VTxxx terminals function-keys
# @(#) (ANSI-compatible)
# @(#)
#********************************************************
# Available Keys
#*****************************
# Function Keys
#
#k6=\e[17~
#k7=\e[18~
#k8=\e[19~
#k9=\e[20~
#k10=\e[21~
k11=\e[23~
Technical Manual
6-19
Information files
k12=\e[24~
k13=\e[25~
k14=\e[26~
#k15=\e[28~
#k16=\e[29~
#k17=\e[31~
#k18=\e[32~
#k19=\e[33~
#k20=\e[34~,
# VT "Gold Keys"
#
pf1=\eOP
pf2=\eOQ
pf3=\eOR
pf4=\eOS,
# VT Cursor Pad
#
khlp=\e[28~
kdo=\e[29~
kfind=\e[1~
kinshere=\e[2~
kremove=\e[3~
kselect=\e[4~
kpscreen=\e[5~
knscreen=\e[6~
ku=\e[A
kd=\e[B
kf=\e[C
kl=\e[D,
#*****************************
#BA6.2 Special Keys
#*****************************
#Misc. Keys
#
# F6 = kmenu F17 = kprocess
# F7 = kcompose F18 = kkill
# F8 = kre F19 = knextdisp
# F9 = kcs F20 = kprevdisp
# F10 = kswitch
#
kmenu=\e[17~,
kcompose=\e[18~,
kre=\e[19~,
kcs=\e[20~,
kswitch=\e[21~,
kprocess=\e[31~,
Technical Manual
6-20
Information files
kkill=\e[32~,
knextdisp=\e[33~,
kprevdisp=\e[34~,
#*****************************
Technical Manual
6-21
Information files
The escape sequences can contain special characters. They can be divided into
escape codes and control codes.
Technical Manual
6-22
Information files
bin4=
Select fourth paper bin.
hpos=
Set horizontal cursor position of the printer.
initpage=
String sent before each page.
initpr=
Initialization string preceding the output to the printer. This variable must be
filled with the codes for large typeface.
initprog=X
The output of program X (full path name) is sent to the printer.
initpr2=
The second initialization string sent after initprog.
landscape=
Select landscape printing.
large=
Large typeface (10 cpi) control. Some printers require a code to changethe
typeface size.
nls_out=
NLS output table name.
middle=
Medium typeface (12cpi) control. Some printers require a code to change the
typeface size.
You can use the following codes to set the print color:
p_black=
p_red=
p_green=
p_yellow=
p_blue=
p_magenta=
p_cyan=
p_white=,
pbold=
Print boldface characters. A boldface character can print wider than its original.
This does not imply any proportional spacing. Printing graphic characters (with
ASCII code over 127 decimal) yields additional line feeds on most Mannesmann
printers. If this variable is not used, the Bshell simulates boldface printing by
reprinting each line, making use of the carriage return character.
Technical Manual
6-23
Information files
pcbl=
Print +. If this variable cannot be filled because the printer cannot print it, for
example, a + is used.
pcbr=
Print +. If this variable cannot be filled because the printer cannot print it, for
example, a + is used.
pctl=
Print +. If this variable cannot be filled because the printer cannot print it, for
example, a + is used.
pctr=
Print +. If this variable cannot be filled because the printer cannot print it, for
example, a + is used.
pdbl_wide=
Double wide mode on.
pdt=
Print –. If this variable cannot be filled because the printer cannot print it, for
example, a + is used.
pfont1=, to pfont16=
Select font 1 to font 16. These fonts are user definable.
phb=
Print –. If this variable cannot be filled because the printer cannot print it, for
example, a – is used.
pitalic=
Italic mode on.
pkr=
Print +. If this variable cannot be filled because the printer cannot print it, for
example, a + is used.
plt=
Print |. If this variable cannot be filled because the printer cannot print it, for
example, a + is used.
pnlq=
NLQ mode on.
pobold=
Switch off boldface printing without affecting character size.
podbl_wide=
Double wide mode off.
Technical Manual
6-24
Information files
pofont1=, to pofont16=
Deselect font 1 to font 16. These fonts are user definable.
poitalic=
Italic mode off.
ponlq=
NLQ mode off.
porev=
Reverse mode off.
portrait=
Select portrait printing.
posubscript=
Subscript mode off.
posuperscript=
Superscript mode off.
pounder=
Underlined printing off.
prev=
Reverse mode (white on black).
prt=
Print |. If this variable cannot be filled, for example, because the printer cannot
print it, a + is used.
psubscript=
Subscript mode on.
psuperscript=
Superscript mode on.
punder=
Print underlined characters. If this variable cannot be filled, the Bshell simulates
underlining by printing underscore characters on the next line.
put=
Print –. If this variable cannot be filled because the printer cannot print it, for
example, a + is used.
pvb=
Print vertical bar. If this variable cannot be filled because the printer cannot print
it, for example, a | (pipeline) is used.
Technical Manual
6-25
Information files
q1=, to q13=
These 13 variables can be filled with strings that specify whether a character
must be printed in double width, italicized, and so on The variables are user-
definable. These codes have been replaced and they will be removed in a future
release.
resetpr=
Resets the printer. The string is sent to the printer after all output. Fill this
variable with a form feed (\014) followed by the Large typeface codes.
resetprog=X
The output of program X (full path name) is sent after the reset string.
resetpr2=
The second reset string, sent after resetprog.
set0=, to set9=
Set a character set of the printer. The default set is set0.
small=
Small typeface (16.66-17 cpi) control. Some printers require a code to change
typeface size.
usr1=, to usr16=
Define user entry1 to user entry16.
Bar codes
The report writer interfaces with the printer driver using bar-code scripts. A bar-
code script saves the cursor position, prints a bar code with given height and
returns to the saved cursor position. These scripts must be available in the
directory barcode_dir. This directory is relative to $BSE/lib/barcode, so if
barcode_dir = hp_barcode, the bar-code directory is
$BSE/lib/barcode/hp_barcode. Bar-code scripts are prefixed by the word “type”
and post fixed by a two-digit number. For example:
type01.
Technical Manual
6-26
Information files
Technical Manual
6-27
Information files
height=`expr $height – 1`
done
# – last (empty) line of bar code
Push
echo "(- (\c"
Pop
# – select Courier 12cpi.
echo "\033(10U\033(s0p12.00h10.0v0s0b3T\c"
# – move x+25 dots
echo "\033*p+25X\c"
# – print code (text)
echo "$str1 $str2\c"
# – restore cursor position for filter
Pop
exit 0
Technical Manual
6-28
Information files
Technical Manual
6-29
Information files
Technical Manual
6-30
7 User Interface (UI) Page mode
This chapter describes the User Interface (UI) Page mode in BaanERP. The UI
Page mode improves the response times on networks where information
processing can be delayed, for example, a wide area network (WAN).
In normal mode, the 4GL Engine validates the entered data per field. In the UI
Page mode, the 4GL Engine validates data per page, and not per field. The
synchronous interaction between the UI driver and the Bshell is therefore
significantly reduced.
The UI Page mode is designed for experienced BaanERP users, because the
interaction between BaanERP and the user is not as extensive as in the normal
mode.
In the normal mode, an error message is displayed immediately when data
entered in the active field is not correct. In the UI Page mode, an error-logging
window appears, which shows all errors that occurred during the validation of all
the data entered on the page.
In the UI Page mode, the UI driver groups together a number of UI objects that
form a logical unit. A UI object is for example, a field, a button, or a check box.
The logical unit is known as a page. A page can be an overview window or a tab
in a details session with more than one tab.
If the UI Page mode is selected, each UI object automatically belongs to a page.
If the UI object is positioned on a tab, the object is considered part of the page
associated with the related tab. In any other case, the UI object is part of the page
associated with the overview window.
The following functions are implemented in the UI Page mode to improve
network performance:
n The UI handles the movement from an active element to another element
without any communication with the Bshell. An active element is a portion of
the screen that is currently operational or subject to command operations.
Usually the cursor or a highlighted section shows the active element on the
display screen. Active elements are, for example, fields, command buttons,
check boxes, or list boxes.
n The UI client handles the behavior of the default button for the command
buttons on a page.
Technical Manual
7-1
User Interface (UI) Page mode
n Events that result from status changes of UI objects are delayed until a
complete page is filled, or another synchronization event occurs. The delayed
events are sent into a minimum number of network frames.
Tab processing
When the UI page mode is selected, the UI driver processes Tab key movements
in the details window. The Tab key sequence is identical to the creation order of
the UI objects on a page. Other navigation keys, such as Page Up, Page Down,
Home and End are reported to the Bshell with the appropriate keystroke.
Event processing
If the UI Page mode is selected, events are treated differently by the UI driver
than when normal mode is selected. There are four different event categories:
n Suppressed events
n Delayed events
n Synchronization events
n Bypass events
Suppressed events
If the UI Page mode is selected, a UI object does not send suppressed events to
the Bshell . Instead, suppressed events are handled locally by the UI driver on the
client. An example of a suppressed event is moving from an active element to
another active element.
Delayed events
Status changes of UI objects can be delayed. As soon as a synchronization event
occurs, for example, by using the Validate button, the changed UI objects are
requested to synchronize their status with the 4GL engine. The delayed events
are sent in the same order as the Tab key sequence of the UI objects on the page.
This is not necessarily the order in which the user enters data. If possible, the
delayed events are sent into one network frame, to reduce response times.
Technical Manual
7-2
User Interface (UI) Page mode
Synchronization events
The synchronization events make sure that the statuses of the changed UI objects
are sent to the Bshell for validation.
Synchronization events are:
n Selecting a menu item
n Clicking a button on a toolbar, or a pushbutton
n Moving to another tab
n Moving from a synchronizing field to another field
n Starting a browse session
n Pressing a key that is not handled by the UI client
n Resizing a window
n Using the scroll bar
Bypass events
The following bypass events are sent immediately to the Bshell without first
being synchronized with the delayed events:
n Using the online Help
n Closing a Windows application that was started through the application Start
feature of the UI client
n Using OLE objects
Technical Manual
7-3
User Interface (UI) Page mode
Technical Manual
7-4
User Interface (UI) Page mode
You can carry out one of the following procedures to mark a field as a
synchronizing field:
Static Forms
1 In the ASCII editor, click the field to start the Form Fields (ttadv3501s000)
session.
2 On the General tab, select the Synchronized check box.
3 Click Close to return to the Form Editor.
4 On the Specific menu, click Check In to finish the procedure.
Dynamic Forms
1 In the graphical Dynamic Form Editor, click the field to start the Field
Properties session.
2 On the Miscellaneous tab, select the Synchronized check box.
3 Click OK to return to the graphical Dynamic Form Editor.
4 On the Specific menu, click Check In to finish the procedure.
Technical Manual
7-5
User Interface (UI) Page mode
Technical Manual
7-6
8 Customer support tools
General
This chapter describes two aspects essential to solving errors in a Bshell
environment: error logging and the bserel6.2 program. Error logging is keeping a
record of error messages in a log file. The log file contains information about
when the error occurred and which processes were then active. See the section
“Error logging.”
The program bserel6.2 provides information on the BSE environment as installed
on your system. Among other things, bserel6.2 checks permissions, the
availability of programs, and the correctness of program objects. This data can be
collected in a report and viewed on screen, printed, or sent to a file.
If you want to submit an error to the Customer Support Center of Baan Info
Systems, add both the error logging report and the bselrel6.2 report to your error
report.
Error logging
Certain actions in a Bshell program can result in an error. Usually an error is
displayed and from it you can see what went wrong.
To localize Bshell errors, a status report of the program is written to a log file.
Use this file to find out where and when the error occurred.
Log file
The log files the errors are written to are stored in directory $BSE/log. Its name
format is:
log.<program name>
This means that when an error occurs in Bshell6.2, it is logged in the file
log.Bshell6.2. If it occurs in bx6.2, it is logged in log.bx6.2, and so on.
Technical Manual
8-1
Customer support tools
Technical Manual
8-2
Customer support tools
The Screen dump block contains the screen active at the moment the error
occurred. The last block, Process Information, contains the individual process
information about each process from the list. It can consist of:
n The line from the process list for the process involved
n Session code, process ID, and parent number
n Object
n Main table
n Zoom field
n Return zoom field
n Default printer
n Forms
n Reports
n Tables
n Variables, including values in force when the error occurred (empty strings,
strings with value 0, and strings consisting of tabs are not logged). The
section “Example error logging” contains an example of error logging
Technical Manual
8-3
Customer support tools
Technical Manual
8-4
9 Executable programs
Database management
This chapter describes the executable programs used for database management,
which are located in the directory $BSE/bin. Whether you have all the executable
programs described in this chapter depends on your particular installation set.
The programs are sorted by type of database server. References are included for
programs described in other documents.
General
audit_srv6.2
This is the name of the server that handles logging of actions on the database.
See the chapter “Audit management.”
bdbpre6.2
Program to convert database tables to a sequential dump. See the chapter
“Database tools.”
bdbpost6.2
Program to create database tables from a sequential dump. See the chapter
“Database tools.”
bdbreconfig6.2
Program to reconfigure database tables. See the chapter “Database tools.”
dpt6.2
Test program of database actions. Program for internal use, not for the end user.
refint6.2
Function to check the referential integrity of database tables. See the chapter
“Database tools.”
gcommand6.2
Database test program used internally to solve problems. Not intended for the
end user.
qptool6.2
Database test program used internally to solve problems. Not intended for the
end user.
Technical Manual
9-1
Executable programs
Oracle
ora7_inst6.2
The program used to install the Oracle driver.
ora7_deinst6.2
The program used to deinstall the Oracle driver.
ora7_srv6.2
This is the driver for Oracle Version 7.
ora7_maint6.2
The Oracle version of the program used to maintain the database.
ora8_srv6.2
This is the driver for Oracle Version 8.
ora8_maint6.2
The program used to maintain Oracle version 8.
Sybase
syb_install6.2
The program used to install the Sybase driver.
syb_srv6.2
This is the Sybase driver itself.
syb_admin6.2
The shell script for doing administration.
syb_maint6.2
The Sybase version of the program used to maintain the database.
Informix
inf_install6.2
The program used to install the Informix driver.
inf_srv6.2
This is the Informix driver itself.
inf_admin6.2
The shell script for doing administration.
inf_maint6.2
The Informix version of the program used to maintain the database.
Technical Manual
9-2
Executable programs
DB2
db2_install6.2
The program used to install the DB2 driver.
db2v5_srv6.2
This is the driver executable program that functions with DB2 V5.
db2_admin6.2
The shell script for doing administration with DB2.
db2v5_maint6.2
This is the maintenance executable program, to be used with the DBA module,
which works with DB2 V5.
Technical Manual
9-3
Executable programs
SYNOPSIS
Bshell6.2 [options] [program [program arguments]]
Options for Bshell6.2 are described in the following sections:
n Debugging the Bshell during run time
− Baan CPU
− Scheduler
− File I/O
− Miscellaneous
− Message and log extract
n Memory usage
n Miscellaneous
The al_1 function parse_arguments recognizes the following options by default:
-- : end of parameter list
-set var=val : set environment variable var to val
To pass options to the Bshell, enter them in the command line of the BW
Configurator, for example:
-- –set CORE=1 –dbgcpu –dbgfun ttaad2100m000
− pass "-set CORE=1 –dbgcpu –dbgfun" options to Bshell
− and run Appication Configuration (ttaad2100m000) session
Bshell logs all its output to $BSE_TMP/bshell.PID. This log file is removed
when the Bshell exits normally. You can instruct the Bshell to keep the logfile
with the –keeplog option.
Baan CPU
Debug functions
In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug
Levels tab, select Debug Functions. Or, from the command line, run –dbgfun.
Use debug version of the CPU
In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug
Levels tab, select Debug CPU. Or, from the command line, run –dbgcpu.
Technical Manual
9-4
Executable programs
Technical Manual
9-5
Executable programs
Miscellaneous
Show object information
In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug
Levels tab, select Show object information. Or, from the command line, run –
dbgobj.
Show whether domains, data definitions and objects are loaded from disk or
shared memory
In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug
Levels tab, select Show SRDD use. Or, from the command line, run –
dbgsrdduse.
Show various TSS debugging information
In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug
Levels tab, select Debug TSS. Or, from the command line, run –dbgtss.
Show data input options (not for fields)
In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug
Levels tab, select Debug data.input(). Or, from the command line, run –
dbgdata.
Stop debugger, if possible, when a message is sent to the message window
In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug
Levels tab, select Debug Messages. Or, from the command line, run –dbgmesg.
Show loaded resources
In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug
Levels tab, select Debug Resources. Or, from the command line, run –dbgres.
Do not remove the logfile after ending the Bshell
In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug
Levels tab, select Keep Log File. Or, from the command line, run –keeplog.
Add time stamps to Bshell log output
In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug
Levels tab, select Add Time Stamps. Or, from the command line, run –logtime.
Database related
Show the Baan database activities initiated from the Bshell
In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug
Levels tab, select Show BDB Actions. Or, from the command line, run –
dbgbdbact.
Show actions related to enums
In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug
Levels tab, select Print Enums. Or, from the command line, run –dbgenums.
Technical Manual
9-6
Executable programs
BDB/SQL Tracing
To trace BaanERP database and SQL actions, display the Option Dialog box and
click Debug Bshell. The Runtime debugging of Bshell dialog box appears. You
can also choose these options from the command line.
BDB Debug Flags
Shows the drivers and parameters currently in use
In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL
Tracing tab, select Driver Type. Or, from the command line, run
BDB_DEBUG=01.
Show database actions such as Insert, Update, Delete, Commit, and Abort
In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL
Tracing tab, select Database Actions. Or, from the command line, run
BDB_DEBUG=02.
Show information on currently set locks
In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL
Tracing tab, select Delayed Locks. Or, from the command line, run
BDB_DEBUG=04.
Show references between tables
In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL
Tracing tab, select References. Or, from the command line, run
BDB_DEBUG=010.
Show all tables using native storage format
In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL
Tracing tab, select Multibyte Storage. Or, from the command line, run
BDB_DEBUG=040.
Show the permissions and roles allowed for each user
In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL
Tracing tab, select Permissions/Roles. Or, from the command line, run
BDB_DEBUG=0100.
Technical Manual
9-7
Executable programs
BDB_DEBUG Value
Shows the current setting that can be used in a –set BDB_DEBUG=<value>
from the command line.
TT SQL TRACE Flags
Show the full text of a query with an ID number
In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL
Tracing tab, select Show query with ID. Or, from the command line, run
TT_SQL_TRACE=040.
Show how long a query has been running
In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL
Tracing tab, select Query execution times. Or, from the command line, run
TT_SQL_TRACE=0200.
Show main SQL functions such as SQLExec, SQLParse, SQLFetch, and
SQLBind
In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL
Tracing tab, select Internal SQL functions. Or, from the command line, run
TT_SQL_TRACE=02000.
Show the best possible design for indexing, joins, and so on
In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL
Tracing tab, select Query evaluation plan. Or, from the command line, run
TT_SQL_TRACE=04000.
Show all full table scans
In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL
Tracing tab, select Show full table scans. Or, from the command line, run
TT_SQL_TRACE=020000.
Show low-level communication between client and driver
In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL
Tracing tab, select Show BDB communication. Or, from the command line, run
TT_SQL_TRACE=040000.
Show current time to level of milliseconds: YYYYMMDDhhmmss.mmm
In the Option Dialog dialog box, choose Debug Bshell. On the BDB/SQL
Tracing tab, select Add time stamps (SQL). Or, from the command line, run
TT_SQL_TRACE=0400000.
TT_SQL_TRACE value
Shows the current setting that can be used in a –set TT_SQL_TRACE=<value>
from the command line.
Technical Manual
9-8
Executable programs
Memory usage
Show currently running processes in Bshell
In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug
Levels tab, select Dump Process List. This option is not available from the
command line.
Show total memory usage
In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug
Levels tab, select Total Memory. Or, from the command line, run -dbgmemtot.
Show free memory list
In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug
Levels tab, select Free Memory. Or, from the command line, run –
dbgmemfree.
Show used memory list
In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug
Levels tab, select Memory Used. Or, from the command line, run –
dbgmemused.
Show memory usage per block
In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug
Levels tab, select Memory Block List. Or, from the command line, run –
dbgmemblk.
Show all memory statistics
In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug
Levels tab, select All Memory Info. Or, from the command line, run –dbgmem.
Add remark to log file (enter the remark in the field, then click the button)
In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug
Levels tab, select Write Remark to Log. This option is not available from the
command line.
Display shared-memory information
In the Option Dialog dialog box, choose Debug Bshell. On the Bshell Debug
Levels tab, select Display Shared Mem. This option is not available from the
command line.
Technical Manual
9-9
Executable programs
Miscellaneous
–vV : version information.
–r : show resources
–deftext : show Bshell tex.ts.
–mdebug : display Bshell messages sent to display server.
–dbgref : show reference paths.
–dbgrefer : show references.
–dbgbdbact : show database actions.
–dbgenums : show loading of enums.
–dbgpty : debug pseudo terminals (pty).
–dbgorb : debug ORB integration (where available) .
–set var=val : set environment variable var to val.
–logfile <file> : log stdout/stderr output in file.
–appendlog : append to logfile (only useful with –logfile option).
–nolog : stdout and stderr go to the controlling terminal.
–delay sec : delay for sec seconds before continuing.
bshcmd6.2
This command can be used to change the log facilities of the Logic Server
(Bshell) or kill one or more Bshell processes. The actions done with this
command are performed while the Bshell is runing.
SYNOPSIS
bshcmd6.2 [options] <bshell_pid>
Possible options:
–v : print version information.
–p : show process list.
–m : show memory usage.
–d <dbglvl> : set DEBUG_LEVEL to (octal) <dbglvl>.
Technical Manual
9-10
Executable programs
0000100000 : show whether domains, data definitions and objects are loaded
from disk or shared memory.
0000200000 : debug get.var & put.var functions.
Technical Manual
9-11
Executable programs
–W sec : Wait until the previously issued command is executed. After this the
previous command is overwritten.
–w sec : Wait sec seconds for Bshell to execute command.
–u sec : Send SIGUSR1 to Bshell (wakeup). Only to be used in combination with
–w option. Waits sec seconds to see if the command is executed.
–s : Show entire contents of log file (if accessible).
Only to be used in combination with –p and –w option.
-l : Print log file name of Bshell.
Only to be used in combination with –p and –w option.
-T cmdstr : Modify BDB_DEBUG or TT_SQL_TRACE (Bshell) and
DBSLOG, TT_SGL_TRACE, {DBMS}STAT (drivers) tracing variables. cmdstr
can contain multiple commands of the form:
trace variable=value: set variable to value
trace variable+value: add bits to variable
trace variable-value: remove bits from variable
REMARKS All output is stored in the Bshell's log file (default: $BSE_TMP/bshell.pid).
Only one command can be active at a time. New commands overwrite previous
ones.
Check the return value to see if a command has been processed.
The bshell_pid process number is a member of the output of the UNIX ps
command.
EXAMPLES bshcmd6.2 –s –p –w 10 <bshell_pid>
Show the process list, and wait 10 seconds for response. When no actions are
done within 10 seconds, no output is given.
bshcmd6.2 –d 02000 <bshell_pid>
Set DEBUG_LEVEL to 02000.
bshcmd6.2 –M "Hello" –u 10 –w 10 <bshell_pid>
Send a message to a specific Bshell.
bshcmd6.2 –k <pid> <bshell_pid>
Kill the Bshell process <pid>. The <pid> process number can be accessed from
the shell program (ttstpshell) with the ps command.
bshcmd6.2 –T “TT_SQL_TRACE+02000” <bshell_pid>
Set TT_SQL_TRACE to log interface calls.
Technical Manual
9-12
Executable programs
badmin6.2
Used to perform administration of the Bshell. The usage is as follows: badmin6.2
[-UuVv] [-qo outfile] [-qe errfile] –chkuser <user> | –chkgroup –ostype
Available options are:
–U or –u : print usage.
–V or –v : print release number.
–qo outfile : redirect standard output to file outfile.
–qe errfile : redirect error output to file errfile.
–chkuser user : returns a 0 if user exists, otherwise returns a 1.
–chkgroup group : returns a 0 if group exists, otherwise returns a 1.
–ostype ostype : returns 0 if operating system is ostype, otherwise returns a 1.
ostype can be either NT or UNIX.
Installation
cmt6.2
Script for component merge tool. Used to migrate the sources from user-
customized applications to new BaanERP versions.
install6.2
Script for installing the BaanERP software.
install.help
ASCII file containing Help for the installation procedure.
sh_server6.2
Shell server used to execute system-dependent commands.
bsp.setperm6.2
Script used to assign the correct permissions to all the BaanERP software.
binperm6.2.
Script used to assign the correct permissions to binaries in the $BSE/bin
directory after a new porting system is set up.
Technical Manual
9-13
Executable programs
Development
bic6.2
Program compiler for Baan C compiler.
repgen6.2
Report generator.
std_gen6.2
4GL-program preprocessor.
bic_cstub6.2
Converts a BaanERP library to a C library.
bic_info6.2
Shows information for specified object.
bic_jstub6.2
Generates a Java class from a BaanERP DLL object.
License management
brand6.2
Program to authorize an environment. You must be logged in as the root user to
run this program.
hostid6.2
Program to print the host identification number.
Available options:
–vV : version information.
–o : print this number in an octal format.
–h : print this number in a hexadecimal format.
licd6.2
Daemon process to watch over the license. Because sockets are used, the
Ethernet software must be installed before you can use the license daemon.
The file $BSE/lib/licence6.2 must contain the name of the host on which the
license daemon is running, as follows:
n host name (must be present in /etc/hosts)
n internet address (x.x.x.x)
Note that brand6.2 expects to find the host name in licence6.2.
Technical Manual
9-14
Executable programs
Available options:
–vV : version information.
–d : debug.
–f : keep licd6.2 running in foreground. This is useful with the –d option.
licmon6.2
Monitor to retrieve information from the license daemon. The options that can be
used when starting the monitor are:
–vV : version information.
–b : show brand information.
–B : show brand information from brand file and shared memory.
–C : clear brand information from shared memory. Use this option when shared
memory is incorrect.
–w : show users.
–W : show other connections.
–k : kill license daemon.
–u : show user count.
–s : show statistics.
–d : print debug information.
–h host : retrieve information from the given host.
–p n : ping the license server n times (test connection).
The commands that can be entered within the license monitor are:
brand information: show the brand information of this host.
help : show the available commands.
ping [n] : ping the license server [n times] (test connection).
quit : quit license monitor.
stats : show server statistics.
users : show user count who [all]: list users [all: list other logons].
Technical Manual
9-15
Executable programs
Resources:
licence_timeout : specifies the number of seconds the license daemon waits for a
reply from another license daemon, or the number of seconds a Bshell waits for a
reply from the license daemon. The default is 30 seconds. Do not lower this
value. With wide area networks (WAN) it is advisable to set this value to 60.
You can change or set the licence_timeout setting in the resource file.
Printer management
filter6.2
Program to translate BaanERP native codes to printer codes used by the
pdaemon6.2 program.
lp6.2
System spooler interface for the pdaemon6.2 program.
pdaemon6.2
Daemon process to print requests from the environment. This program must be
started by the user root.
The options that can be used at calling the printer daemon are:
–v : print version and porting information of the daemon.
–k : kill the running printer daemon.
–f : Start daemon as foreground process (for debugging).
–d n: Print debugging information to stderr. The higher n is, the more
information is output.
–r : Remove the lock file and start daemon (use this in rc.start).
–h : print the above options.
Resources:
maxproc: maximum number of background (filter) jobs. Default: 20.
maxtries: maximum number of minutes to retry opening the database files.
Default: 30 minutes.
sleeptime: sleep time between two polls. Default: 10 seconds.
shell_cmd: shell which runs the lp6.2 system interface. Default: /bin/sh.
strict: The interval in seconds the printer daemon command (up/down) is
checked for all devices. If this resource is not set, the printer daemon command
of the device in question is checked as soon as a print job is found.
Technical Manual
9-16
Executable programs
Shared memory
shmmanager6.2
Manager program for shared memory. See the chapter “Shared memory
management.”
shmtimer6.2
Daemon process that stores and updates the current time in shared memory. See
the chapter “Shared memory management.”
shmvalues6.2
Program to generate entries for the "shm_param" file. See the chapter “Shared
memory management.”
srdd_init6.2
Program to load the data dictionary for the Bshell from shared memory.
Network
client6.2
Test program of the client part.
fs6.2
Program to handle remote file I/O. With this program you can approach files on
another system. On the other system you must put the program fs6.2 in the
ipc_info file. See the chapter “Database management.”
ipc_boot6.2
Program to start remote processes. See the chapter “Database management.”
server6.2
Test program of the server part.
Technical Manual
9-17
Executable programs
Technical Manual
9-18
Executable programs
Technical Manual
9-19
Executable programs
Middleware
orb_srv6.2
Implementation program that supports the server portion of object request broker
(ORB) communication.
bshellorb6.2
Variation of the Bshell used to integrate BaanERP with CORBA programs.
UNIX equivalents
compress6.2
Program to compress data. Equivalent to the UNIX compress command.
diff6.2
Program used to compare two files. Equivalent to the UNIX diff command.
kermit6.2
Serial communications program. Equivalent of the UNIX kermit command.
sort6.2
Sort program. Equivalent of the UNIX sort command. You can use the
environment variable BSE_SORT to specify a path where temporary files are
stored during the sort process.
Technical Manual
9-20
Executable programs
Miscellaneous
binput6.2
Program to read input. This can be used in shell scripts.
bput6.2
Program to set or print terminal settings.
encrypt6.2
Program to encrypt passwords, which is used to fill the r<user> file. See the
chapter “Database management.”
mirror6.2
Program for demonstrations and courses.
nlsedit6.2
Editor to maintain input and output conversion tables for Native Language
Support. See the chapter “Native language support.”
popup6.2
Program to handle popup screens. This can be used in shell scripts.
sum6.2
Sum program, used to calculate and patch executable programs.
Technical Manual
9-21
Executable programs
Technical Manual
9-22
10 Errors
General
There are three categories of errors:
n Error numbers 1-99 are generated by UNIX or XENIX
n Error numbers 100-899 are database errors
n Error numbers 900-999 are network errors
Error numbers between 34 and 100 are system dependent.
UNIX errors
1 EPERM Not owner
This error indicates an attempt to modify a file that cannot be modified, except
by its owner or super user. This error also appears when ordinary users attempt to
do things allowed only to the super user.
2 ENOENT No such file or directory
This error occurs when a specified file name should exist but does not, or when
one of the directories in a path name does not exist.
3 ESRCH No such process
This error means that no process can be found that corresponds to the one
specified.
4 EINTR Interrupted system call
This error means that an asynchronous signal (such as interrupt or quit), which
the user has chosen to catch, occurred during a system call. If the system resumes
execution after processing the signal, it will appear as if the interrupted system
call returned this error code.
5 EIO I/O error
This error means that there has been some physical I/O error. In some cases, this
error can point to the call following the one to which it actually applies.
6 ENXIO No such device or address
This error means that I/O on a special file refers to a subdevice that either does
not exist, or is beyond the limits of the device. It may also occur when, for
example, a tape drive is not online or no disk pack is loaded on a drive.
Technical Manual
10-1
Errors
Technical Manual
10-2
Errors
Technical Manual
10-3
Errors
Database errors
100 EDUPL
This error means that a duplicate value exists.
101 ENOTOPEN
This error means that the table is not open.
102 EBADARG
This error means that an illegal argument has been specified.
103 EBADKEY
This error means that an illegal key description has been specified. Use the
bdbpre and bdbpost tools.
Technical Manual
10-4
Errors
106 ENOTEXCL
This error means that the table is not exclusively locked action. You can either
wait until the lock on table is released or you can remove the lock yourself.
107 ELOCKED
This error means that the record you are trying to retrieve is locked. You can
either wait until the lock is released or remove the lock yourself.
108 EKEXISTS
This error means that the key already exists.
109 EPRIMKEY
This error means that you are trying to perform an illegal action on a primary
key. Refer to the log file for more information.
110 EENDFILE
This error means that the end of the file has been reached.
111 ENOREC
This error means that no record was found that matches the query criteria.
112 ENOCURR
This error means that there is no current record.
113 EFLOCKED
This error means that the table is locked. You can either wait until the lock is
released or you can remove the lock.
114 EFNAME File name too long
This error means that you are using a file name that is too long. Refer to your
system requirements to check the maximum length for a file name.
116 EBADMEM
This error means that the system cannot allocate memory because it is out of
memory. Try restarting the Bshell as a possible solution.
117 EBADCOLL
This error means that there is a problem with the collating, or sorting order.
123 ENOSHMEM
This error means that no shared memory is initialized. You can use for example
the rc.start script to initialize shared memory.
129 EUSER
This error means that too many sessions have been started.
136 ENOSPACE
This error means that there is no space in shared memory. You can either
initialize the shared memory, or change the shared memory parameters.
Technical Manual
10-5
Errors
140 ETRANSON
This error means that this operation is invalid when the transaction is on.
141 ETRANSOFF
This error means that this operation is invalid when the transaction is off.
142 EADMON
This error means that some administration process is running.
146 ENOSNAPSHOT
This error means that the system cannot take a snapshot of the database, probably
because it is locked by another user. You can either wait until the lock is released
or you can remove the lock.
148 EOFRANGE
This error means that there has been an error in the data type range check.
201 EROWCHANGED
This error means that the record was changed after a delayed lock.
202 EDBLOCKED
This error means that the database is locked. You can either wait until the lock is
released or you can remove the lock yourself.
203 ETRANSACTIONON
This error means that this action is not allowed within a transaction.
204 EISREADONLY
This error means that this transaction is read only.
205 ENOTINRANGE
This error means that the field value is out of range and does not agree with the
domain definition.
206 ENOTLOCKED
This error means that the record is not locked.
207 EAUDIT
This error means that there is an error of the audit trailer.
208 EPERMISSION
This error means that the action you have just attempted is not allowed at this
time.
209 EMIRROR
This error means that there is an error in the mirroring of the database. The tables
are inconsistent. You can use bdbpre and bdbpost to copy the tables correctly.
Technical Manual
10-6
Errors
210 EMLOCKED
This error means either that the record is locked in the mirrored database, or that
the tables are inconsistent, or that the mirroring definition in tabledef6.2 is not
compatible.
213 ETRANSACTIONOPEN
This error means that the transaction is started, but not updated. This is an
internal Bshell error.
214 EUNALLOWEDCOMPNR
This error means that an operation for mapping company numbers is not allowed.
If the logical company is not equal to the physical company, you are not allowed
to do a drop/clear table operation.
215 EDBDILLEGAL
This error indicates an illegal state that should never occur.
251 EAUDSETUP
This error means that the audit server setup is not correct. See the log.audit file
for more information.
252 EAUDCORRUPT
This error means that an audit file is corrupt. See the log.audit file for more
information.
253 EAUDLOCKED
This error means that the audit file is locked by another user. See the log.audit
file for more information.
254 EAUDABORT
This error means that a commit transaction has failed in the audit server action
See the log.audit file for more information.
301 ESQLQUERY
This is a general SQL error code. This error occurs when there is a problem with
the SQL syntax.
302 ESQLSYNTAX
This error means that the SQL syntax is not correct.
303 ESQLREFER
This error means that a reference in the query cannot be found.
304 ESQLUNDEFINED
This error occurs when something went wrong but no error code can be set.
Technical Manual
10-7
Errors
305 ESQLWRONGROW
This error means that a wrong record was returned. This probably means either
that the table index is corrupt or that the RDBMS has a different sorting order
than the BaanERP software.
501 EMEMORY
This is an internal memory error.
502 EBDBON
This error means that the user is already logged on.
503 EBADADRS
This error means that an illegal address has been used.
504 EBADFLD
This error means that a column is undefined.
505 ENOSERVER
This error means either that no server is specified in tabledef6.1, or that the
server cannot be started. See the log file for more information.
506 ENOTABLE
This error means that the table does not exist.
507 ETABLEEXIST
This error means that the table you are trying to create already exists.
508 EBDBNOTON
This error means that you are not logged on to a database.
509 EBADCURSOR
This error means that you have a bad memory cursor or that a bad table pointer
has been specified.
510 EDBNOTON
This error means that the database is not on. Start the database to correct the
problem.
511 EWRONGVERSION
This error means that the version of client is not the same as the version of the
server.
512 EDDCORRUPT
This error means that the data dictionary is corrupt. Use bdbpre and bdbpost
tools to repair it.
513 ENODD
This error means that the data dictionary was not found.
Technical Manual
10-8
Errors
Technical Manual
10-9
Errors
605 EREFEXISTS
This error means that the record cannot be deleted while the reference exists. See
the log file for more information.
606 EREFNOTEXISTS
This error means that the reference does not exist.
607 ENOREFTBL
This error means that the reference table was not found. The data dictionary
might not be correct. See the log file for more information.
608 ENOREFCNT
This error means that no reference counter fields are present.
609 EUPDREFCNT
This error can occur when the reference counter is updated.
700 ESETLOCALE
This error can occur when you are setting the locale. See the log file for more
information.
If an error code greater than 1000 is displayed, the error can be retrieved as
follows, depending on the database driver used:
Informix/Oracle: error – 1000 gives DB error
Example UNIX
Error no: 11400
Error: 11400 – 1000 = 10400
UNIX error = 0 (last two digits)
Example Oracle:
Error no: 1979
Error: 1979 – 1000 = 979 Not a GROUP BY
NOTE When a fatal error occurs, more information is stored in the log files in the
directory $BSE/log. For example, if bdbpost causes an error, it is reported in the
file log.bdbpost.
Technical Manual
10-10
11 Shared memory management
General
Shared memory is a part of the internal memory intended for common usage. All
users can read from and write to it. In BaanERP Tools the shared memory
contains part of the data dictionary.
A prerequisite for shared memory is that it must be supported by the hardware
and there must be sufficient internal memory available.
This chapter describes the way shared memory can be used for BaanERP Tools.
Technical Manual
11-1
Shared memory management
–r: resetting of shared memory. Removes all data from shared memory except
the first segment. You do not have to reinstall shared memory afterwards. The
result of this option is the same as when using –k option followed by –i option.
You can only use this option if all processes that use shared memory have
finished. If not, the system displays a message:
# of attaches = <number>
Cannot remove ..# of attaches not equal to zero
The –a, –i and –v options are discussed in the section “Installation of shared
memory.”
Technical Manual
11-2
Shared memory management
Using shmvalues6.2
The program shmvalues6.2 finds the boundaries of shared memory by itself and
generates a default entry, which you can include in the shm_param parameter
file. For example:
default:;
{
}
Machine_id:;
{
}
Machine_id/OS release:;
{
SHM_START = a40000
SHM_STEP = 80000
SHM_BUFSIZE = 512
SHM_MAXMEM = 10
}
SHM_START is the start address of the first shared-memory segment.
SHM_STEP is the difference between the start addresses of two consecutive
segments.
SHM_BUFSIZE is the size of a segment in KB.
SHM_MAXMEM is the maximum number of segments.
The syntax for shmvalues6.2 is:
shmvalues6.2 [-dvV] [-m Seg_size_in_MB] [-s Seg_size_in_KB]
Possible options are as follows:
–d : the –d option provides you with additional information through error
messages when the boundaries of the operating system are exceeded.
–m : the program shmvalues6.2 first tries to allocate 4 MB of memory to make
sure enough memory is left after shared memory has been installed. You can use
the –m option to increase or decrease the amount of allocated memory. You
specify it in megabytes, that is, –m 3 = 3 MB.
Technical Manual
11-3
Shared memory management
FATAL ERRORS Can’t allocate <size> MB of memory: <system error message>; Please try tuning the
kernel or lower the value
Couldn’t create any ID of any size: <system error message>
Error while removing shmid <shmid>: <system error message>
Failed to attach any segment: <system error message>
Error while detaching shmid <shmid>: <system error message>
The shmvalues6.2 program returns a positive value in the event of a fatal error.
Using shmmanager6.2
If you cannot determine the shared-memory parameters by using shmvalues6.2,
you can use the shared memory manager. This takes longer, but it yields more
information on the addresses of the segments and on the instances where errors
can occur.
Execute the shmmanager6.2 with the –a option.
You are prompted for the number of kilobytes to be allocated and the number of
segments to be created. For the Bshell, specify 4096 KB and 10 segments,
respectively.
Technical Manual
11-4
Shared memory management
For example:
# shmmanager6.2 –a
No. of kbytes to be malloc: 4096
No. of shm segments to be created: 10
addr[0]: 0xa40000 id[0]: 40 < SHM_START = a40000
addr[1]: 0xac0000 id[1]: 41
addr[2]: 0xb40000 id[2]: 42
addr[3]: 0xbc0000 id[3]: 43
addr[4]: 0xc40000 id[4]: 44
addr[5]: 0xcc0000 id[5]: 45
addr[6]: 0xd40000 id[6]: 46
addr[7]: 0xdc0000 id[7]: 47
addr[8]: 0xe40000 id[8]: 48
addr[9]: 0xec0000 id[9]: 49 < SHM_MAXMEM = 10
step 0x80000 < SHM_STEP = 80000
step 0x80000
step 0x80000
step 0x80000
step 0x80000
step 0x80000
step 0x80000
step 0x80000
step 0x80000
step 0x80000
ret 0
Technical Manual
11-5
Shared memory management
NOTE During installation the BSE shell variable must be the same as the one for the
Bshell users. You can avoid installing shared memory manually each time by
including the installation in your system’s start-up procedure. If the BSE variable
is not /usr/bse, it must be set during the start-up procedure and shmmanager6.2
must be started with the –I option.
Starting shmtimer6.2
The UNIX time() function is a system call often called in database servers. On
multiprocessor systems, use of the time() function can be quite heavy. Even
though a process can run successively on different processors, this must be
invisible to the process. The process requires that each processor returns the
same time, using time(). Therefore, the processors have to synchronize their
internal clocks every time the time() function is called.
The shmtimer6.2 program can prevent this overhead. shmtimer6.2 is a daemon
process that writes the current time in shared memory. The time is updated every
second. This reduces the number of calls of the time() function to a maximum of
one per second.
When shared memory (shmmanager6.2 –i) is initialized, the shmtimer6.2
program starts. When shared memory is removed (shmmanager6.2 –k), the
shmtimer6.2 stops first. The following options can be used for shmtimer6.2:
–i : Initialize shmtimer6.2
A shmtimer6.2 program is started, and runs in the background.
–k : Kill shmtimer6.2
The running shmtimer6.2 program is killed. The allocated shared memory is
cleared, but not removed.
–s : Show status as stored in shared memory:
− The current time
− The process ID of the running timer
–u : Show information about shmtimer6.2
Technical Manual
11-6
Shared memory management
No more space
# shmmanager6.2 –a
No. of kbytes to be malloc: 4096
no more space
abort – core dumped
This error happens because some computer systems put a limit on the amount of
virtual memory (MAXUMEM) used by a process. Hence the shared memory
manager can not be capable of allocating 4096 K.
Solution: Adjust the kernel parameters. See the section “Kernel requirements.”
Technical Manual
11-7
Shared memory management
Technical Manual
11-8
Shared memory management
Syntax srdd_tab
The srdd_tab6.2 file can be divided into several sections. Each section is
indicated by the package combination for which components have to be loaded
into shared memory. For example:
package=31Sa
This parameter means that the components below this line belong to package
combination 31Sa.
After this line first the domains are specified. For example:
dti.pd
dtt.pd
The following data is the table definitions. For example:
dttaad000
dttaad001
After that the objects have to be placed. For example:
ottstpconv
ottstpdisplay
So the syntax must be:
package={pc}
for domains: <d{p}.pd>
for data definitions: <d{p}{t}>
for objects and reports: <o{p}{m}{o}>
The abbreviations are:
{pc} package combination
{p} package
{m} module
{t} table
{o} object (program/report)
You can also read parts of a data dictionary on a remote system into shared
memory. To do this, write the host name of the remote system at the beginning of
a line. For example:
${BSE}/standard6.2/ddbaan/dti/dti.pd
ibm1!/usr3/bse/standard6.2/ddbaan/dtd/dtd.pd
${BSE}/standard6.2/ddbaan/dttadv/dttadv100
${BSE}/standard6.2/ddbaan/dtppdm/dtppdm100
/usr2/bse/standard6.2/ttB40_a_CP/ottadv/oadv1100
If the file srdd_tab6.2 contains a redirection to a remote system, a remote user
file must be available for the user who executes srdd_init6.2.
Technical Manual
11-9
Shared memory management
Technical Manual
11-10
Shared memory management
Kernel requirements
General description of adjusting UNIX kernels
Static kernels
The kernel of a UNIX system is a program that runs from booting to shutting
down. The kernel performs all actions in which user programs access resources.
Internally, the kernel keeps lists of the actions that are executed simultaneously.
Because those lists have limited capacity, a very large number of simultaneous
actions can cause an overflow.
When there is an overflow, the kernel cannot process any new actions.
Consequently, when another action is added to the list the system displays an
error message. For example, if the number of files opened at the same time is
greater than permitted by the kernel, the system responds with error message 23
(ENFILE File table overflow).
To avoid this error message, the user can create a new kernel that allows a larger
number of files to be opened simultaneously. The kernel is stored on the system
in different forms.
First, it includes sources, libraries, an include file and, most importantly, a file
containing kernel parameters.
Second, the kernel is present as an executable and can be generated from the
previously-mentioned files.
Third, a kernel runs in the internal memory.
Adjusting the kernel requires a three-step procedure:
1 Adjust the file with kernel parameters.
2 Generate the kernel as an executable from the parameter file.
3 Reboot the computer, allowing the new kernel to be loaded into internal
memory and started.
Dynamic kernels
With a static kernel, boundaries are set through a kernel parameter. With a
dynamic kernel, the user can adjust boundaries during run time. The kernel of an
IBM system is fully dynamic (except for a few parameters), so the user does not
have to reboot the computer to activate changes. You can use a command to
modify the kernel of an IBM while the system is still running. Furthermore, the
kernel is automatically adjusted if the required number of resources is greater
than permitted by the kernel.
Technical Manual
11-11
Shared memory management
The kernels of Digital and Sun systems are semidynamic. When the system is
booted, some kernel parameters are read from a file and the kernel is adjusted
accordingly. The user can adjust other parameters while the kernel is running.
Kernel parameters
The recommended values for the parameters presuppose the following
conditions:
n A standard BaanERP installation
n One active session per Bshell
You can use the sar command while working in BaanERP to keep track of
parameter usage and adjust the parameters where necessary. This is of particular
interest for BaanERP customization. When using other databases, take into
account the kernel tuning references from the corresponding documentation.
NOTE When using raw devices, you must set the parameters relating to the cache such
as NBUF or BUFPAGES to low values, according to the database-specific
documentation, not to the relatively high values suggested in this document.
The following descriptions for parameters refer to the number of users. If there is
more than one active session per Bshell, instead of number of users, read number
of active sessions.
Processes
NPROC
The NPROC parameter specifies the maximum number of processes that can be
run simultaneously in the system.
NPROC = 64 * users & NPROC = 1.1 * MAXUP
Adjust: error 11
MAXUP
The MAXUP parameter specifies the maximum number of processes that can be
run per logon code. This restriction does not apply to the superuser. If several
users log on using the same logon code, those users must share this number of
processes.
MAXUP=64
Adjust: error 11, message ’fork failed: too many processes’
Technical Manual
11-12
Shared memory management
REGION, NREGION
The REGION parameter specifies the maximum number of program regions that
can be active at the same time. Each UNIX process has at least three regions:
text, data, and stack. The text part is shared if a program runs more than once.
Shared memory also uses the region resources.
REGION=3* * NPROC
Files
NFILE
The NFILE parameter specifies the maximum number of files that can be
opened simultaneously on the system.
NFILE = 512 * users
Adjust: Message “ file table overflow”
The command sar –v 1 1 shows the number of open files and the maximum
number of files to be opened, under the header “file-sz.”
NOFILES, SFNOLIM(SVR4), MAXFILES (HP)
The NOFILE parameter specifies the maximum number of files that can be
opened per process.
NOFILES >+ 256
Adjust: error 24, Too many connected sessions (INGRES).
On an SVR4 system the user can use not only the kernel parameter sfnolim, but
also a command to change the maximum number of open files per process. That
command is “limit – 256”, including the quotation marks. This new value only
applies in this shell.
Technical Manual
11-13
Shared memory management
Buffers
NBUF
Under SVR3 and SVR4, the NBUF parameter has a different meaning.
SVR3
The NBUF parameter specifies the number of system buffers available for
block I/O.
NBUF = 1/3 of total internal memory (SVR3)
NBUF = 0 (HP)
SVR4
In UNIX SVR4, buffers contain only indexes, superblocks, and file header
information. They do not contain file data. The actual file data is stored in
pages of virtual memory. The amount of virtual memory available for this
purpose is determined by the SEGMAPSZ parameter.
The NBUF parameter specifies the number of system buffer headers available
for block I/O.
NBUF = default, for example, 100
Adjust: Performance problems (sar –b)
NHBUF
The NHBUF parameter specifies the number of hash table entries that can be
allocated in the system.
NHBUF = 1/5 * NBUF
Adjust: Performance problems
BUFPAGES
The BUFPAGES parameter specifies the number of pages in the file’s system
buffer cache.
BUFPAGES = 1/3 of total internal memory) /4096, (HP)
Adjust: Performance problems
SEGMAPSZ
The SEGMAPSZ parameter specifies the size of the bitmap for file I/O. This
map determines the number of 4K pages and therefore the amount of memory
available for file I/O. If the value is 0, the kernel calculates the value as a
function of the amount of physical memory.
SEGMAPSZ = 0 or 1/x of total internal memory.
Adjust: Performance problems
Technical Manual
11-14
Shared memory management
BUFHWM
The BUFHWM parameter specifies the maximum amount of memory, in
kilobytes, that can be used by block I/O buffers. If the value of BUFHWM is 0
(the default), the kernel sets the value of the I/O buffers to 25% of available
memory.
Shared memory
SHMALL
The SHMALL parameter specifies the maximum amount of shared-memory text
segments that can be created.
SHMALL = SHMNI
Adjust: error 24
SHMMAX
The SHMMAX parameter specifies the maximum size, in bytes, of a shared-
memory segment that can be created. Several shared-memory segments of this
size can be created in an environment per process.
SHMAX >= SHM_BUFSIZE (in $BSE/lib/shm_param)
SHMMIN
The SHMMIN parameter specifies the maximum size of a shared-memory
segment in bytes.
SHMMNI = SHMSEG * ENVIRONMENTS
Test with: ipcs –m
SHMSEG
The SHMSEG parameter specifies the maximum number of shared-memory
segments that can be used by a process.
SHMSEG = 30
Adjust: error 24
Semaphores
SEMMAP
The SEMMAP specifies the number of entries in the control map used to
manage semaphores. This map is used to keep track of free areas in the system
pool of semaphores.
SEMMAP = SEMNI +2
Adjust: Message “Mfree map overflow”
Technical Manual
11-15
Shared memory management
SEMMNI
The SEMMNI parameter specifies the maximum number of semaphore
identifiers in the kernel. This is the number of unique semaphore sets that can be
active at any given time.
SEMMNI = 32 * users
Adjust: error 28
SEMMNS
The SEMMNS parameter specifies the maximum number of semaphores ipc –sb
permitted in the system.
SEMMNS = SEMMNI
Test with: “ipc –sb”
SEMUME
The SEMUME parameter specifies the maximum number of undo entries per
undo structure. Each undo entry represents a semaphore that has been modified
with the undo option specified in the semop(2) system call.
SEMUME = 10
Adjust: error 22
Message
MSGMAP
The MSGMAP parameter specifies the number of entries in the control map, for
example 100, used to manage message segments. Each entry in this map
represents a free area in the message buffer area.
MSGMAP = default
Adjust: Message “mfree map overflow”
MSGMAX
The MSGMAX parameter specifies the maximum size of a message in bytes. If
the protocol m (message queues) is used in the file $BSSE/lib/ipc_info, the value
must be set to 4096.
MSGMAX = 4096 & MSGMAX <= MSGMNB
MSGMNB
The MSGMNB parameter specifies the maximum length, in bytes, of a message
queue.
MSGMNG = 4096
Check with: ipcs –qo
Technical Manual
11-16
Shared memory management
MSGMNI
The MSGMNI parameter specifies the maximum number of message queues
that can be used on the system.
MSGMNI=32 *users
Adjust: error 28
MSGSEG
The MSGSEG parameter specifies the number of message segments permitted
on the system, for example 1024. Each message on a message queue consists of
one or more message segments. The size of each segment is specified by the
MSGSSZ parameter.
MSGSEG = default
MSGSSZ
The MSGSSZ parameter specifies the size, in bytes, of a message segment, for
example, 8. Each message consists of contiguous set of message segments large
enough to hold the text of the message.
MSGSSZ = default
MSGTQL
The MSGTQL parameter specifies the maximum number of message headers, in
other words, the maximum number of open messages.
MSGTQL = 32 * users
Technical Manual
11-17
Shared memory management
NINODE
The NINODE parameter specifies the maximum number of inodes that can be
used in the SV file system. This includes open files, used pipes, and the current
directory. The UFSNINODE parameter specifies the number of inodes for the
UFS file systems.
Technical Manual
11-18
12 Remote databases
General
The client/server architecture as supported by BaanERP enables the user to work
with several database types. These databases can be distributed over one or
multiple systems. A remote database configuration is one where an application
server (bshell) and the database are not on the same system.
The possible reasons for setting up a remote database configuration are:
n System performance
If all users start the application on the same system, the CPU is primarily
occupied by the Bshell and the display server. You can divide the load by
letting the users work on local systems and keeping the database on a remote
system.
n Lack of disk space on local system
If all tables cannot be stored on the same system due to a lack of disk space,
some of the tables can be installed on a second system.
n Distributed applications
For practical reasons you can decide to install the application tables on
different systems per application.
n Mirrored databases
For security reasons database actions can be carried out on two systems
simultaneously using database mirroring.
This chapter describes how to set up a remote database configuration and also
explains how to use it.
Technical Manual
12-1
Remote databases
In figure 8, the user interface and the application logic (Bshell) are both installed
on the local host. From version 6.1 forward, they can be installed on different
systems.
Assuming that all tables are installed on a remote system and the user interface
and application logic (Bshell) are installed locally, the following files must be
available for the system to work normally:
Technical Manual
12-2
Remote databases
Local host
On the local host, the following files and directories must be present:
$BSE/bin:
audit_srv6.2 hostid6.2
ba6.2 kermit6.2
badmin6.2 licd6.2
Bdbpost6.2 licmon6.2
bdbpre6.2 lp6.2
Bdbreconfig6.2 nlsedit6.2
bic6.2popup6.2 pdaemon6.2
bic_cstub6.2 qcommand6.2
bic_info6.2 qptool6.2
Binperm6.2 refint6.2
binput6.2 repgen6.2
bput6.2 rz6.2
brand6.2 shmmanager6.2
Bshcmd6.2 shmvalues6.2
Bshell6.2 sort6.2
bsp.setperm6.2 srdd_init6.2
client6.2 std_gen6.2
Compress6.2 sum6.2
encrypt6.2 sz6.2
Explode6.2 tsscomp6.2
filter6.2 tsscvt6.2
Gcommand6.2 tssinfo6.2
$BSE/lib:
tabledef6.2
fd6.2.<package_comb> (optional)
ipc_info
/user/r<user>
$BSE/etc:
rc.start
rc.stop
$BSE/tmp
$BSE/log
Technical Manual
12-3
Remote databases
Remote
It is recommended that you install the complete $BSE-environment on the
remote system. If no application is started on the remote system, executable
programs such as Bshell6.2 and ba6.2 do not have to be installed there. It is
practical if one or more users can run the application locally on the remote
system. For this reason they must be run on the remote system. That is why the
entire BSE environment must be installed there.
The remote system must include at least the following files:
$BSE/bin:
fs6.2
ipc_boot6.2
database_servers with associated executable programs, such as ora7_srv6.2
installation and validation programs, such as install6.2, licd6.2, and so on.
$BSE/lib:
tabledef6.2
user/u<user>
ipc_info
driver-specific directory, for example, ora
fd.6.2.<package_comb> (optional)
$BSE/etc – rc.start
rc.stop
If these files are available on the local and the remote system, respectively, you
can adapt the following files. The data dictionary contains sessions where you
can adapt the files. It is better to adapt the files in the sessions in the data
dictionary and not directly in the files themselves.
Local
On the local system the following files are configuration dependent:
n tabledef6.2 Database Definitions (ttaad4510m000) and Tables by Database
(ttaad4111m000))
n u<user> Remote User Data (ttaad2500m000)
n r<user> Remote User Data (ttaad2501m000)
Technical Manual
12-4
Remote databases
tabledef6.2
Start the application by executing the user interface (UI). The UI then starts the
application logic (Bshell), which reads the file tabledef6.2 to search for the table
location and database type. Tables can be stored on a local or remote system,
which is also indicated in this file.
The file tabledef6.2 is filled using the Database Definitions (ttaad4510m000) and
Tables by Database (ttaad4111m000) sessions on the menu BaanERP ToolsÈ
Database ManagementÈ Database Definitions and Directories. These
sessions indicate whether tables are installed on a remote database.
The file tabledef6.2 is located in the $BSE/lib directory. For more information
about tabledef6.2, refer to the help text for business object Database
Management, on the menu BaanERP ToolsÈ Database ManagementÈ
Database Definitions and Directories.
You can specify whether each table is installed locally or remotely by entering
the remote system name in the System Name field in the Database Definitions
(ttaad4510m000) session. Then use the Tables by Database (ttaad4111m000)
session on the menu BaanERP ToolsÈ Database ManagementÈ Database
Definitions and Directories to assign tables to this table definition.
For example, assume that all tables are installed on the remote system host1. This
means that tabledef6.2 on the local system must contain the line: *:*:host1:N.
If all tables are on a remote system you can set the variable BSE_REM on the
local system. If there is no tabledef6.2 file on the local system, the Bshell
searches for this on the remote system, otherwise it reads the local tabledef6.2
file. The variable BSE_REM indicates the remote system:
BSE_REM=host1
User files
To start an application, every user (logon) must have a user file. The Bshell reads
this user file to test whether the user is authorized to start the application. The
Remote User Data (ttaad2501m000) session creates the file
$BSE/lib/user/r<user>.
If all tables are installed on the remote system, the user files can be installed
there, too, instead of on the local system. In that case you can set the system
variable BSE_REM with the system name of the remote system, for example
BSE_REM=host1. The Bshell looks first in the local $BSE/lib directory. If it
cannot find the needed files there, it uses the BSE environment ($BSE/lib) on the
remote system.
Technical Manual
12-5
Remote databases
The remote system now reads the user file u user. To access tables on a remote
system, you need to log on to the remote system. This is done using a remote
logon user file named r user. You create this file using the Remote User Data
(ttaad2501m000) session. Read session Help for information on how to create
this file.
Variant I
Two variants of r user are possible. If the user’s logon is the same on the local
and the remote system, variant I is sufficient. Define the remote system, the path
on that system, and the password to log on to the remote system.
In variant I, the following information is needed:
n Name of remote host
n BSE path on remote host
n Encrypted password on remote host
EXAMPLE A user “peter” would like to work with BaanERP on his local work station. The
database tables he wants to use, however, are located on a remote system called
host. To access the remote data, he needs a file rpeter in the directory
$BSE/lib/user. If all tables are located on the remote system, he sets the
following system variable:
BSE_REM=host1
This makes sure that everything is read from the remote BSE environment except
the bin directory.
When using Variant I, user peter must have a logon entry on the remote system.
The file r user must contain the name of the remote system, the path of the BSE
on the remote system and the user’s encrypted password for the remote system.
Variant II
A second variant of r user allows you to log on to the remote host using another
logon code. Indicate whether the UNIX and BaanERP permissions must be
inherited from the other user. If so, the user file u user on the remote system
must have the same UNIX logon as on the local system.
In variant II, the following information is needed:
n Name of remote host
n BSE path on remote host
n Logon name on remote host
n Encrypted password on remote host
n SUID inherited logon
Technical Manual
12-6
Remote databases
The remote user file can contain more than one line.
When using variant II, you can also specify a logon code to access the remote
system. This can be a different logon code than “peter,” for example “john.”
After that you enter the encrypted password for the remote logon (john). The
remote system must still have a user file upeter.
Variant II also allows you to take the UNIX and/or BaanERP authorizations
defined for the logon john. To do so, specify “yes” or “no” for the fields SUID
and Inherit Logon. SUID switches the user ID from peter to john. Inherit Logon
makes sure the BaanERP authorizations defined for john apply also to peter.
To switch the user ID, the file ipc_boot6.2 ($BSE/bin) must have UNIX root
permission root and the s-bit must be set. From a security point of view this is
not advisable.
Here is an example of the two variants:
Variant I:
host1 /usr2/bse NZ+,AHtg&#K-kt"Q{$=Y3-"VLDN’CRtZ
host2 /usr1/t/bse h8i0_-+8yujg@#c67h78i\{}907h67h5R
Variant II:
host1 /usr2/bse john NZ+,AHtg&#K-kt"Q{$=Y3-"VLDN’CRtZ no yes
host2 /usr1/t/bse h8i0_-+8yujg@#c67h78i\{}907h67h5R yes yes
Remote
Whenever a local system connects to the remote system, ipc_boot6.2 is the first
program to start. That process in turn starts fs6.2, which can read tabledef6.2 on
the remote system. It finds an entry in tabledef6.2, showing the database type for
a range of tables to be accessed.
A database server is started, for example, ora7_srv6.2. The path for both fs6.2
and the database server is read from the file $BSE/lib/ipc_info.
Once on a remote system, you cannot call a third system. This means that
tabledef6.2 must always have an entry on the tables.
Technical Manual
12-7
Remote databases
Technical Manual
12-8
13 Multibyte management
General
The currently used 8-bit wide character space is not large enough to fit most
Asian character sets. Asian countries such as Japan, China, and Korea need at
least 16 bits of character space to accommodate local characters. Therefore a 32-
bit wide character space has been implemented in BaanERP Tools to support all
possible character sets.
Be aware that a character is not necessarily the same as a byte and can take up
more than one screen position. A character in the Bshell occupies one or two
screen positions at a size of 4 bytes.
Technical Manual
13-1
Multibyte management
The characters 0x00 – 0x20 and 0x7F – 0x9F cannot be included in the sets,
because these ranges contain control and escape codes. This leaves the following
ranges:
0x212121 – 0x7EFFFF
0xA12121 – 0xFFFFFF
To distinguish TSS characters, the character contains the prefix 0x9B. Hence the
complete TSS ranges are:
0x9B212121 – 0x9B7EFFFF
0x9BA12121 – 0x9BFFFFFF
Code Features (CF) and Line Drawing Characters (LDC) have been implemented
in the code range of ISO-8859/1 as follows:
n Line Drawing Characters | 0x80 – 0x8A
n Code Features | 0x8B – 0x9A
n TSS Lead byte | 0x9B
n Reserved | 0x9C – 0x9F
These code ranges do not conflict with the currently implemented EUC character
sets, but they can cause problems when you import these codes. Also these codes
overlap with SHIFT-JIS trailing bytes, causing import conversion errors.
Therefore the code ranges are translated into ASCII characters (0x00-0x7F)
during the export phase and are converted back into the correct LDC and CF
characters during the import phase.
Currently assigned planes are:
Technical Manual
13-2
Multibyte management
Utilities
This section describes the available programs belonging to BaanERP Super Set.
These programs are present in the directory $BSE/bin.
tsscomp6.2
NAME
tsscomp6.2
This program compiles and checks TSS information file tss6.2. This program is
executed by the Convert TSS Data to Runtime (tttss0103m000) session.
SYNOPSIS
tsscomp6.2 [-svV] [-e error file] [-d debug level] [–i input file] [–o output file]
Technical Manual
13-3
Multibyte management
DESCRIPTION
tsscomp6.2 compiles the file tss6.2, which contains the descriptions of all
supported character sets into a fast-loading binary file tss_c6.2. It also performs
several checks on the entered data of the character sets.
The available options are:
-s Suppress output of errors. Check the exit value to determine if the
program has been successful.
-e Write all warnings and errors to file error file.
-vV Prints version and porting information.
-d Used to provide some debugging information. This is a bit set.
-i Optional input file. Default $BSE/lib/tss6.2.
-o Optional output file. Default $BSE/lib/tss_c6.2.
Return values:
n 0 = success
n > 0 = failure
tsscvt6.2
NAME
tsscvt6.2
TSS conversion filter.
SYNOPSIS
tsscvt6.2 [-vV] [-dow] [-l locale]
DESCRIPTION
This program converts multibyte characters strings into TSS strings or vice versa.
The input/output character set can be set using the –l option, but is read from the
user file (locale resource) if not given.
Use the –o option to convert from TSS to the native character set.
The available options are:
-vV show version and porting information.
-d show some additional debug information.
-w Do not accept any conversion warnings, but exit(1) instead.
Technical Manual
13-4
Multibyte management
Return values:
n 0 = success
n > 0 = failure
tssinfo6.2
NAME
tssinfo6.2
This program offers information about the current settings such as your TSS
locale, NLS locale, character set information, and so on.
SYNOPSIS
tssinfo6.2 [-vV] [-sf] [-l locale]
DESCRIPTION
The available options are:
-vV show version and porting information.
-s show character set definition of TSS locale.
-f show font assignments.
-l show information about the given locale. This is read from the user file
if not given.
EXAMPLE Command: tssinfo6.2 –sf
User : bsp
TSS locale : KANJIEUC_AIX32
TSS character set : KANJIEUC
NLS locale : ja_JP
Factor :1
Multibyte strings:
Database min. : 0x1
Database max. : 0x9b217e7e
Forms min. : 0x20
Forms max. : 0x9b217e7e
Single byte strings:
Database min. : 0x1
Database max. : 0x7f
Forms min. : 0x20
Forms max. : 0x7a
Technical Manual
13-5
Multibyte management
NATIVE TSS
From To from to
1 7f 1 7f
8ea1 8edf 9b2321a1 9b2321df
a1a1 fefe 9b212121 9b217e7e
Font assignments
Technical Manual
13-6
Multibyte management
Technical Manual
13-7
Multibyte management
Technical Manual
13-8
Multibyte management
Locale information
The file tss_locale6.2 in the directory $BSE/lib contains all possible TSS locales
that can be defined in the user file or specified with special commands, such as
tsscvt6.2 –l locale. This file is filled by the Maintain Locale Data
%SEtttss0104m000) session. The format is as follows:
Locale, Charset, NLS_locale, MBdbLow, MBdbHigh, MBFormLow, \
MBFormHigh, SBdbLow, SBdbHigh, SBFormLow, SBFormHigh
Locale As specified in the user file.
Charset Any of the character sets defined in tss6.2.
NLS_locale The NLS locale. Mainly used for character collation. May be
NULL.
MbdbLow The lowest possible multibyte character value for database
storage.
MBdbHigh The highest possible multibyte character value for database
storage.
MBFormLow The lowest possible multibyte character value for forms (see
the expr function).
MBFormHigh The highest possible multibyte character value for forms (see
the expr function).
SBdbLow The lowest possible single byte character value for database
storage.
SbdbHigh The highest possible single byte character value for database
storage.
SBFormLow The lowest possible single byte character value for forms (see
the expr function).
SBFormHigh The highest possible single byte character value for forms (see
the expr function).
EXAMPLE # Japanese – HPUX 9.0
KANJIEUC_HPUX: KANJIEUC, Japanese.euc, 1, 65278, 32, \ 65278, 1, 127, 32, 122
# \ is used here to indicate that the line following this character must actually be
in the same line.
The directory $BSE/lib/locale contains files having names identical to the locale
names, with character set information used to display the character set ranges. A
set is chosen by the setno entry in the tss6.2 character set description file. These
files are managed by the Fonts (tttss0106m000) session.
Technical Manual
13-9
Multibyte management
Technical Manual
13-10
14 Audit management
General
This chapter introduces the audit management facility provided with BaanERP
Tools from Version 6.0 onward. It describes the audit server, the audit
management utility, and where audit data is stored. It also describes the structure
of the audit files. Finally, this chapter explains how to give users permissions to
print, maintain, or clean audit data.
Sequence files
The audit data is stored in a set of files called sequence files. There can be
multiple sequence files per table per company number.
Apart from storing audit data and transaction information, a sequence file also
stores information about audited columns of the table, the audit data dictionary.
The name of the sequence file is built using the table name and company
number. The format of the sequence file name, where prefix a indicates an audit
file, just as t indicates a table itself, is as follows:
a<mmmnnn><company number>.<sequence file number>
mmm represents the module code
nnn represents the file number
For example for table ttadv999 and company 000 the sequence files are:
aadv999000.000
aadv999000.001
aadv999000.002
aadv999000.003
..........
For detailed information of the sequence file, refer to the section “Format of
audit files.”
Technical Manual
14-1
Audit management
Information file
There is one information file per table per company number, which:
n Stores information about all sequence files used for this table/company
number combination
n Contains controlling information used to create and maintain sequence files
The name of the information file is based on the table name and the company
number. The format of the information file name is as follows, where mmm
represents the module code and nnn represents the file number:
a<mmmnnn><company number>.inf
For example, for table ttadv999 and company 0, the information file is
aadv999000.inf.
NOTE There is one set of files per table name/company number combination. This
means that any associated information, sequence file, or operation is identified
by the table name/company number combination. For the sake of readability this
document uses the word “table” to refer to a table name/company number
combination.
Technical Manual
14-2
Audit management
Technical Manual
14-3
Audit management
For the same table, if for company 100 the start sequence is 1, and the end
sequence is 50, the files are:
abdb000100.001
abdb000100.002
....
abdb000100.049
abdb000100.050
In principle, all audit data for a table/company number combination can be
written to a single sequence file. But because this file becomes too big to manage
properly, the audit data is split across multiple sequence files.
The maximum size of a sequence file for a table is defined in the audit_spec file.
If the limit is exceeded, the audit server tries to use the next sequence file.
Audit management
The audit management version 6.2 incorporates the following features in
BaanERP audit management utility:
n Audit data is stored in a set of files, instead of a single file. Multiple files
allow for better management than a single large file. See the section “Storage
of audit data.”
n Each transaction is identified by a transaction header, which logs useful
information about the transaction, such as the corresponding user and time.
Also, the data is organized per transaction. Each transaction has a header
followed by all audit data, which enables easy tracking of the changes that
users have made.
n When the audit data is being written, information of audited columns in
tables is also stored in audit files. If the table data dictionary is later changed,
you can still interpret old audit data by using the stored column information.
n Table level commands affecting table data such as create table, clear table,
and drop table, are also logged by the audit server.
n Audit management such as printing audit files and display audit sequences is
done by using the sessions belonging to the Audit Management business
object.
Technical Manual
14-4
Audit management
Name
Stores column name without table name prefix.
Type
Single byte indicating field type. The defines in BDB layer for field type are
used, because 4GL also uses the same values. For example, for the CHAR field,
the BDB type is BDB_CHAR, and the 4GL counterpart DB.CHAR has the same
define as BDB_CHAR.
Depth
Single byte, indicating depth of the field.
Size
2 bytes, indicating field size. For array fields this is the size total of all fields in
array.
Technical Manual
14-5
Audit management
Row operations
For row operations, the audit server keeps the values of audited fields.
Insert actions
The new values of all audited fields to be inserted are stored in the audit file.
Delete actions
The field values of the record to be deleted are stored in the audit file.
Update actions
To comply with an application user requirement, the old and new values of the
fields that are changed in an update are stored. Primary key field values are also
stored, even if they have not been changed. In addition, if any other audited
column changes, its old and new values are stored. If an audited field is not
changed, and it is not a primary key field, its value is not stored in the audit row.
In addition to field values, a one-character code indicating the type of row
operation is also stored.
Table operations
For table operations such as create table, drop table, and clear table, it is
sufficient to store only an indicator. The audit server stores a one-byte indicator
for table operations.
Technical Manual
14-6
Audit management
Application data
In accordance with the application user requirement, the audit server keeps 4
bytes extra space reserved in each audit row, to be used by application programs.
Application programs are free to use this space for their own usage. This 4-byte
space is called application data. The audit server does not interpret the
application data in any way.
Length
A two-byte field that indicates the length of this audit row (excluding this field
itself).
Appl Data
A four-byte field reserved for application program usage. The audit server, when
writing a row, initializes this to nulls.
Action
A one-byte character code indicating the action done on the table. The following
codes are available:
-C create table
-R drop table
-L clear table
-I insert row
-D delete row
-U update row
Data
The previous fields fulfill the audit requirement for table-level actions. No Data
field is included for table-level actions.
Technical Manual
14-7
Audit management
For row level actions, the important values of audited fields are stored as data, as
explained in the following sections.
Insert/Delete actions
Values of all audited fields are stored for insert and delete actions. They are
stored in the same field order as that of the audit data dictionary of a sequence
header. If the audit data dictionary of a table has columns in the order c4, c2, c1,
c3, c6, the values are stored in the same order.
Update actions
For update actions, the field number precedes the field values in the audit row.
Field numbers used here are related to the sequence of fields in the audit data
dictionary and not to the original table data dictionary. Suppose a table has
columns c1, c2, c3, c4, c5, c6, with primary key (c4, c2), and all except c5 are
audited. The audit data dictionary contains information for these columns in
order c4, c2, c1, c3, c6. Thus the field number 0 refers to field c4 and not to field
c1. Similarly field 3 refers to c1 and not to c3. For update actions, an audit row
looks as follows:
Length Appl Data ’U’ Multiple field entries
Field number
A two-byte entry that indicates the field in the audit data dictionary.
Changed
A single-byte flag, used to indicate whether the field is updated or not. The field
value for primary key fields must be stored, whether it is changed or not. When
the field value is changed, the corresponding flag is set to Y, otherwise it is set to
N. The values for all other audited fields are stored in the audit row only if they
are changed, so for these fields, the flag is always set to Y.
Old Value
The old value of the field that is being updated. For a primary key column that is
not changed, this is the only value stored.
New Value
If an audited field value is changed, this represents the new value. For primary
key audited fields that are not changed, this field is not present in the audit row.
Technical Manual
14-8
Audit management
The primary key field or any other audited fields are changed. In this case the
field entry is as follows:
Field number Y Old value New value
Here c4, c2, and so on, indicate the values of the corresponding fields. Each field
entry size is the size of the field itself.
Technical Manual
14-9
Audit management
Delete Row
Length Appl Data ‘D’ c4 c2 c1 c3 c6
Update Row
Assume that c2 (primary key column) and c6 are changed.
Length Appl 'U' 0 N c4.o 1 Y c2.o c2.n 4 Y c6.o c6.n
Here, the entry for field 0 (c4) is present, although it is not changed, because the
field is a primary key field. Its only value stored is c4.o, the old value. Because
c2 (field 1) and c6 (field 4) are changed, their old and new values are stored as .o
and .n respectively.
Audit server
Long transactions and overflow file
The audit server buffers audit data in its memory buffers until the end of the
transaction. For example, if during a transaction 100 rows are inserted in a table
and then a commit is done, all the audit rows for the insert are buffered by the
audit server. This data is written to the audit files only at the time of commit.
The audit server uses individual memory buffers for each table. The size of the
buffers is set to enable them to hold large amounts of data. However, the memory
buffers might not be able to contain the results of a very large transaction. In this
case, the audit server uses an overflow file to buffer the remaining data.
The overflow file is created in $BSE/tmp. There is one overflow file per session
per server. Its name is made using the session ID and process ID (pid) of the
audit server, as follows:
ao.{Session Id>.<Process Id of the Audit Server>
Technical Manual
14-10
Audit management
A single overflow file is used to buffer data for all the tables in the session for
which the memory buffers were insufficient. At the end of the transaction, if any
table has data in the overflow file. The overflow file is read and put in the
corresponding sequence file. After all data has been read and copied from the
overflow file, the overflow file is deleted.
If a transaction is canceled, the overflow file is deleted.
NOTE The memory buffers of the audit server can hold a large amount of data. If the
audit server still has to use the overflow file, the transaction is too big. This can
be a flaw in application design or coding. If possible, such transactions must be
avoided.
Sequence termination
The audit server uses a set of sequence files to store audit data for a table. The
audit server switches from one sequence file to the next under the following
circumstances.
Technical Manual
14-11
Audit management
If the audit data dictionary changes after the system writes some audit data to a
sequence file, you cannot continue using the same sequence. In this case, the
audit server stops using the current sequence and marks it closed while the audit
data dictionary has been changed. It starts using the next sequence.
Note that here the switch is made only if the audit data dictionary changes. This
is different from changing the table data dictionary. Changing table data
dictionary does not mean that the audit data dictionary is also changed.
Events that lead to changes in the audit data dictionary are in the following
example.
Suppose you have a table with columns c1, c2, c3, c4, c5, c6 with primary key
(c4, c2) in which all except c5 are audited. The audit data dictionary contains
information for these columns in order c4, c2, c1, c3, c6.
Consider the following changes:
Number of audited columns changed
If the audit trail status for any field is changed, the audit data dictionary changes.
For example, if audit trail is enabled for c5, the audit data dictionary must have
column information in the order c4, c2, c1, c3, c5, c6. This is different from the
audit data dictionary of the current sequence, so a sequence change occurs.
Similarly, if auditing is disabled for c1, the new audit data dictionary is c4, c2, c3
and c6, which is different from the current audit data dictionary. As a result, a
sequence change occurs.
Order of audited primary key columns changed
Initially the primary key was (c4, c2). If its definition is changed to (c2, c4), the
new audit data dictionary is c2, c4, c1, c3, c6. Because this is different from the
audit data dictionary of the current sequence, the audit server closes the current
sequence and uses the next sequence.
Order of other audited columns changed
The audit data dictionary changes if the order changes in which the columns
(other than the primary key columns) occur in the table definition. For example,
if the table is now defined as c1, c2, c4, c5, c6, c3, the new audit data dictionary
is c4, c2, c1, c6, c3. In this case the sequence order is changed.
Technical Manual
14-12
Audit management
Transaction termination
When a transaction is started, the audit server buffers audit data until the
transaction ends. Depending on the manner in which the transaction is ended,
two types of behavior are possible: simple commit/abort or two-phase commit.
Technical Manual
14-13
Audit management
Technical Manual
14-14
Audit management
Format of $BSE/lib/xchdef6
The format of an entry in the xchdef6 file is as follows:
table_name:company_number:{Y|N}
EXAMPLE ttadv:*:Y
tiitm001:*:Y
ttaad410:000:Y
*:*:N
In this example, two-phase commit is used for the following tables:
n all tables in the module ttadv for all companies
n table tiitm001 for all companies
n table ttaad410 for company 000 only
For other tables the decision is based on the setting of the dbcinit resource
variable. If the xchdef6 file is not present, the system behaves as though the file
were present with the entry:
*:*:N
In other words, the decision is based on the dbcinit resource variable only.
Technical Manual
14-15
Audit management
File locking
When writing the data for a transaction, the audit server can close the current
sequence and start using the next sequence. Thus it can change the current
sequence field in the information file header. It also changes the sequence status
and sequence end time for the current sequence, and changes the status and start
date/time of the next sequence.
Even if the audit server does not switch sequences, it needs to change the current
offset in the information header and the number of transactions in the sequence
header. This means that it always changes the information header and the
sequence header. Moreover, because the sequence header is maintained in the
sequence file and information file, both of these must be changed.
Technical Manual
14-16
Audit management
At the start of a transaction termination command for each table and before
writing buffered data to the audit file, the audit server locks the information file
header and sequence header in the information file and sequence file. The audit
server puts write locks on, so that no other read or write lock can succeed. After
the data for all tables is written, the locks on all tables are released. If there is an
error on any table, the status of transactions for tables already written is changed
to abort and the locks on all tables are released.
Technical Manual
14-17
Audit management
Multisession support
The audit server supports multiple sessions, which means that the same audit
server is used for multiple sessions within the client.
The audit data dictionary of a table is kept globally. The same table/company
number in multiple sessions shares a single audit data dictionary.
The handlers (one used per table/company number combination) are kept in
global lists. If multiple sessions operate on the same table/company number
combination, they share a single handler.
Technical Manual
14-18
Audit management
Audit errors
The audit server uses the following error messages. If you receive one of these
error messages, refer to $BSE/log/log.audit for more information regarding the
cause of the error.
E_AUD_SETUP 251 The audit setup is not correct.
This can occur if the specification in $BSE/lib/audit_spec file is not in proper
format.
TOSEQ 6 SECURITY 28 MAXSEQSIZE 25K or
No table/company number combination
aa:00a:TOSEQ 6 SECURITY 28 MAXSEQSIZE 25K
Incorrect company number.
*:*:TOSEQ 6 SECURITY 28 MAXSEQSIZE 5K
The maximum sequence size limit is less than the specified limits. Refer to the
section “Format of audit files” for details about the format of this file. It can also
mean that the current sequence file was illegally removed or that the sequence
files were removed without using the 4GL interface. Audit files used during the
first run can also cause this error.
E_AUD_CORRUPT 252 An audit file is corrupt.
Some corruption of the information file has occurred. There is a mismatch of
sequence headers in information file and sequence file.
Technical Manual
14-19
Audit management
Authorizations
The Administrator user grants audit security permissions to users using the Audit
Authorizations (ttaad4562m000) session, on the menu BaanERP Tools, Audit
Management. These permissions determine whether the user is allowed to use
the sessions in the Audit Management business object.
Security permissions assigned to users are checked against previously existing
records to see if they conflict.
You can assign security permissions for all packages, modules, table numbers,
and companies. You can give some permissions for all packages, and disable
these permissions by giving no permissions to a range of packages.
You can use the Specified command to give particular permissions to a specified
package. By using Specified, the highest priority is given to the security
permissions assigned for that particular package, module, table and company.
You cannot assign security permissions for a range within a range. Suppose you
assign some permissions using the All command, then disable permissions for a
range between tt—vv. You cannot then enable permissions within this range or
an overlapping range. However, you can use the Specified command to enable
the permissions for a specific package.
The conflicting records are not stored in the table.
The security permissions for users are stored in a table ttaad462, which you can
access accessed using the sessions within the Audit Management business object.
The security checking is done at two layers, one at the user level and another for
reading audit information. The user can have permissions at the user level but not
for reading the audit information. At audit level, the security permissions are
stored in the audit information header of the audit information file.
Technical Manual
14-20
Audit management
Technical Manual
14-21
Audit management
The user is not allowed to Print or Clean up any audit information in the audit
files using the sessions in the Audit Management business object. It is possible,
however, to run the Audit Information File (ttaad4160s000) session, because
the user has Maintain permission only at audit file level.
Permission at user level Maintain or Print/Maintain or
Clean/Maintain
Permission at audit level Maintain/Application defined
If the user is not Administrator and only Application-defined exists at the audit
file level, no session of the Audit Management business object can be executed.
The Administrator user can use the maintain session even if no permissions are
assigned to the Administrator user. However, the Administrator user cannot use
print and clean sessions unless security permissions are assigned to
Administrator.
If user bsp has Print permission at user level, a further check is made to see the
security permissions at audit level. User bsp is only allowed to continue if print
permission is available at the audit level. Otherwise the session is canceled and
an appropriate message is displayed.
Technical Manual
14-22
Audit management
Company Number
Tables can be chosen based on company number. For example:
* – All companies.
100 – Company 100 only.
100,000 – Company 100 and 000.
Directory
Directory in which the audit files are stored. Under this directory, another
directory is created, called:
aPackage + Module Code
Information file
There is one information file per table per company number. You can read the
information file by using the 4GL functions or the dictionary programs.
The information file contains the controlling information for the sequence files,
called the information header, followed by the sequence headers of all the
sequence files created.
The format of the information file name, where mmm means module code and
nnn means table number, is as follows:
a mmmnnn company number.inf
For example, the name for table ttadv999, company 0, is aadv999000.inf.
The structure of the information file is a header called information header,
followed by multiple sequence headers, one for each sequence created.
Information header
n Version Information
Used to store the version information. This must never be modified by the
application by any means.
Length: 4 bytes
n Table name
The table for which audit information is stored.
Length: 8 bytes.
n Company Number
The company of the table.
Length: 2 bytes.
Technical Manual
14-23
Audit management
n Status
Specifies whether sequence reuse is allowed or not.
Length: 1 byte.
n From Sequence Number
Audit data is stored in sequence files specified from this value.
Length: 2 bytes.
n To Sequence Number
The last sequence file after which sequence reuse is started, or the user must
take appropriate action, such as deleting the existing file before reusing them.
Length: 2 bytes.
n End Sequence Number
Specifies the last sequence written in the information file. This field is for
internal use by Audit Server only! The user must never change this field,
otherwise the audit server will not work correctly.
Length: 2 bytes.
n Max. Size of 1 audit file in Bytes
Specifies the maximum file size of a sequence file.
Length: 4 bytes.
n Security Level
This lists the users who have access to the information in the audit files. The
security permissions regarding access to audit information are stored here.
Length: 2 bytes.
n Current Sequence Number
Determines the current sequence number that is used to write the audit data in
the sequence file.
Length: 2 bytes.
n Offset in current sequence file.
Specifies the offset in the current sequence file where the audit data is
written.
Length: 4 bytes.
n Reserved space
Space that is reserved for future use. Application programs must never use
this space because it might be required for a future release of the audit server.
Length: 8 bytes
n Length of following sequence header
Length: 2 bytes
Technical Manual
14-24
Audit management
Sequence Header
Each sequence file also begins with a sequence header. The information file
contains copies of sequence headers for all sequences created.
n Sequence Number
This specifies the sequence number of the sequence file.
Length: 2 bytes.
n Creation Date
This specifies the creation date of the sequence file.
Length: 8 bytes, format: YYYYMMDD.
n Creation Time
This specifies the creation time of the sequence file.
Length: 6 bytes, format: HHMMSS.
n Termination Date
This specifies the termination date of the sequence file.
Length: 8 bytes, format: YYYYMMDD.
n Termination Time
This specifies the termination time of the sequence file.
Length: 6 bytes, format: HHMMSS.
n Status
The status gives information to the user whether the sequence file was user
terminated, closed because of a data dictionary change, or closed because
transaction data could not be accommodated in the sequence file.
Length: 2 bytes.
n Number of transactions in the sequence
This specifies the data of number of transactions present in the sequence file.
Length: 2 bytes.
n Application Information – 1
Application Information – 2
Application Information – 3
Application Information – 4
These bytes are reserved for storing data specific to the application. If the
application needs to store any information in audit files, these fields are used
to store that information.
Length: 4 bytes, per application information field.
n Number of fields being audited
The total number of fields that are being audited.
Length: 2 bytes.
Technical Manual
14-25
Audit management
Sequence file
Multiple sequence files are used to store audit data for each table/company
number combination. You can read the sequence files by using the 4GL
functions or the dictionary programs. The format of the sequence file name,
where mmm refers to the module code and nnn means table number, is as
follows:
a mmmnnn company number.sequence file number
For example, these sequence files can exist for table ttadv999, company number
0:
aadv999000.000
aadv999000.001
aadv999000.002
aadv999000.003
....
The sequence file contains the table name and company number, followed by the
sequence header. This is followed by transaction data of multiple transactions.
Transaction data is followed by a transaction header and contains multiple audit
rows generated for the transaction.
Technical Manual
14-26
Audit management
Technical Manual
14-27
Audit management
Transaction Status 1
Number of audit rows in the transaction 2
Also since Baan IVc, the following fields are added at this position.
{
GATI 0 4
GATI 1 4
Commit Date ( YYYYMMDD ) 8
Commit Time ( HHMMSS ) 6
Reserved space 8
}
Total bytes of data of this transaction 4
You need to log both the operating system user ID and the BaanERP user name.
This is because a user can change the USER environment variable and use
different BaanERP user names. Also, different BaanERP users can have different
table privileges in SQL databases. Programs can find the operating system logon
name by using the operating system user ID print.
n Operating system user ID
Length: 4 bytes
n BaanERP user name
Length: 8 bytes
n Date (YYYYMMDD)
Length: 8 bytes
n Time (HHMMSS)
Length: 6 bytes
n Session name
Length: 15 bytes
n Transaction status
Length: 1 byte. The transaction status can have the following values:
COMMIT_DONE
ABORT_DONE
n Number of audit rows in the transaction
Length: 2 bytes
n Total bytes of data of this transaction
Length: 4 bytes
Technical Manual
14-28
Audit management
Technical Manual
14-29
Audit management
Field numbers are used for identifying the fields. The field number is its position
in the AUDIT data dictionary, starting with field 0.
An entry for a field contains the following information:
n Field number – 2 bytes
n Is the value changed – 1 byte (Y or N).
n Old value
n New value
If a field is changed here, both old and new values are stored. If an audited
primary key field is not changed, only the old value is stored. If other audited
fields are not changed, nothing is stored. For all changes made to all audited
fields, entries are made to the audit data.
n Transaction status
Length: 1 byte. Transaction status can have the following values:
− COMMIT_DONE
− ABORT_DONE
n Number of audit rows in the transaction
Length: 2 bytes
n Total bytes of data of this transaction
Length: 4 bytes
Transaction Data Format:
n Length of the row (Length: 2 bytes)
n Application data (Length: 4 bytes)
n Type of operation (Length: 1 byte)
n Row data
Four bytes of space is kept in every audit row to store application data. This data
is stored and manipulated by 4GL applications and not by the audit server. The
audit server keeps the 4 bytes of extra space to be used later. The type of
operation is a single character field, indicating the database action done on the
table.
The following characters are used to indicate audited database actions.
n C – Create table
n L – Clear table
n R – Drop (remove) table
n I – Insert row
n D – Delete row
n U – Update row
Technical Manual
14-30
Audit management
In the audit row, the row data is present only for row level actions. The field
values, when stored, are stored in the same format as their data type. This means
that a value for a long field is stored as a long data type in the audit row. The
length of each field entry in the audit row is the same as the length of the column.
The row data for an insert consists of the field values to be inserted of all audited
fields, in the order in which they occur in the audit data dictionary.
The row data for a delete consists of the field values of the row to be deleted and
of all audited fields, in the order in which they occur in the audit data dictionary.
Not all fields in the table are updated for an update. Apart from storing field
values, an identifier is required to specify the field to which this data belongs.
Field numbers are used for identifying the fields. The field number is its position
in the AUDIT data dictionary, starting with field 0.
An entry for a field contains the following information:
n Field number – 2 bytes
n Is the value changed – 1 byte (Y or N).
n Old value
n New value
If a field is changed here, both old and new values are stored. If an audited
primary key field is not changed, only the old value is stored. If other audited
fields are not changed, nothing is stored. For all changes made to all audited
fields, entries are made to the audit data.
audit_spec file
The audit_spec file is used to specify audit file parameters. There is one such file
for each BSE environment, and it is located in the $BSE/lib directory.
The format of the file is
Table Name:Company Number:Audit Specifications
Following is the meaning of each field.
n Table Name
Indicates the table. The table name can have the following formats:
*
All tables in all packages.
Package
All tables in this package, for example tf, td, and so on.
Technical Manual
14-31
Audit management
Technical Manual
14-32
Audit management
Security Value
Print 4
Clean 8
Maintain 16
Application defined 32
NOTE The audit_spec file must have read permission for all users and write permission
for the Administrator user only. Otherwise users other than Administrator can
change the security parameter in the file, which would allow them illegal access.
Technical Manual
14-33
Audit management
Technical Manual
14-34
15 OLE Automation
General
OLE Automation is an industry standard that applications use to expose their
OLE objects to development tools, macro languages, and other applications that
support OLE Automation. For example, a spreadsheet application can expose a
worksheet, chart, cell, or range of cells—all as different types of objects. A word
processor can expose objects such as application, document, paragraph, sentence,
or selection.
When an application supports OLE Automation, the objects it exposes can be
accessed by Visual Basic. You can use Visual Basic to manipulate these objects
by invoking methods on the object or by getting or setting the object’s properties.
For example, if you create an OLE Automation object named MyObj, you can
write the following code to manipulate the object:
Dim MyObj As Object ’declaration
Sub PrintWordDoc()
Set MyObj = CreateObject("Word.Basic") ’start MS Word
MyObj.FileNewDefault ’open a new file
MyObj.Bold 1
MyObj.Insert "Hello, world." ’insert new text
MyObj.FilePrint ’print current file
MyObj.FileSaveAs "C:\WORDPROCDOCS\TESTOBJ.DOC"
MyObj.AppClose ’close MS Word
Set MyObj = Nothing
Exit Sub
End Sub
This example runs Microsoft Word to create and print a document with the text,
“Hello, world.”
The application that exposes objects is called an OLE Automation server, the
application using those objects is called an OLE Automation client.
Technical Manual
15-1
OLE Automation
This starts BaanERP with the BW user interface invisibly, in other words only
the Option Dialog icon is displayed. OLE Automation objects, such as BaanObj,
can have methods and properties. A method is a function that can be started to
perform a certain action. A property is an attribute that has a value. Property
values can be set and/or retrieved.
The BaanERP application object has the following methods:
n ParseExecFunction “dllname”, “functioncall”
n Quit
The BaanERP application object has the following properties:
Technical Manual
15-2
OLE Automation
These methods and properties allow Visual Basic programmers to call any
function in any DLL. For example:
BaanObj.Timeout = 10 ’ 10 seconds timeout
BaanObj.ParseExecFunction "mydll", "myfunction(arg1, arg2)"
If BaanObj.Error <> 0 Then MsgBox("An error occurred")
MsgBox("The return value is " + BaanObj.ReturnValue)
This calls the function myfunction in the DLL named mydll. Note how
arguments are passed to myfunction. If arguments are passed by reference they
can be changed by the function call, therefore the property ReturnCall contains
the modified arguments after the call.
The property Timeout is used to prevent blocking on erroneous calls. The
property Error contains the return status of the ParseExecFunction call, and the
property ReturnValue is the actual return value of the DLL function. If the DLL
function returns a long value, it is converted to a string in ReturnValue.
To return binary data in ReturnCall arguments, the Binary property must be set to
true. ReturnCall can contain null characters.
Possible values for the property Error are:
n 0 success
n -1 unknown DLL name
n -2 unknown function name
n -3 syntax error in function call
n -10 timer expired
n -11fatal error in function
To end an automation session you can quit a BaanERP application as in this
example:
Set BaanObj = Nothing
Technical Manual
15-3
OLE Automation
Restrictions
When you use the OLE Automation interface, you must consider the following
restrictions:
n Due to the 3GL function parse_and_exec_function, you cannot supply
arrays as arguments to a DLL function.
n DLL functions with a variable number of arguments or optional arguments
are not supported.
n When a string is passed by reference, the result cannot become longer than
the input string. When a string must be filled make sure it is initialized with
the same number of spaces as the maximum length that can be returned. The
maximum length is defined in the domain of the variable.
n The maximum size of the FunctionCall string is 4KB (Bshell limit).
n The maximum size of the ReturnValue string is 4KB (Bshell limit).
n Two client applications cannot simultaneously use the same BW to make
DLL function calls.
Technical Manual
15-4
OLE Automation
switch.to.company(0)
sql_query = "select ttaad200.user from ttaad200"
sql_id = sql.parse(sql_query)
sql.exec(sql_id)
e = sql.fetch(sql_id)
if e = 0 then
user = ttaad200.user
else
user = ""
endif
return(user)
}
function extern string get_next_user()
{
string user(512)
e = sql.fetch(sql_id)
if e = 0 then
user = ttaad200.user
else
user = ""
endif
return(user)
}
Technical Manual
15-5
OLE Automation
Sub GetBaanERPUsers()
On Error GoTo CannotConnectToBaanERP
’ run BaanERP
Set BaanObject = CreateObject("Baan.Application")
Row = 1
Column = 1
While (user <> "")
’ fill the spreadsheet
Worksheets("Main Sheet").Cells(Row, Column)
= user
Row = Row + 1
If Row > 15 Then
Row = 1
Column = Column + 2
End If
’ get next user
BaanObject.ParseExecFunction "demodll"
"get_next_user()"
If (BaanObject.Error <> 0) Then GoTo
BaanAutomationError
Technical Manual
15-6
OLE Automation
user = BaanObject.ReturnValue
Wend
’ exit BaanERP
Set BaanObject = Nothing
Exit Sub
’ error handling
CannotConnectToBaanERP:
MsgBox "Unable to connect to BaanERP"
Exit Sub
BaanAutomationError:
MsgBox "A BaanERP automation error occurred"
Set BaanObject = Nothing
Exit Sub
End Sub
DLL information
The DLL ottdllsql_query contains:
n Functions to parse, execute, and stop a query:
− olesql_parse
− olesql_fetch
− olesql_break
− olesql_close
n Functions to import query results into Visual Basic:
− olesql_getstring
− olesql_getint
− etc
Technical Manual
15-7
OLE Automation
Technical Manual
15-8