DP 4 GL
DP 4 GL
DP 4 GL
TM
Progress® software products are copyrighted and all rights are reserved by Progress Software Corporation. This manual is also copyrighted and all rights are
reserved. This manual may not, in whole or in part, be copied, photocopied, translated, or reduced to any electronic medium or machine-readable form without
prior consent, in writing, from Progress Software Corporation.
The information in this manual is subject to change without notice, and Progress Software Corporation assumes no responsibility for any errors that may appear
in this document.
The references in this manual to specific platforms supported are subject to change.
Allegrix, A [Stylized], ObjectStore, Progress, Powered by Progress, Progress Fast Track, Progress Profiles, Partners in Progress, Partners en Progress, Progress en
Partners, Progress in Progress, P.I.P., Progress Results, ProVision, ProCare, ProtoSpeed, SmartBeans, SpeedScript, and WebSpeed are registered trademarks of
Progress Software Corporation or one of its subsidiaries or affiliates in the U.S. and/or other countries. AccelEvent, A Data Center of Your Very Own, Allegrix
& Design, AppsAlive, AppServer, ASPen, ASP-in-a-Box, BusinessEdge, Business Empowerment, Empowerment Center, eXcelon, Fathom, Future Proof,
IntelliStream, ObjectCache, OpenEdge, PeerDirect, POSSE, POSSENET, ProDataSet, Progress Business Empowerment, Progress Dynamics, Progress
Empowerment Center, Progress Empowerment Program, Progress for Partners, Progress OpenEdge, Progress Software Developers Network, PSE Pro, PS Select,
Real Time Event Engine, SectorAlliance, SmartBrowser, SmartComponent, SmartDataBrowser, SmartDataObjects, SmartDataView, SmartDialog, SmartFolder,
SmartFrame, SmartObjects, SmartPanel, SmartQuery, SmartViewer, SmartWindow, Technical Empowerment, Trading Accelerator, WebClient, and Who Makes
Progress are trademarks or service marks of Progress Software Corporation or one of its subsidiaries or affiliates in the U.S. and other countries.
SonicMQ is a registered trademark of Sonic Software Corporation in the U.S. and other countries.
Vermont Views is a registered trademark of Vermont Creative Software in the U.S. and other countries.
Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
Any other trademarks or service marks contained herein are the property of their respective owners.
OpenEdge includes Imaging Technology copyrighted by Snowbound Software 1993-2003. www.snowbound.com.
OpenEdge includes software developed by the Apache Software Foundation (http://www.apache.org/). Copyright © 1999 The Apache Software Foundation. All
rights reserved (Xerces C++ Parser (XML)) and Copyright © 2000-2003 The Apache Software Foundation. All rights reserved (Ant). The names “Apache,”
“Xerces,” “ANT,” and “Apache Software Foundation” must not be used to endorse or promote products derived from this software without prior written
permission. Products derived from this software may not be called “Apache”, nor may “Apache” appear in their name, without prior written permission of the
Apache Software Foundation. For written permission, please contact apache@apache.org. Software distributed on an “AS IS” basis, WITHOUT WARRANTY
OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License agreement that accompanies
the product.
OpenEdge includes software are copyrighted by DataDirect Technologies, 1991-2002.
OpenEdge includes software developed by Vermont Creative Software. Copyright © 1988-1991 by Vermont Creative Software.
OpenEdge includes software developed by IBM and others. Copyright © 1999, International Business Machines Corporation and others. All rights reserved.
OpenEdge includes code licensed from RSA Security, Inc. Some portions licensed from IBM are available at http://oss.software.ibm.com/icu4j/.
OpenEdge includes the UnixWare platform of Perl Runtime authored by Kiem-Phong Vo and David Korn. Copyright © 1991, 1996 by AT&T Labs. Permission
to use, copy, modify, and distribute this software for any purpose without fee is hereby granted, provided that this entire notice is included in all copies of any
software which is or includes a copy or modification of this software and in all copies of the supporting documentation for such software. THIS SOFTWARE IS
BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR AT&T LABS
MAKE ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS
FOR ANY PARTICULAR PURPOSE.
OpenEdge includes the RSA Data Security, Inc. MD5 Message-Digest Algorithm. Copyright ©1991-2, RSA Data Security, Inc. Created 1991. All rights reserved.
OpenEdge includes software developed by the World Wide Web Consortium. Copyright © 1994-2002 World Wide Web Consortium, (Massachusetts Institute of
Technology, European Research Consortium for Informatics and Mathematics, Keio University). All rights reserved. This work is distributed under the W3C®
Software License [http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231] in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
August 2004
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Preface–1
iv
Contents
v
Contents
8. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–1
Toolkit components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–2
vi
Contents
vii
Contents
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Index–1
viii
Contents
Tables
Table 3–1: Security permissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–4
Table 3–2: Access restrictions for tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–5
Table 4–1: DLL files for AS/400 communications . . . . . . . . . . . . . . . . . . . . . . . . . 4–12
Table 4–2: User-definable key bindings in Windows . . . . . . . . . . . . . . . . . . . . . . . 4–30
Table 4–3: Static key bindings in Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–32
Table 4–4: User-definable key bindings in Windows . . . . . . . . . . . . . . . . . . . . . . . 4–33
Table 4–5: Environment variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–36
Table 4–6: Windows-installed icons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–37
Table 4–7: Syntax for specifying string values . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–44
Table 4–8: Alphabetical listing of capability mnemonics . . . . . . . . . . . . . . . . . . . . 4–48
Table 4–9: Data types and operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–52
Table 4–10: Vermont Views key function mnemonics . . . . . . . . . . . . . . . . . . . . . . . 4–53
Table 4–11: Syntax for specifying cursor motion string value . . . . . . . . . . . . . . . . . 4–57
Table 4–12: OpenEdge PROTERMCAP key functions . . . . . . . . . . . . . . . . . . . . . . 4–59
Table 4–13: Setting the terminal type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–69
Table 4–14: Setting the PROTERMCAP environment variable . . . . . . . . . . . . . . . . 4–70
Table 4–15: Reverting to the default PROTERMCAP file . . . . . . . . . . . . . . . . . . . . 4–70
Table 5–1: Startup parameters for tuning the execution environment . . . . . . . . . . 5–5
Table 5–2: Startup parameters for tuning r-code libraries . . . . . . . . . . . . . . . . . . . 5–6
Table 5–3: Startup parameters for monitoring r-code activity . . . . . . . . . . . . . . . . 5–7
Table 5–4: Temporary client session files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–13
Table 5–5: Startup parameters for tuning sort performance . . . . . . . . . . . . . . . . . 5–15
Table 6–1: PROLIB utility parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–11
Table 6–2: List (-list) parameter library information . . . . . . . . . . . . . . . . . . . . . . . . 6–17
Table 6–3: List (-list) parameter file information . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–18
Table 7–1: Standard printer control sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–14
Table B–1: R-code segments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B–2
Table B–2: Metaschema fields in CRC calculation . . . . . . . . . . . . . . . . . . . . . . . . B–23
Table C–1: Input/output limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C–2
Table C–2: Sorting limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C–3
Table C–3: Name limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C–4
Table C–4: Compiler limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C–5
Table D–1: Toolkit utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D–3
ix
Contents
Figures
Figure 2–1: Connection denial when the user count is exceeded . . . . . . . . . . . . . . 2–15
Figure 4–1: Windows environment information search path . . . . . . . . . . . . . . . . . . 4–7
Figure 4–2: Sample Progress initialization file in Windows . . . . . . . . . . . . . . . . . . . 4–10
Figure 4–3: Sample buildenv script on UNIX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–40
Figure 4–4: Parts of a PROTERMCAP entry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–42
Figure 5–1: Sample statistics (-y) output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–8
Figure 5–2: Sample segment statistics (-yd) output . . . . . . . . . . . . . . . . . . . . . . . . . 5–10
Figure 6–1: Loading r-code from a file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–3
Figure 6–2: Loading r-code from a standard library . . . . . . . . . . . . . . . . . . . . . . . . . 6–4
Figure 6–3: Loading r-code from a memory-mapped library . . . . . . . . . . . . . . . . . . 6–5
Figure 7–1: Sample application startup procedure (UNIX) . . . . . . . . . . . . . . . . . . . . 7–11
Figure 7–2: Sample application startup procedure (NT) . . . . . . . . . . . . . . . . . . . . . 7–11
Figure 7–3: Sample output-routing table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–12
Figure 7–4: Sample printer-control table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–16
Figure 10–1: Deploying database structures and application procedures . . . . . . . . . 10–3
Figure 11–1: Deploying upgraded database structure and application procedures . . 11–3
Figure 12–1: Output of mkdump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12–13
Figure B–1: R-code file segment layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B–5
Figure B–2: Standard r-code execution environment . . . . . . . . . . . . . . . . . . . . . . . . B–9
Figure B–3: Memory-mapped r-code execution environment . . . . . . . . . . . . . . . . . . B–13
Figure B–4: Progress 4GL client startup options for –yd . . . . . . . . . . . . . . . . . . . . . B–16
Figure B–5: Execution buffer map for –yd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B–16
Figure B–6: Accessing the session sort file for –yd . . . . . . . . . . . . . . . . . . . . . . . . . B–17
Figure B–7: Procedure segment information for –yd (Part 1) . . . . . . . . . . . . . . . . . . B–18
Figure B–8: Procedure segment information for –yd (Part 2) . . . . . . . . . . . . . . . . . . B–19
Figure D–1: Database Restriction Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D–5
x
Preface
This Preface contains the following sections:
• Purpose
• Audience
• Organization
• Typographical conventions
• Example procedures
• OpenEdge messages
OpenEdge Deployment: Managing 4GL Applications
Purpose
This book describes the Progress® 4GL client application deployment process and application
administration concepts and procedures. It includes the steps required to deploy Progress 4GL
applications and a description of the tradeoffs between different deployment scenarios. It also
describes components provided with the Developer’s Toolkit that help you through the
deployment process.
Audience
This book is intended for OpenEdge™ application administrators and experienced Progress
programmers preparing applications for wider distribution or resale.
Organization
Part I, 4GL and R-code Deployment and Management
Presents an overview of the client deployment process, and outlines the deployment and
administration tasks you must perform.
Describes how to connect and disconnect databases for Progress 4GL clients.
Describes how to monitor and tune Progress 4GL client application performance.
Preface–2
Preface
Describes Progress 4GL r-code libraries and how to use the PROLIB utility.
Chapter 8, “Introduction”
Describes the different types of code formats you can choose to deploy a Progress 4GL
application.
Describes the initial deployment process using the different code formats.
Describes how to perform several tasks related to deploying Progress 4GL applications.
Describes the process and requirements for building customized OpenEdge executables.
It also provides instructions for using the Make utility in Windows and on UNIX.
Describes the structure and management of Progress r-code, the executable code into
which OpenEdge compiles 4GL procedures. It also describes techniques for tuning r-code
size and performance, and the use of time stamps and cyclic redundancy checks (CRCs)
to maintain r-code and database integrity.
Preface–3
OpenEdge Deployment: Managing 4GL Applications
Describes the OpenEdge limits you must consider when developing an OpenEdge client
application.
Provides reference information about utilities and scripts provided by the Developer’s
Toolkit.
Typographical conventions
This manual uses the following typographical conventions:
Convention Description
SMALL, BOLD Small, bold capital letters indicate OpenEdge™ key functions and
CAPITAL LETTERS generic keyboard keys; for example, GET and CTRL.
KEY1 KEY2 A space between key names indicates a sequential key sequence:
you press and release the first key, then press another key. For
example, ESCAPE H.
Syntax:
Preface–4
Preface
Convention Description
Period (.) All statements except DO, FOR, FUNCTION, PROCEDURE, and REPEAT
or end with a period. DO, FOR, FUNCTION, PROCEDURE, and REPEAT
colon (:) statements can end with either a period or a colon.
{} Large braces indicate the items within them are required. They are
used to simplify complex syntax diagrams.
{} Small braces are part of the Progress 4GL language. For example,
a called external procedure must use braces when referencing
arguments passed by a calling procedure.
... Ellipses indicate repetition: you can choose one or more of the
preceding items.
Preface–5
OpenEdge Deployment: Managing 4GL Applications
Syntax
FOR is one of the statements that can end with either a period or a colon, as in this example:
Syntax
In this example, the outer (small) brackets are part of the language, and the inner (large) brackets
denote an optional item:
Syntax
A called external procedure must use braces when referencing compile-time arguments passed
by a calling procedure, as shown in this example:
Syntax
{ &argument-name }
In this example, EACH, FIRST, and LAST are optional, but you can choose only one of them:
Syntax
Preface–6
Preface
In this example, you must include two expressions, and optionally you can include more.
Multiple expressions are separated by commas:
Syntax
In this example, you must specify MESSAGE and at least one expression or SKIP [ (n) ], and
any number of additional expression or SKIP [ ( n ) ] is allowed:
Syntax
In this example, you must specify {include-file, then optionally any number of argument or
&argument-name = "argument-value", and then terminate with }:
Syntax
{ include-file
[ argument | &argument-name = "argument-value" ] ... }
Syntax
Preface–7
OpenEdge Deployment: Managing 4GL Applications
In this example, ASSIGN requires either one or more field entries or one record. Options
available with field or record are grouped with braces and brackets:
Syntax
Example procedures
This manual provides numerous example procedures that illustrate syntax and concepts.
Examples use the following conventions:
• If a procedure is available online, its name appears above the box and starts with a prefix
associated with the manual that references it:
If the name does not start with a listed prefix, the procedure is not available online.
• If a procedure is not available online, it compiles as shown but might not execute for lack
of completeness.
Preface–8
Preface
You must create all subdirectories required by a library before trying to extract files from the
library. You can see what directories and subdirectories a library needs by using the PROLIB
-list command to view the contents of the library. See OpenEdge Deployment: Managing 4GL
Applications for more details on the PROLIB utility.
1. From the Control Panel or the Progress Program Group, double-click the Proenv icon.
Running Proenv sets the DLC environment variable to the directory where you installed
OpenEdge (by default, C:\Program Files\Progress). Proenv also adds the DLC
environment variable to your PATH environment variable and adds the bin directory
(PATH=%DLC%;%DLC%\bin;%PATH%).
3. At the proenv prompt, enter the following command to create the prodoc.txt text file,
which contains the file listing for the prodoc.pl library:
Preface–9
OpenEdge Deployment: Managing 4GL Applications
Extracting source files from a procedure library involves running PROENV to set up your
OpenEdge environment, creating the directory structure for the files you want to extract, and
running PROLIB.
1. From the Control Panel or the Progress Program Group, double-click the Proenv icon.
3. At the proenv prompt, enter the following command to create the prodoc directory in your
OpenEdge working directory (by default, C:\OpenEdge\Wrk):
MKDIR prodoc
MKDIR prodoc\langref
5. To extract all examples in a procedure library directory, run the PROLIB utility. Note you
must use double quotes because “Program Files” contains an embedded space:
To extract one example, run PROLIB and specify the file that you want to extract as it is
stored in the procedure library:
Preface–10
Preface
This section describes how to extract source files from procedure libraries on UNIX platforms.
install-dir/dlc/bin/proenv
Running proenv sets the DLC environment variable to the directory where you installed
OpenEdge (by default, /usr/dlc). The proenv utility also adds the bin directory under the
DLC environment variable to your PATH environment variable (PATH=$DLC/bin:$PATH).
2. At the proenv prompt, create the prodoc directory in your OpenEdge working directory:
mkdir prodoc
mkdir prodoc/handbook
4. To extract all examples in a procedure library directory, run the PROLIB utility:
To extract one source file (i-ddeex1.p) from a procedure library (prodoc.pl), run PROLIB
and specify the file you want to extract as it is stored in the procedure library:
Preface–11
OpenEdge Deployment: Managing 4GL Applications
OpenEdge messages
OpenEdge displays several types of messages to inform you of routine and unusual occurrences:
• Compile messages inform you of errors found while OpenEdge is reading and analyzing
a procedure before running it; for example, if a procedure references a table name that is
not defined in the database.
• Startup messages inform you of unusual conditions detected while OpenEdge is getting
ready to execute; for example, if you entered an invalid startup parameter.
• Continues execution, subject to the error-processing actions that you specify or that are
assumed as part of the procedure. This is the most common action taken after execution
messages.
• Returns to the Progress Procedure Editor, so you can correct an error in a procedure. This
is the usual action taken after compiler messages.
• Halts processing of a procedure and returns immediately to the Progress Procedure Editor.
This does not happen often.
OpenEdge messages end with a message number in parentheses. In this example, the message
number is 200:
If you encounter an error that terminates OpenEdge, note the message number before restarting.
Preface–12
Preface
On Windows platforms, use OpenEdge online help to obtain more information about OpenEdge
messages. Many OpenEdge tools include the following Help menu options to provide
information about messages:
• Choose Help→Messages and then enter the message number to display a description of
a specific OpenEdge message.
On UNIX platforms, use the Progress pro command to start a single-user mode character
OpenEdge client session and view a brief description of a message by providing its number.
install-dir/dlc/bin/pro
3. Type the message number and press ENTER. Details about that message number appear.
4. Press F4 to close the message, press F3 to access the Progress Procedure Editor menu, and
choose File→ Exit.
Preface–13
OpenEdge Deployment: Managing 4GL Applications
Preface–14
Part I
4GL and R-code Deployment and
Management
This chapter presents an overview of the client deployment process, and outlines the
deployment and administration tasks you must perform, in the following sections:
• Planning — The phase in which you identify your deployment requirements and define
your deployment strategy.
• Development — The phase in which you design, develop, and debug your client
application.
• Installation and Configuration — The phase in which you deliver your client application
to end-users, and set up the end-user environment.
Each phase of the client deployment process has its own set of requirements and dependencies
that you must consider when defining your client deployment strategy. Decisions made in an
earlier phase will affect the following phases and the process as a whole.
Progress Software Corporation provides you with the following services to help you identify
your client deployment options and accomplish the client deployment process for your
application:
• The Progress Software Consulting Services organization which can assist you in all phases
of the client deployment process.
• The Progress Technical Services staff which can answer your questions about the ADE
tools, 4GL usage, and database administration.
1–2
Progress 4GL Client Deployment Overview
The remaining chapters in this guide provide detailed information about each of these tasks, as
well as the procedures and utilities you use to accomplish them. The appendixes provide useful
information about building OpenEdge executables and OpenEdge application limits.
Note: Certain deployment and administration tasks will differ among operating systems.
For information about designing and coding a Progress 4GL client application, see OpenEdge
Development: Progress 4GL Handbook.
For information about creating and maintaining an OpenEdge RDBMS, see OpenEdge Data
Management: Database Administration.
For information about AppServer deployment and administration tasks, see OpenEdge
Application Server: Developing AppServer Applications.
1–3
OpenEdge Deployment: Managing 4GL Applications
1–4
2
Managing Client Access to Databases
This chapter describes how to connect and disconnect databases for Progress 4GL clients and
provides information about the following topics:
Note: On UNIX, the kernel configuration’s file descriptor limit imposes a practical limit on
connected databases. “Unable to open file” or “Unable to allocate I-Node” messages
often mean your system’s file descriptors have been exhausted. “Unable to allocate
shared memory” often means your shared memory has been exhausted on your system.
For more information about kernel configurations, see OpenEdge Getting Started:
Installation and Configuration for UNIX.
• Connection modes
• Connection parameters
• Connection techniques
2–2
Managing Client Access to Databases
A database has a logical name whenever it is connected. When you connect to a database,
OpenEdge automatically assigns a default logical name for the current session. The default
logical name consists of the physical database name without the .db suffix. For example, if you
connect to a database with the physical name mydb1.db, the default logical database name is
mydb1. Alternatively, you can use the Logical Database Name (-ld) startup parameter to specify
a logical database name other than the default.
For example, to assign the logical name firstdb to the physical database mydb1.db using the
PRO command, enter the command using the following syntax:
Logical database names allow you to run procedures on different physical databases without
recompiling. To run a compiled procedure on a second physical database, the database must
meet the following criteria:
• It must have the identical structure (data definitions) and table time stamps as the database
you compiled the procedure against. However, if you use CRC-based object code (the
default), the database’s table time stamps do not affect the ability of the code to run on the
database. The structure of the database must be the same. For more information about
CRC-based object code, see Appendix B, “R-code Features and Functions.”
• It must be connected with the same logical name as the database you compiled the
procedure against.
A database connection fails if the logical database name of the database that you are connecting
has the same logical name as an already connected database. If you try to connect a database
with a logical database name that matches the logical database name of an existing connected
database of the same database type (OpenEdge RDBMS, ORACLE, etc.), OpenEdge assumes
that database is connected and ignores the request.
2–3
OpenEdge Deployment: Managing 4GL Applications
You can change a database’s logical name in a Progress 4GL procedure with the CREATE ALIAS
statement. For more information about logical and physical database names and aliases, and the
CREATE ALIAS statement, see OpenEdge Development: Progress 4GL Reference and OpenEdge
Development: Programming Interfaces.
Connection modes
A database is connected in one of three connection modes:
• Single-user — Only the current Progress 4GL session can access the specified database.
If the database is already in use by another user, you cannot connect to the database from
the current Progress 4GL session.
• Multi-user client — The current Progress 4GL session accesses the database through a
server process. Multi-user client is the default connection mode on non-shared-memory
systems and when you use the Host Name (-H) and Service Name (-S) parameters on
shared-memory systems. All remote (over a network) connections access the database
through a database server and are in multi-user client mode.
• Multi-user direct access — The current Progress 4GL session accesses the database
directly using shared memory. A process connected in multi-user direct-access mode is a
self-service client. Direct access is available only on shared-memory systems and is the
default connection mode on these systems. For information about shared-memory
configurations, see OpenEdge Getting Started: Installation and Configuration for
Windows or OpenEdge Getting Started: Installation and Configuration for UNIX.
When you connect to a database with a OpenEdge multi-user startup command, each database
you specify on the command line is connected in the default multi-user mode. Each database
you specify in a startup file or in a CONNECT statement in an application is also connected in the
default multi-user mode for the current machine.
The first database specified after the OpenEdge single-user or OpenEdge single-user batch
command is connected in single-user mode by default. Any additional databases specified with
the Database Name (-db) connection parameter are connected in the default multi-user mode for
the system. Use the Single-user Mode (-1) startup parameter to override the default multi-user
connection mode for a database and connect to the database in single-user mode.
For more information about the Host Name (-H), Service Name (-S), Database Name (-db), and
Single-user Mode (-1) startup parameters, see OpenEdge Deployment: Startup Command and
Parameter Reference.
2–4
Managing Client Access to Databases
Connection parameters
Connection parameters control how you connect to databases. They are a subset of the
OpenEdge startup parameters. All of the database connection techniques provide a way for you
to specify connection parameters.
You can use a parameter file to specify connection parameters with any of the connection
techniques. A parameter file is an operating system file that contains one or more startup
parameters. A parameter file has a .pf extension. Use the Parameter File (-pf) startup
parameter to invoke a parameter file.
Parameter files are an important factor in developing database connection strategies for
multi-database applications. For example, you can use parameter files to maintain the startup
parameters for a particular database, group of users, or system configuration.
For more information about startup parameters and parameter files, see OpenEdge Deployment:
Startup Command and Parameter Reference.
Connection techniques
There are five ways to connect a database:
• With the CONNECT statement (in the Progress Procedure Editor or in a 4GL procedure).
Note: Starting a server or broker for a database is distinct from connecting to a database. You
must start a server or broker for a database before you can connect to the database in
multi-user mode. For information about starting a server or broker, see OpenEdge
Getting Started: Installation and Configuration for Windows or OpenEdge Getting
Started: Installation and Configuration for UNIX.
This section explains how to connect to databases using the various techniques. OpenEdge
Development: Programming Interfaces explains why you might choose one technique instead
of another.
2–5
OpenEdge Deployment: Managing 4GL Applications
Connecting at startup
You can connect to databases at session startup with one of the OpenEdge startup commands or
with an application startup file. For example, the following PRO command starts a single-user
session and connects to three databases:
Note: To retain compatibility with earlier versions, OpenEdge does not require you to specify
the Database Name (-db) connection parameter for the first database on the command
line.
If you specify more than one database when you start a session, it is important to specify the
connection parameters for each database directly after the database name to which they apply,
and before the next Database Name (-db) connection parameter. OpenEdge applies database
connection parameters only to the previously specified database.
The following syntax example illustrates the correct location for database connection
parameters:
You can specify all other parameters anywhere on the command line. If you specify the same
parameter more than once, OpenEdge uses the value you specified for the last instance of the
parameter.
You can also use a parameter file to specify database connection parameters. The following
example shows a UNIX startup script for a client application. The last line invokes the _progres
executable:
2–6
Managing Client Access to Databases
The previous startup script sets up environment variables for an application and starts a Progress
4GL client application session using two parameter files called parm1.pf and parm2.pf. The
parm1.pf parameter file contains the following entry:
This example illustrates a common approach to connecting multiple databases when you start
OpenEdge using a parameter file for each database. Each parameter file is specified on the
command line with the Parameter File (-pf) startup parameter.
The CONNECT statement allows you to connect to a database from a 4GL procedure or from the
Progress Procedure Editor.
The following CONNECT statements connect the appldb1 database in single-user mode, the
appldb2 database in multi-user mode, and the databases specified in the parameter file,
parm3.pf (respectively):
Connecting with the CONNECT statement is very similar to connecting at startup. Although it is
possible to connect to several databases within one CONNECT statement, it is a good idea to
connect only one database per CONNECT statement. A connection failure for one database causes
a termination of the current CONNECT statement, leaving any subsequent database specified with
the CONNECT statement unconnected. For detailed information about the CONNECT statement, see
OpenEdge Development: Progress 4GL Reference and OpenEdge Development: Programming
Interfaces.
2–7
OpenEdge Deployment: Managing 4GL Applications
You can connect to a database during a Progress 4GL session using the graphical user interface
of the Data Dictionary.
1. Open the Data Dictionary. The Data Dictionary main window appears:
2–8
Managing Client Access to Databases
3. Choose the Options button. The Connect Database dialog box expands to show optional
connection controls:
• Logical Name — Specifies the database name that references a connected physical
database.
• Database Type — Specifies the database type. The only possible value is
PROGRESS.
• Network — Specifies the network type, if you are connecting to a network server.
The only possible value is TCP.
• Multiple Users — Specifies whether you want multiple users to be able to access
this database simultaneously.
2–9
OpenEdge Deployment: Managing 4GL Applications
• Parameter File — Specifies the parameter filename that contains the startup
parameters for the database.
OpenEdge returns you to the Data Dictionary main window. The Data Dictionary
constructs (and executes) a CONNECT statement using the information you supply.
Therefore, any rules that apply to the CONNECT statement also apply to database
connections using the Data Dictionary.
You can also connect to a database during a Progress 4GL session using the Data
Administration tool.
1. Open the Data Administration tool. The Data Administration main window appears:
2–10
Managing Client Access to Databases
3. Choose the Options button. The Connect Database dialog box expands to show optional
connection controls:
• Logical Name — Specifies the database name that references a connected physical
database.
• Database Type — Specifies the database type. The only possible value is
PROGRESS.
• Network — Specifies the network type, if you are connecting to a network server.
The only possible value is TCP.
• Multiple Users — Specifies whether you want multiple users to be able to access
this database simultaneously.
2–11
OpenEdge Deployment: Managing 4GL Applications
• Parameter File — Specifies the parameter filename that contains the startup
parameters for the database.
OpenEdge returns you to the Data Administration main window. The Data Administration
tool constructs (and executes) a CONNECT statement using the information you supply.
Therefore, any rules that apply to the CONNECT statement also apply to database
connections using the Data Administration tool.
Use the Data Administration tool to build an auto-connect list for a primary database.
2–12
Managing Client Access to Databases
If you connect to a database with the CONNECT statement, and that database also has an
auto-connect entry in an already connected database, the connection information from both the
CONNECT statement and the auto-connect list is merged. In this situation, the connection
information in the CONNECT statement takes precedence. For more information about the
CONNECT statement, see OpenEdge Development: Progress 4GL Reference.
If the primary database is a schema holder for a DataServer schema, the DataServer schema is
automatically included in the auto-connect list, but it does not appear on the auto-connect list as
viewed from the Data Dictionary.
2–13
OpenEdge Deployment: Managing 4GL Applications
1. Create an OpenEdge RDBMS. This database stores the target database’s structure as an
OpenEdge schema; it is a schema holder. A schema that corresponds to a non-OpenEdge
database is a DataServer schema.
3. Use the appropriate Create Schema parameter from the Data Dictionary’s database menu
to create the DataServer schema in the schema holder. This parameter:
• Creates a _Db table record (auto-connect entry) for the non-OpenEdge database in
the schema holder database.
• Displays the menu so that you can choose the tables that you want to include in the
OpenEdge schema.
For complete information about connecting and using non-OpenEdge databases, see the
OpenEdge DataServer guides (OpenEdge Data Management: DataServer for ODBC or
OpenEdge Data Management: DataServer for ORACLE).
2–14
Managing Client Access to Databases
Figure 2–1 shows a connection denial when a connection request exceeds the maximum number
of users. In this example, the Number of Users (-n) startup parameter allows a maximum of
three user connections. When the fourth user attempts to connect, OpenEdge denies the
connection.
User1
User2
Database server Database (with
-n = 3)
User3
User4 connection
User4
request denied
When OpenEdge denies a user connection because the maximum number of users is exceeded,
you must terminate an existing connection before the user can establish a new connection.
You can use database usage reporting features to track user connections to databases. For
information about database usage reporting features, see OpenEdge Data Management:
Database Administration and either OpenEdge Getting Started: Installation and Configuration
for Windows or OpenEdge Getting Started: Installation and Configuration for UNIX.
For more information about the Number of Users (-n) startup parameter, see OpenEdge
Deployment: Startup Command and Parameter Reference.
For information about coding applications to handle connection denials, see OpenEdge
Development: Programming Interfaces.
2–15
OpenEdge Deployment: Managing 4GL Applications
• During connection, the client reads all the _Db and _File records.
• When the database is referenced, the client reads all the _Index, _Index-field, _File-trig,
and _Field-trig records.
The time required to read the schema is usually minimal. However, the time required to read the
schema might be unacceptable under the following conditions:
• When a large number of clients connect to a database simultaneously. For example, after
a database shutdown or crash.
To reduce the amount of time required to connect, OpenEdge lets you store the schema cache
as a binary file, called a schema cache file, on a local disk. The client can then read the schema
directly from the schema cache file.
To create the schema cache file, you build the desired schema cache and save it to a binary file
using the Progress statement SAVE CACHE. The schema cache file is portable across systems, so
you can create the file once and distribute it across a heterogeneous network of systems. For
information about building and saving the schema cache file, see OpenEdge Development:
Programming Interfaces. For information about the SAVE CACHE statement, see OpenEdge
Development: Progress 4GL Reference.
To connect using the local schema cache file, specify the Schema Cache File (-cache) startup
parameter when you connect to a database. If the schema cache file is valid, OpenEdge reads
the schema from the local file instead of from the database. The schema cache is valid if the time
stamp of the schema cache file matches the time stamp in the database master block. If the time
stamps do not match, or for some reason OpenEdge cannot read the file, OpenEdge issues a
warning message and reads the schema from the database. For information about the Schema
Cache File (-cache) startup parameter, see OpenEdge Deployment: Startup Command and
Parameter Reference.
2–16
Managing Client Access to Databases
To select a working database with the Data Dictionary when using a graphical interface:
1. Access the Data Dictionary. The Data Dictionary displays the connected databases and
their tables and fields.
To select a working database with the Data Dictionary when using a character interface:
3. Select the new working database, then choose Enter to return to the Data Dictionary
main window.
2–17
OpenEdge Deployment: Managing 4GL Applications
3. Select the new working database, then choose OK to return to the Data Administration
main window.
Note: When you have more than one database connected and you disconnect the working
database, OpenEdge automatically switches to the next connected database on the list.
2–18
Managing Client Access to Databases
To disconnect a database with the Data Dictionary when using a graphical interface:
1. Access the Data Dictionary. The Data Dictionary displays the connected databases and
their tables and fields.
2. Select the database you want to disconnect from the database selection list.
3. Choose Database→Disconnect.
To disconnect a database with the Data Dictionary when using a character interface:
2–19
OpenEdge Deployment: Managing 4GL Applications
2–20
3
Maintaining Application Security
OpenEdge provides two types of security: application security which prevents unauthorized
users from running application procedures or accessing data in a database, and database file
security which prevents unauthorized users from modifying or removing database files.
OpenEdge provides four levels of security: compile-time security ensures that only authorized
users can compile procedures that perform specific data accesses, run-time security ensures that
only authorized users can run specific precompiled procedures, connection security ensures that
only authorized users can connect to the database, and schema security ensures that only
authorized users can modify table, field, and index definitions.
OpenEdge also relies on security mechanisms at the operating system level to ensure that only
authorized users access r-code procedure files, procedure library files, and database files. This
chapter contains the following sections:
• Compile-time security
• Run-time security
For information about establishing and maintaining connection security, schema security, and
database file security, see OpenEdge Data Management: Database Administration. In addition
to the security features described in this chapter, OpenEdge supports secure connections
between OpenEdge client and server components on the network using the Secure Sockets
Layer (SSL). For more information, see OpenEdge Getting Started: Security.
OpenEdge Deployment: Managing 4GL Applications
Compile-time security
Compile-time security checking is built into OpenEdge. You define compile-time security for
an application database at the table and field levels to prevent the user from writing their own
procedures to access data in the database.
OpenEdge lets you define the type of access rights or permissions different users can have to
the tables and fields in your database applications. OpenEdge checks these permissions when
the user runs and compiles a procedure for the first time during a OpenEdge session. However,
permissions are not checked when the user runs procedures that are precompiled. For
information about how to enable security for precompiled procedures, see the “Run-time
security” section on page 3–8.
If you use CRC-based r-code (the default), the user can compile a procedure against a database
that has the same schema as the database (a counterfeit database) and then run the procedure
against the database. Since OpenEdge does not check the permissions of the database at compile
time, you have no compile-time security. However, you can use the PROUTIL utility’s
DBAUTHKEY qualifier to set an authorization key for the database. The authorization key
prevents unwanted r-code from being run against the database.
For more information about CRC-based object code, see Appendix B, “R-code Features and
Functions,” For more information about the PROUTIL utility, see OpenEdge Data
Management: Database Administration.
For information about designating a security administrator, see the “Designating a security
administrator” section on page 3–9.
3–2
Maintaining Application Security
1. Access the Data Administration tool if you are using a graphical interface or the Data
Dictionary if you are using a character interface.
If you are using a graphical interface, the Edit Data Security dialog box appears:
3–3
OpenEdge Deployment: Managing 4GL Applications
If you are using a character interface, OpenEdge alphabetically lists the tables defined for
the working database. Choose the table for which you want to specify permissions. The
Edit Data Security dialog box appears:
3. Choose the table or field for which you want to specify permissions.
If you are using a graphical interface, use the Permissions for Selected Table and
Permissions for Selected Field radio buttons, then choose the table or field from the
selection lists.
If you are using a character interface, use the options at the bottom of the dialog box to
choose the table or field.
4. Specify the security permissions for the table or field. Table 3–1 lists the security
permissions you can specify for a table or field.
Permission Description
Can-Write Specifies the users who can write to a table or update records.
Can-Create Specifies the users who can create new records. The user with
Can-Create privileges automatically has Can-Write privileges.
Can-Delete Specifies the users who can delete records from a table.
3–4
Maintaining Application Security
Permission Description
Can-Dump Specifies the users who can dump database or table definitions and
data.
Can-Load Specifies the users who can load database or table definitions and
data.
Note: Use commas, not periods, to separate the names in these options.
Table 3–2 lists the values you use to define the permissions for a table.
Expression Meaning
string* User IDs that begin with this string have access.
Any changes you make to the table permissions do not affect the current session or any
other current sessions. This means that if other users are working while you change table
permissions, they are not affected. To use the new permissions, you must exit and restart
OpenEdge.
Note: Do not try to bypass the Data Dictionary to modify the permissions for the tables
and fields in the database. You might lock yourself out of the database.
3–5
OpenEdge Deployment: Managing 4GL Applications
This example shows how to define permissions for a sample database called mywork. Suppose
the user IDs defined in the user list for the database are salesrep, inventory, and manager. Users
using the IDs are as follows:
Suppose you want all users to have Can-Read permission for the customer table, but only users
with the specified user IDs to have Can-Write, Can-Create, and Can-Delete privileges. The
following example shows how to specify this information for the customer table:
Can-Read: *
Can-Write: salesrep,manager
Can-Create: salesrep,manager
Can-Delete: manager
In the next example for the customer table, all users have Can-Read permission for the Name
field. In addition, all users have Can-Write permission, except users with the user ID of
inventory:
Can-Read: *
Can-Write: *,!inventory
In the next example for the customer table, all users, except those with a user ID of inventory,
have Can-Read permission for the Max-credit field. Here, only managers have permission to
write to this field:
Can-Read: *,!inventory
Can-Write: manager
3–6
Maintaining Application Security
The user can use OpenEdge or an OpenEdge application with a blank user ID and access tables
and fields in the database as long as the table- and field-level permissions permit it (blank user
ID), and the procedures being run are precompiled. OpenEdge expects an application to run a
login program to set the user ID to a more meaningful value.
As the security administrator, you might want to deny privileges to the blank user ID to ensure
that unknown users do not gain access to the database.
1. Access the Data Administration tool if you are using a graphical interface or the Data
Dictionary if you are using a character interface.
3. Choose Yes. OpenEdge denies the user all security permissions and inserts an exclamation
point (!) at the beginning of all the table and field permissions for the database. You can
restore a blank user ID’s access to selected tables and fields by modifying the permissions.
3–7
OpenEdge Deployment: Managing 4GL Applications
Run-time security
The application developer can provide run-time security to prevent unauthorized users from
running precompiled procedures. To establish run-time security, the developer must set up a
permissions table within the database.
The permissions table contains records that specify users who are authorized to run specific
procedures. Each record in the permissions table must contain at least two fields: an Activity
field and a Can-Run field. The Activity field contains the name of the procedure and the
Can-Run field contains the user IDs of those who have permission to run the procedure. Within
the application, the developer uses the CAN-DO and USERID functions to test whether the current
user can run a specific procedure.
As security administrator, you must maintain the permissions table. It is the developer’s
responsibility to provide the tools to maintain this table.
For more information about run-time security and maintaining the permissions table, see
OpenEdge Development: Programming Interfaces.
On UNIX, you can use operating system file security to protect your procedure files in addition
to, or instead of, including security checking in the application procedures. For example, if you
want to be the only user allowed access to p-adcust.p, you should create the source and r-code
files with your user ID, then change the permissions for the files. To change the permissions for
p-adcust.p, enter one of the following UNIX commands:
These permissions indicate that you are the only user allowed to read from (R) and (W) write to
p-adcust.p. No other users are allowed any kind of access to that procedure.
For more information about using the operating system to protect database files, see OpenEdge
Data Management: Database Administration. For more information about setting operating
system permissions, see your operating system documentation.
3–8
Maintaining Application Security
If you establish a list of valid user IDs, you must designate one user, or preferably more than
one user, as security administrator. The security administrator is responsible for maintaining the
security information in the database. Typically, the database administrator also serves as
security administrator. The security administrator uses:
3–9
OpenEdge Deployment: Managing 4GL Applications
3–10
4
Maintaining User Environments
This chapter explains how to maintain user interface environments in Windows and on UNIX,
as described in the following sections:
When you install OpenEdge, the installation program automatically updates the Registry with
the information in the progress.ini file that is shipped to you. Progress Software recommends
that you maintain environment variables in both the progress.ini file and the Registry. If you
modify environment variables in the progress.ini file, you must update the information in the
Registry.
Although there are several methods for adding and deleting information from the Registry
directly, Progress Software recommends that you do not use these direct update methods.
Instead, maintain the Registry information by editing the progress.ini file and using the
INI2REG utility to update the Registry. This approach synchronizes the information in the
progress.ini file and the Registry without causing unintended edits to the Registry.
For more information about modifying the progress.ini file, see the “Maintaining the
progress.ini file” section on page 4–9.
4–2
Maintaining User Environments
ini2reg
2. From the INI File to Registry Translation dialog box, choose the Browse button or
File→Open. The Open dialog box appears.
3. Type in or browse for the initialization file you want to translate, and choose OK. The
name of the selected file appears in the .INI file to translate field.
4. From the Registry base key drop-down list, select the base key under which you want to
create the subkey entries. The default subkey that corresponds to the selected initialization
file and base key appears in the Registry subkey field.
If you want to use a subkey other than the default, type the subkey name in the Registry
subkey field.
4–3
OpenEdge Deployment: Managing 4GL Applications
5. To begin the translation, choose the Translate button or File→Translate. For each entry
in the initialization file, INI2REG creates a Registry key entry with the same value. As
each entry is translated, it appears in the Values being translated display area. If a Registry
key entry already exists, INI2REG prompts you to overwrite it.
To access the INI2REG utility and translate an initialization file from the command line, specify
the INI2REG command using the following syntax:
-a
Automates the translation. That is, it processes the translation automatically without
presenting the graphical user interface.
-ao
-i ini-file-name
-b base-key
The base key under which the subkey is created. The value of base-key must be one of
following:
• HKEY_CURRENT_USER (default).
• HKEY_USERS.
• HKEY_LOCAL_MACHINE.
• HKEY_CLASSES_ROOT.
• HKEY_CURRENT_CONFIG.
• HKEY_DYN_DATA.
4–4
Maintaining User Environments
-s subkey
The subkey under which entries are created. The subkey is created under the base key
specified in the -b parameter.
-d default-subkey
The default subkey under which entries are created. The default subkey is created under
the base key specified in the -b parameter.
base-key\[SOFTWARE]\default-subkey\[rootname]
By default, the INI2REG utility creates Registry key entries at the following location:
HKEY_CURRENT_USER\SOFTWARE\PSC\PROGRESS\version
4–5
OpenEdge Deployment: Managing 4GL Applications
Note: The -basekey and -ininame parameters can only be used on the command line. You
cannot use them within a parameter file.
Figure 4–1 illustrates the path that OpenEdge follows when searching for environment
information in Windows.
4–6
Maintaining User Environments
-ininame =
progress.ini, or no Registry yes
basekey specified? -basekey =
-ininame “INI”?
unspecified? (-basekey)
yes no
yes no
OpenEdge searches:
1. HKEY_CURRENT_USER\<path>
<
\ root name>.<extension> -ininame
2. HKEY_CURRENT_USER\SOFTWARE no specified?
\PSC\PROGRESS\<version>\<path>
<
\ root name>.<extension> OpenEdge searches
3. HKEY_CURRENT_USER\SOFTWARE for progress.ini file yes
<
\ path>\<root name>.<extension>
4. HKEY_CURRENT_USER\<root name>
5. HKEY_CURRENT_USER\SOFTWARE
\PSC\PROGRESS\<version>\<root name> yes
6. HKEY_CURRENT_USER\SOFTWARE -ininame =
<
\ root name> progress.ini?
7. HKEY_LOCAL_MACHINE\<path> OpenEdge searches
<
\ root name>.<extension> for the specified .ini file,
8. HKEY_LOCAL_MACHINE\SOFTWARE
in this order: no
\PSC\PROGRESS\<version>\<path>
<
\ root name>.<extension> 1. Current directory
9. HKEY_LOCAL_MACHINE\SOFTWARE 2. Windows directory
<
\ path>\<root name>.<extension> 3. Progress directory
10. HKEY_LOCAL_MACHINE\<root name> 4. PROPATH
11. HKEY_LOCAL_MACHINE\SOFTWARE -ininame
\PSC\PROGRESS\<version>\<root name> no specified?
12. HKEY_LOCAL_MACHINE\SOFTWARE
<
\ root name> OpenEdge searches in
13. File named the Registry only for
“<path>\<root name>.<extension>” yes
<basekey>\SOFTWARE
\PSC\PROGRESS\<ver>
OpenEdge searches:
yes
1. HKEY_CURRENT_USER\SOFTWARE -ininame =
\PSC\PROGRESS\<version> progress.ini?
2. HKEY_LOCAL_MACHINE OpenEdge searches
\SOFTWARE\PSC\PROGRESS\<version> in the Registry only for
3. File named progress.ini <basekey>\<ininame> no
4–7
OpenEdge Deployment: Managing 4GL Applications
When OpenEdge does not find environment information in the Registry, or when it was started
with the -basekey INI startup parameter, it searches through directories for a progress.ini file
in the following order:
1. The current working directory (as defined in the Working Directory field in the Program
Item properties sheet for Windows).
After OpenEdge locates the environment information, OpenEdge reads the values for DLC,
PROMSGS, and other environment variables. For each variable, OpenEdge first searches the
location where it found the environment information. If OpenEdge does not find the variable, it
searches for an operating system environment variable.
OpenEdge expects to find all environment settings in the same location it finds the environment
variables. There is one exception: OpenEdge searches HKEY_CURRENT_USER and
HKEY_LOCAL_MACHINE first when it starts without the -basekey parameter and finds the
environment information in the Registry. If OpenEdge writes a value to the Registry, however,
it will always write it to HKEY_CURRENT_USER. This allows multiple users of a single machine to
customize settings individually. The environment setting location could be either a Registry key
or an initialization file, but not both.
The Progress 4GL GET-KEY-VALUE statement also searches for user environment information.
The GET-KEY-VALUE statement searches either the Registry or a progress.ini file, but not both.
When GET-KEY-VALUE searches the Registry, it searches both of the HKEY_CURRENT_USER and
HKEY_LOCAL_MACHINE keys if the following conditions are true:
• The OpenEdge startup command (prowin32) used for the current session did not include
the -basekey parameter.
• OpenEdge found the environment information in the Registry at startup or at the last LOAD
statement.
4–8
Maintaining User Environments
The Progress 4GL PUT-KEY-VALUE statement writes to the location where the environment
information was found at startup. If that location is the Registry, and if the prowin32 command
did not include the -basekey parameter at startup, the PUT-KEY-VALUE statement writes to the
HKEY_CURRENT_USER key and not to the HKEY_LOCAL_MACHINE key.
• Options required by OpenEdge tools (such as the Procedure Editor and the Report
Builder).
• User-defined options.
• Environment variables.
4–9
OpenEdge Deployment: Managing 4GL Applications
[Startup]
V6Display=no
;ImmediateDisplay=yes
;MultitaskingInterval=100
DefaultFont=MS Sans Serif, size=8
DefaultFixedFont=Courier New, size=8
DLC=C:\Progress\OpenEdge
Use-3D-Size=Yes
PROPATH=.,C:\Progress\OpenEdge\C:\Progress\OpenEdge\bin
UseSourceEditor=yes
EditorConfigPath=C:\OpenEdge\WRK\proedit
.
.
.
[WinChar Startup]
DLC=C:\Progress\OpenEdge
PROCFG=C:\DLC\PROGRESS.CFG
PROMSGS=C:\DLC\PROLANG\PROMSGS.GER
PROPATH=.,C:\DLC
V6Keys=No
V6FKeys=No
.
.
.
• Startup section.
• Colors section.
• Fonts section.
4–10
Maintaining User Environments
The progress.ini file can also contain the following optional sections:
You can edit the progress.ini file to customize environments at different sites. The
progress.ini file is located in the install-dir\bin directory, by default.
Startup section
The Startup section of the progress.ini file contains options that specify the following
environment characteristics for graphical user interface clients:
The Startup section also contains OpenEdge environment variables that you can set for use with
graphical user interface clients. See Table 4–5 in the “Specifying environment variables”
section on page 4–36 for a list of environment variables you can set in the Startup section.
AlignFrameTitles
AlignFrameTitles=n
Lets you specify the alignment of frame titles in a graphical user interface. Valid settings
include the following: 0 (left justified), 1 (centered), and 2 (right justified). The default is
centered.
4–11
OpenEdge Deployment: Managing 4GL Applications
AS/400_AppcDllName
AS/400_AppcDllName=dll-filename
For Version 7.3B and later, you can specify the name of the DLL that you want to use for
AS/400 communications. Table 4–1 lists the available DLLs depending on the AS/400
communication protocol and the type of network support you use.
AS/400
communication Type of
protocol network support DLL filename
CarefulPaint
CarefulPaint={ YES | NO }
Lets you set the accuracy with which OpenEdge repaints overlapping 3D widgets and
frames. Set to YES for OpenEdge to repaint overlapping 3D widgets and frames slowly and
carefully. Set to NO for OpenEdge to repaint overlapping 3D widgets and frames quickly
(which might reduce the quality of the graphic). The default value is YES.
4–12
Maintaining User Environments
ClientTimeOut
ClientTimeOut=n
Lets you specify the number of minutes a client session can remain inactive before the
server disconnects the session.
The server process determines whether a client has been inactive for a specified period of
time, and if so, the server disconnects the client and backs out any related active
transactions.
DefaultFixedFont
typeface
point-size
The size of the font, in points. If you omit the point size, OpenEdge uses the default
point size as defined by the typeface.
keyword
You can specify the following keywords: bold, italic, underline, or strikeout.
scriptname
By default, OpenEdge uses the script (character set) of the Windows FixedSys font
for all fonts specified in the environment. If you select a different script when editing
a font using the font common dialog, OpenEdge writes the specified script name to
the font entry.
4–13
OpenEdge Deployment: Managing 4GL Applications
DefaultFont
typeface
point-size
The size of the font, in points. If you omit the point size, OpenEdge uses the default
point size as defined by the typeface.
keyword
You can specify the following keywords: bold, italic, underline, or strikeout.
scriptname
By default, OpenEdge uses the script (character set) of the Windows FixedSys font
for all fonts specified in the environment. If you select a different script when editing
a font using the font common dialog, OpenEdge writes the specified script name to
the font entry.
DefaultV6UpdateFont
typeface
point-size
The size of the font, in points. If you omit the point size, OpenEdge uses the default
point size as defined by the typeface.
4–14
Maintaining User Environments
keyword
You can specify the following keywords: bold, italic, underline, or strikeout.
scriptname
By default, OpenEdge uses the script (character set) of the Windows FixedSys font
for all fonts specified in the environment. If you select a different script when editing
a font using the font common dialog, OpenEdge writes the specified script name to
the font entry.
The DefaultFixedFont and the DefaultV6UpdateFont should be the same base font.
If you change them, make sure that the font is fixed and that the
DefaultV6UpdateFont has the underline attribute. OpenEdge does not automatically
add the underline attribute to the DefaultV6UpdateFont setting.
EndMsgTitle
EndMsgText
EndMsgTitle=title-text
EndMsgText=message-text
Lets you specify the title and text for the Windows shutdown message box.
When Windows shuts down, a dialog box prompts the user to verify the shutdown. If the
user answers YES, OpenEdge closes and the Windows Exit procedure continues. If the user
answers NO, the Windows Exit procedure terminates and Windows remains active.
4–15
OpenEdge Deployment: Managing 4GL Applications
FrameSpacing
FrameSpacing=n
Lets you specify how the OpenEdge layout processor spaces frames.
Setting the value to -1 places the frame at the next character unit boundary. Setting the
value to 0 places frames one half of a character unit apart. Setting the value greater than 0
spaces the frames by the specified number of pixels.
ImmediateDisplay
ImmediateDisplay={ YES | NO }
If you do not set this option, some Version 6 applications will not draw the screen
correctly. Set this option for applications with existing code that you do not want to
modify. The default setting is NO.
You can also use the IMMEDIATE-DISPLAY attribute with the SESSION system handle to
surround the offending code. This is the preferred technique.
For more information about the IMMEDIATE-DISPLAY attribute and the SESSION system
handle, see OpenEdge Development: Progress 4GL Reference.
Keep3DfillinBorder
Keep3DfillinBorder={ YES | NO }
Set to YES to display a disabled fill-in field with a border. Set to NO to display a disabled
fill-in field without a border. The default value is NO.
4–16
Maintaining User Environments
MultitaskingInterval
MultitaskingInterval=n
Lets you specify how the OpenEdge session interacts with a Windows cooperative
multi-tasking environment. Its value determines how often OpenEdge filters events or
messages between itself and other Windows applications. As OpenEdge filters these
events more often, it executes procedures less efficiently but allows other Windows
applications more opportunity to execute. Adjusting the internal event filter is particularly
useful during background processing, such as report generation.
To maximize performance during batch-mode processing, set the value to 9999 (the
maximum value allowed). If you want to run another application while you run OpenEdge
in batch mode, set the value to 1000. If you set the value to 0 (the default), the internal loop
never executes. Although this results in high performance, interoperability with other
Windows applications is poor. The lower the number, the more often the loop executes,
resulting in better interoperability. Set this option for applications with existing code that
you do not want to modify.
You can also use the MULTITASKING-INTERVAL attribute with the SESSION system handle
to control how OpenEdge interacts with Windows cooperative multi-tasking by
surrounding long 4GL processing loops with this attribute.
See OpenEdge Development: Progress 4GL Reference for more information about the
MULTITASKING-INTERVAL attribute and the SESSION system handle.
NoSplash
NoSplash={ YES | NO }
Set to YES to turn off display of the splash screen. By default, the OpenEdge GUI client
and the WebClient display a splash screen during startup. The screen, which is a blue
rectangle with the words “Powered by Progress Software,” disappears when the
OpenEdge application starts.
4–17
OpenEdge Deployment: Managing 4GL Applications
Opsys
Opsys=character-string
Lets you specify the value used by the OPSYS preprocessor directive or the value returned
by the OPSYS function. Valid settings include any character string.
PopupAppOverridesSys
PopupAppOverridesSys={ YES | NO }
Set to YES to display the system-default pop-up menu only if a user-defined pop-up menu
is not available. Set to NO to display the system-default pop-up menu regardless of a
user-defined pop-up menu. If a user-defined pop-up menu is available, it is displayed after
the system pop-up menu is closed. The default value is YES.
Note: The system-default pop-up menu is displayed when you click the right mouse
button on a fill-in field or an editor widget and a user-defined pop-up menu is not
available.
PopupNoSysDefault
PopupNoSysDefault={ YES | NO }
Set to YES to suppress the system-default pop-up menu. Only the user-defined pop-up
menu is displayed. The default value is NO.
Note: The system-default pop-up menu is displayed when you click the right mouse
button on a fill-in field or an editor widget and a user-defined pop-up menu is not
available.
4–18
Maintaining User Environments
PopupOnMouseDown
PopupOnMouseDown={ YES | NO }
Set to YES to display a pop-up menu when the right mouse button is depressed. Set to NO
to display a pop-up menu when the right mouse button is released. The default value is NO.
Note: This option applies only to pop-up menus that are displayed with the right mouse
button (that is, MENU-MOUSE = 3). Menus that are displayed with the left or middle
mouse button are always displayed when the buttons are depressed.
PrinterFont
PrinterFont=typeface, [ size=screen-point-size ]
Lets you specify the printer fonts OpenEdge uses with the OUTPUT TO PRINTER statement.
PrinterFontn
PrinterFontn=typeface, [ size=screen-point-size ]
Lets you specify the printer font OpenEdge uses with the OUTPUT TO LPTn statement.
UseNative3D
UseNative3D={ YES | NO }
Set to YES to use the 3D drawing capabilities in Windows 95/NT 4.0. Set to NO to use the
3D drawing capabilities in OpenEdge. The default value is YES.
4–19
OpenEdge Deployment: Managing 4GL Applications
UseSourceEditor
UseSourceEditor={ YES | NO }
Set to YES if you want to use the Source Editor (Slick Edit). Set to NO if you want to use
Rich Edit editor. Both editors are Unicode-enabled.
Use-3D-Size
Use-3D-Size={ YES | NO }
Lets you specify how OpenEdge calculates the height of a character unit.
If you set the value to YES, OpenEdge uses the height of a three-dimensional fill-in. If you
set the value to NO, OpenEdge uses the height of a non-three-dimensional fill-in. The
default setting is YES.
V6Display
V6Display={ YES | NO }
When you compile a procedure in Windows, OpenEdge compiles the borders and fonts
associated with user interface widgets into the screen layout by default. As a result, you
might encounter compilation problems when you try to run a Version 6 application in
Progress Version 7 for Windows. There might not be enough space on the display to
accommodate the borders and default fonts that are automatically associated with user
interface widgets of the Version 6 application.
To avoid this problem, set V6Display to YES to specify that you are running Version 6
code.
You can also set a session attribute to control the run-time setting of the V6Display state.
The attribute is V6DISPLAY and has a Boolean value. Setting this attribute has the same
effect as specifying the setting at startup. However, you must hide all existing windows.
4–20
Maintaining User Environments
• The character unit height is recalculated to the height of the font specified by the
DefaultV6UpdateFont option.
• The character unit width is recalculated to the width of an average character in the
font specified by the DefaultV6UpdateFont option.
• The default font is automatically changed to use the font specified by the
DefaultFixedFont option.
• All OpenEdge fill-ins that are enabled for update use the font specified by the
DefaultV6UpdateFont option (by default, the default fixed font with underlines).
This means that updateable fill-ins are drawn with underlines.
• Frame titles are drawn so that the frame title height measures exactly one character
unit.
The V6Display option or attribute does not enable support for PUT SCREEN. In addition, if
you set the V6Display option, Version 7 applications that have not been compiled with the
V6Display option set to YES will draw screens incorrectly.
Note: The V6Display option is intended for use with applications, not with the OpenEdge
ADE. The ADE is not supported when V6Display is set to YES.
If you plan to use Version 6 user interface code with Version 7 tools (or your own Version
7 interface), Progress Software recommends that you use the V6Frame option instead of
V6Display.
V6FontNumber
V6FontNumber=n
4–21
OpenEdge Deployment: Managing 4GL Applications
By default, this option points to the font defined as font3 in the [Fonts] section. Font3 is
the ADE character-mode font. If you change the V6FontNumber value, make sure you
define the new font number in the [Fonts] section.
Note: Do not change the definition of font3 in the [Fonts] section. OpenEdge relies on
that font definition for other purposes.
V6FrameBGC
V6FrameBGC=n
Lets you specify the default background color for all frames that use the V6FRAME option.
Valid settings include any number that corresponds to a color in the OpenEdge color table.
WindowSystem
WindowSystem=character-string
Lets you specify the value used by the WINDOW-SYSTEM preprocessor directive. Valid
settings include any character string.
Colors section
The Colors section of the progress.ini file contains options that specify the colors that make
up the color table for use with graphical user interface clients. There are 16 colors available to
an application for use as either foreground or background colors. You can specify up to 256
colors.
Note: Do not change the first 16 colors. These colors are reserved for the Application
Development Environment (ADE) tools. Changing them could cause the OpenEdge
ADE tools to malfunction.
Each entry in the Colors section performs two semantic functions: it defines a color, and it maps
that color to an integer in the range 0 to 255. An application specifies this integer when making
a color assignment to a widget.
4–22
Maintaining User Environments
colorn = { R , G , B , | colorname }
colorname
Any of the following color names, mapped to the colors defined in the Windows Control
Panel:
COLOR-SCROLLBAR
COLOR-BACKGROUND
COLOR-ACTIVECAPTION
COLOR-INACTIVECAPTION
COLOR-INACTIVECAPTIONTEXT
COLOR-MENU
COLOR-WINDOW
COLOR-WINDOWFRAME
COLOR-MENUTEXT
COLOR-WINDOWTEXT
COLOR-CAPTIONTEXT
COLOR-ACTIVEBORDER
COLOR-INACTIVEBORDER
COLOR-APPWORKSPACE
COLOR-HIGHLIGHT
COLOR-HIGHLIGHTTEXT
COLOR-BTNFACE
COLOR-BTNHIGHLIGHT
COLOR-BTNSHADOW
COLOR-GRAYTEXT
COLOR-BTNTEXT
4–23
OpenEdge Deployment: Managing 4GL Applications
Any entries you add to the color table must be sequential. For example, since the installed
progress.ini file defines color0 to color15, the next color you add must be color16. If you add
an entry for color17, OpenEdge ignores it if color16 is undefined.
For backward compatibility, color0 to color15, as installed, are the same as the colors supported
in Version 6. See the chapter about colors and fonts in OpenEdge Development: Programming
Interfaces for a listing of these colors.
For backward compatibility, the progress.ini file specifies the following color pairs for
Version 6 applications:
• NORMAL specifies the colors for fill-ins that do not have input focus.
• INPUT specifies the colors for fill-ins that have input focus.
NORMAL, INPUT, and MESSAGES each take a pair of integer values from 0 to 255. The integers
represent color table entries. For example, in the default progress.ini file, NORMAL is defined
as foreground equal to color table entry 0 (RGB value 0,0,0) and background equal to color table
entry 15 (RGB value 255,255,255).
The following example shows how to redefine NORMAL as foreground equal to color table entry
3 and background equal to color table entry 12:
NORMAL=3,12
The Default Window section of the progress.ini file specifies the following options for a
graphical user interface client’s default window:
• The size; specify the size as a number of rows and columns. The default size is 25 by 80.
4–24
Maintaining User Environments
[Default Window]
x=
y=
rows=
columns=
Fonts section
The progress.ini file as installed contains font table entries for the OpenEdge ADE tools.
OpenEdge uses the default system fonts defined in the Startup section, unless you add additional
fonts to the existing font table in the Fonts section.
Note: You can add site-specific fonts to the file. Do not change the first 8 fonts. These fonts
are reserved for the Application Development Environment (ADE) tools. Changing
them could cause the OpenEdge ADE tools to malfunction.
Determine which screen fonts exist in your environment. The fonts you choose should be
graphically compatible. One way to choose fonts is to use the font common dialog box.
The font table can contain up to 256 entries. Each entry in the table performs two semantic
functions: it names a font that exists in your environment and it maps that font to an integer from
0 to 255. An application specifies this integer when making a font assignment to a widget.
Note: You cannot enter extra spaces in the font definition section. Extra spaces will cause the
error 4499.
4–25
OpenEdge Deployment: Managing 4GL Applications
typeface
point-size
The size of the font, in points. If you omit the point size, OpenEdge uses the default point
size as defined by the typeface.
keyword
You can specify the following keywords: bold, italic, underline, or strikeout.
scriptname
By default, OpenEdge uses the script (character set) of the Windows FixedSys font for all
fonts specified in the environment. If you select a different script when editing a font using
the font common dialog, OpenEdge writes the specified script name to the font entry.
The WinChar Startup section of the progress.ini file contains options that specify the
following environment characteristics for character clients:
The WinChar Startup section also contains OpenEdge environment variables that you can set
for use with character clients. See Table 4–5 in the “Specifying environment variables” section
on page 4–36 for a list of environment variables you can set in the WinChar Startup section.
BrowseRowMarker
BrowseRowMarker=n
Lets you specify a character to represent a browse row marker. Valid settings include any
number that corresponds to a character in the CPSTREAM character set.
4–26
Maintaining User Environments
CursorHeight
CursorHeight=n
Lets you specify the height of a cursor as a percentage. Valid settings include any number
between 0 and 100. This option overrides the UseDosCursor setting.
EnableMouse
EnableMouse={ YES | NO }
Set to YES to enable mouse input. Set to NO to disable mouse input. The default value is YES.
MenuMnemonicColor
MenuMnemonicColor=n
Lets you specify the color of mnemonic characters in menu items. Valid settings include
any number that corresponds to a color in the OpenEdge color table.
SingleLineBorder
SingleLineBorder=n,n,n,n,n,n,n,n
Lets you specify the characters used to draw borders and lines (such as frame borders,
rectangles, submenu and pop-up menu borders, and horizontal and vertical lines). Valid
settings include any eight numbers that correspond to characters in the CPSTREAM character
set, separated by commas.
These eight numbers represent the corners and sides of a rectangle and must be specified
in the following order: top, bottom, left, right, top-left corner, top-right corner,
bottom-right corner, and bottom-left corner.
4–27
OpenEdge Deployment: Managing 4GL Applications
SysCheckmark
SysCheckmark=n
Lets you specify a character to represent a selection marker in widgets (such as a selection
list, menu, or browser). Valid settings include any number that corresponds to a character
in the CPSTREAM character set.
UseDosCursor
UseDosCursor={ YES | NO }
Set to YES to change the cursor from an underscore to a solid block when switching from
insert mode to over-strike mode in a fill-in field or editor widget. Set to NO to use an
underscore as the cursor in either mode. The default value is NO.
V6Keys
V6Keys={ YES | NO }
Set to YES to use a set of key bindings that are Version 6 compatible by default. The default
value is NO.
V6FKeys
V6FKeys={ YES | NO }
Set to YES to use the bindings for the CTRL, ALT, SHIFT, and F13 to F39 keys that are
Version 6 compatible by default. The default value is NO.
4–28
Maintaining User Environments
The WinChar Colors section of the progress.ini file contains options that specify the colors
that make up the color table for use with character clients.
Each entry in the WinChar Colors section performs two semantic functions: it defines a color,
and it maps that color to an entry in the color table by specifying an integer from 0 to 255. An
application specifies this integer when making a color assignment to a widget.
keyword | colorn
You can also specify color0, color1, and color2 using the NORMAL, INPUT, and MESSAGES
keywords, respectively. The keyword overrides the colorn specification. That is, if you
specify both colorn and its corresponding keyword, OpenEdge displays the colors you
specified with the keyword.
fgnd-color
bgnd-color
For information about color definitions for the WinChar Colors section, see the Color Phrase
reference entry in OpenEdge Development: Progress 4GL Reference.
The WinChar Default Window section of the progress.ini file specifies the line mode for a
character client. You can specify 50 rows if your hardware supports 50-line mode. Specify 25
rows if you want the application to be compatible with Progress Version 6 or if you want to port
the application to a character terminal.
4–29
OpenEdge Deployment: Managing 4GL Applications
The WinChar Keys section of the progress.ini file defines the customized key bindings for
use with character clients. Table 4–2 lists the user-definable key bindings in the Windows
environment. For a complete listing of the Windows key function and key label mappings for
handling user input, see OpenEdge Development: Programming Interfaces.
APPEND-LINE CTRL-A
BLOCK CTRL-V
BREAK-LINE CTRL-ALT-B
CLEAR F8
COPY F11
CUT F10
DEFAULT-POP-UP SHIFT-F4
DELETE-LINE CTRL-D
END-ERROR ESC
ENTER-MENUBAR F3
FIND CTRL-F
GET F5
GO F1
HELP F2
INSERT-MODE INS
NEW-LINE CTRL-N
NEXT-FRAME CTRL-TAB
PASTE F12
4–30
Maintaining User Environments
PREV-FRAME CTRL-SHIFT-TAB
PUT F6
RECALL F7
keyfunction=keylabel [ , keylabel ]
Use a single entry to specify a key binding; additional entries for the same key function are
ignored.
If you specify more than one key label, OpenEdge uses the first when it needs to display a key
label given a key function, as in “Enter data or press Escape to end.”
For example, the following entry maps the Help key function to the F2 key label, and the Go key
function to the F1 key label:
HELP=F2
GO=F1
You can use any combination of CTRL, SHIFT, and ALT keys. However, SHIFT only has an effect
when used with ASCII keys. If an entry contains nonexistent key labels, the entry is ignored.
Note: Set the V6Keys option in the [WinChar Startup] section to enable OpenEdge to use a set
of key bindings that are Version 6 compatible by default.
Debug-Init section
4–31
OpenEdge Deployment: Managing 4GL Applications
Debug-Macros section
The Debug-Macros section of the progress.ini file contains a list of parameters that define
initial macros used by the Debugger. You can also define your own macros. For more
information, see OpenEdge Development: Debugging and Troubleshooting.
Debug-Buttons section
The Debug-Buttons section of the progress.ini file contains a list of parameters that define
initial buttons used by the Debugger. You can also define your own buttons. For more
information, see OpenEdge Development: Debugging and Troubleshooting.
Keys section
The Keys section is an optional section you can create in the progress.ini file to customize
key bindings for the Windows environment.
Table 4–3 lists the static key bindings in the Windows environment.
BACKSPACE BACKSPACE
BACK-TAB SHIFT-TAB
CURSOR-DOWN CURSOR-DOWN
CURSOR-LEFT CURSOR-LEFT
CURSOR-RIGHT CURSOR-RIGHT
CURSOR-UP CURSOR-UP
DELETE-CHARACTER DEL
END END
HOME HOME
PAGE-DOWN PAGE-DOWN
PAGE-UP PAGE-UP
4–32
Maintaining User Environments
RETURN ENTER
TAB TAB
Table 4–4 lists the user-definable key bindings in the Windows environment.
APPEND-LINE No default
BLOCK No default
BREAK-LINE No default
CLEAR No default
DEFAULT-POP-UP F4
DELETE-LINE No default
END-ERROR ESC
FIND No default
GET No default
GO F2
HELP F1
INSERT-MODE INS
NEW-LINE No default
NEXT-FRAME F6
PREV-FRAME SHIFT-F6
4–33
OpenEdge Deployment: Managing 4GL Applications
PUT No default
RECALL No default
Keymap section
The Keymap section is an optional section you can create in the progress.ini file to define
mappings between standard ASCII (7-bit) characters and extended (8-bit) characters. Extended
characters are typically non-English alphabetical characters. OpenEdge uses these keymap
entries to build a translation table for processing characters in the input and output streams.
Note: Using the Keymap section is the Version 6 technique for mapping characters. Using
conversion tables is a better technique for processing characters. For information about
defining conversion tables, see OpenEdge Development: Internationalizing
Applications.
Use the IN statement, in a keymap entry, to map an ASCII character to an extended character
using the following syntax:
[ MAP-language ]
:IN(\ascii-char)=\extended-char:
language
ascii-char
The 7-bit character, in octal (\nnn) format. You must specify all three digits.
extended-char
The 8-bit character, in octal (\nnn) format. You must specify all three digits.
4–34
Maintaining User Environments
Use the OUT statement, in a keymap entry, to map an extended character to an ASCII character
using the following syntax:
[ MAP-language ]
:OUT(\extended-char)=\ascii-char:
You can use multiple IN and OUT statements in a single keymap entry.
If you use extended character sets, you must specify character mappings for each character set
on a per-terminal basis. For example, the following code fragment demonstrates how to map
characters to German language characters:
[MAP-german]
:IN(\102)=\341:
:IN(\101)=\216:
:IN(\141)=\204:
:IN(\117)=\231:
:IN(\157)=\224:
:IN(\125)=\232:
:IN(\165)=\201:
The IN statements in the preceding example map ASCII characters (B, A, a, O, o, U, and u) to
German characters (ß, Ä, ä, Ö, ö, Ü, and ü). When OpenEdge sees the character A (\101) on
input, it converts the character to Ä (\216). Likewise, when OpenEdge needs to send an Ä to the
terminal, it sends [ (\101). The terminal sees A and displays Ä.
Suppose the terminal cannot display an Ä. You can use the OUT statement to specify an
appropriate character to display for Ä, such as capital A. For example:
[MAP-german]
:OUT(\216)=\101:
You can also specify keymap entries for the input and output streams using the MAP option
with each of the following OpenEdge language elements:
4–35
OpenEdge Deployment: Managing 4GL Applications
• OUTPUT TO statement.
For more information about these language elements, see OpenEdge Development: Progress
4GL Reference.
Table 4–5 lists the environment variables you can set in either the Startup section or WinChar
Startup section of the progress.ini file.
4–36
Maintaining User Environments
4–37
OpenEdge Deployment: Managing 4GL Applications
On the icon command line, install-dir is the directory where you have installed the products.
See the Windows user documentation for more information about creating additional icons,
copying and modifying existing icons, and general information about the Windows Explorer.
• Choose Start→Run from the task bar and enter startup parameters on the command line.
Starting the Progress GL client places you in the Progress Procedure Editor with no databases
attached.
1. Select the client icon from the OpenEdge program group and choose File→Properties
from the Windows Explorer, or right-click on the icon and choose Properties from the
pop-up menu. The Properties dialog box appears.
2. From the Shortcut tab, modify the command-line in the Target field. You can supply up
to 259 characters in this field. The command-line limit of 259 characters is still valid for
the expanded version of the command-line text.
3. Choose OK.
You can specify environment variables in the command-line. For example, specifying the
following command runs the PROWIN32 executable located in the path where the %DLC%
environment variable points:
%DLC%\BIN\PROWIN32.EXE
4–38
Maintaining User Environments
You must also maintain the PROTERMCAP file. PROTERMCAP is a terminal definition file that
contains the terminal description for your monitor’s terminal type. OpenEdge uses this file to
determine how to interact with your terminal, console, or terminal emulator.
• User-defined options.
• Environment variables.
4–39
OpenEdge Deployment: Managing 4GL Applications
#!/bin/sh
MACHINE="aix"
export MACHINE
UDORA="User Defined"
export UDORA
if [ x$RDL = x -a -f `pwd`/buildenv.log ] ; then
rm -f `pwd`/buildenv.log
fi
ORA_MK=$DLC/oebuild/make/ORA.mk
if [ x$RDL != x ]; then
ORA_MK=$PRGSSRC/project/ORA.mk
fi
You can edit this script to customize environments at different sites. The buildenv script is
located in the $DLC/oebuild/make directory. OpenEdge uses the buildenv script to maintain
environment variables that define objects, libraries, and options required for building
executables on UNIX. For more information about building OpenEdge executables, see
Appendix A, “Building OpenEdge 4GL Executables.”
4–40
Maintaining User Environments
Note: Make a backup copy of the PROTERMCAP file before making modifications.
Each terminal entry contains the commands and terminal descriptions that OpenEdge uses to
communicate with and control the terminal. Each entry is divided into these logical sections:
• Terminal name.
• Terminal capabilities.
4–41
OpenEdge Deployment: Managing 4GL Applications
The PROTERMCAP file contains a lengthy entry for each terminal type supported by OpenEdge.
Each entry has six parts. Figure 4–4 shows a partial example of each part of a PROTERMCAP entry.
The following sections describe PROTERMCAP syntax and each part of a PROTERMCAP entry.
4–42
Maintaining User Environments
PROTERMCAP syntax
This section explains the following:
• The general syntax rules that apply when specifying fields in any of the six PROTERMCAP
sections.
• The syntax rules that apply when specifying string values within a field. String values can
occur in the terminal capabilities section, the key bindings section, and the color table
section.
Syntax rules that apply only to specific sections of the PROTERMCAP file are explained in context.
General syntax
A PROTERMCAP entry is a single logical line that contains many fields. The syntax for an entry is
as follows:
• Each field is terminated by a colon (:). (Use the octal equivalent \072 to specify a colon
that is not a terminator.)
• Unless stated otherwise, a field cannot contain embedded separators. Spaces and tabs
improve readability, but they are considered empty fields and must be terminated by a
colon.
• Comment lines begin with a pound sign (#), and can only occur at the beginning and end
of each PROTERMCAP terminal entry (that is, before the terminal name line and after the
pointer to key functions line).
• To enhance readability, the PROTERMCAP file, as installed, contains as many physical lines
as there are fields. Each physical line in the entry contains the following, in the order
listed:
– A field definition.
– A backslash (\).
– A return.
The backslash indicates that the terminal entry continues on the next physical line of the
file. If you need to include a literal backslash in a field, use two backslashes.
4–43
OpenEdge Deployment: Managing 4GL Applications
The following code fragment from the entry for the Wyse 370 shows the use of the colon, tab,
space, backslash, and return characters:
String syntax
Certain fields in the capabilities, key bindings, and color sections are specified using strings.
Strings are typically a combination of command sequences, literal values, and encoded
arguments that tell OpenEdge how to control some aspect of the display.
Table 4–7 show the symbols that are common to all strings. Symbols that are unique to strings
specified in the capabilities, key bindings, or color sections are explained in context.
Mnemonic Description
\n New line
\r Return
\t Tab
\b Backspace
\f Form feed
4–44
Maintaining User Environments
Mnemonic Description
\^ ^
\\ \
Some terminal types require you to specify a delay period, also called a padding constant, with
certain string capabilities. The delay, in milliseconds, gives the terminal adequate time to
execute the command. Specify this delay as an integer value after the equals sign (=) in a string,
as shown in the following example:
:cm=20\E[%i%d;%dH:\
This tells OpenEdge to wait 20 milliseconds after sending the cursor motion (cm) command
sequence.
You can optionally follow an integer delay value with an asterisk (*) for commands that affect
more than one line of the display. In this case, OpenEdge delays the specified time for each line
affected by the command. However, this significantly degrades performance and usually is not
required.
When you specify proportional delay, you must specify an integer as the delay in a string field.
It cannot have a fractional part; for example, a delay of 1.5* is not valid.
Note: Do not specify a padding constant with the GS, GH, GV, GE, G1, G2, G3, and G4
capabilities.
4–45
OpenEdge Deployment: Managing 4GL Applications
• A description of the terminal in which only the last name can contain blanks for readability
(optional).
PROTERMCAP requires at least one of the name entries (1, 2, or 3, above) to be entered without
spaces; the other two, and the description, are optional. See the following examples.
For example:
Abbreviation Description
4–46
Maintaining User Environments
Terminal capabilities entries control visual attributes of the terminal: how big the terminal
screen is, how to move to any point on the screen, how to refresh the screen, how to enter/exit
special display modes (reverse, blinking, underline), etc. They also control specific terminal
functions to set up and clean up the terminal properly, so as not to leave a terminal in an
unexpected state (which might leave the terminal unusable).
These entries are the core sequences that OpenEdge uses to communicate with the terminal.
Changing them can cause very unpredictable results and might even cause OpenEdge to put the
terminal in an unusable state. The entries can be changed, but exercise great care in doing so.
• For certain capability types, a value that allows OpenEdge to understand and interact with
the capability on a specific terminal.
For example:
:ct:\
:cm=\E[%i%d;%dH:\
:co#80:\
:li#24:\
:G1=k:\
4–47
OpenEdge Deployment: Managing 4GL Applications
These are the graphics character terminal capabilities that OpenEdge supports:
Note: Do not use a padding constant with any of the above graphic strings.
co, li, CA, ce, cl, is, Se, Si, te, ti, pc, xi
k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k0, k. (period), k, (comma), k- (hyphen)
Note: The ce, cl, and cm capabilities are required for OpenEdge to start up.
Vermont Views supports all the capabilities listed here, except ce, te, and ti, and the key
translation capabilities.
4–48
Maintaining User Environments
4–49
OpenEdge Deployment: Managing 4GL Applications
k0-9 STRING Define the codes sent by the numeric keypad keys if
k. these are different from the codes sent by the standard
k, 0-9, period, comma, and hyphen keys. These are only
k- used by OpenEdge.
ku STRING Up arrow.
sf STRING Scroll forward. You can use this on terminals that have
scrolling regions (for example, terminals with cs and sr
defined).
4–50
Maintaining User Environments
ws BOOLEAN Uses the device /dev /tty for the current port to
determine the number of columns and rows for the
terminal. Meaningful primarily for emulated terminals
in a windowing system (that is, xterm). If successful,
overrides co and li; otherwise, defaults to co and li.
OpenEdge will not automatically resize if the size of the
terminal changes after initialization.
There are four types of terminal capability fields: BOOLEAN, NUMERIC, CHARACTER, and STRING.
Table 4–9 summarizes the four data types and the operators used in conjunction with each.
Boolean fields are specified by a mnemonic abbreviation only. The mnemonic indicates that the
feature is present and its absence indicates that the feature is not present. All other capabilities
take a value. The value can be a string, a character, or a numeric value.
4–51
OpenEdge Deployment: Managing 4GL Applications
BOOLEAN none
The following code fragment from the terminal entry for the Wyse 370 terminal shows how to
specify BOOLEAN, NUMERIC, CHARACTER, and STRING capabilities:
:ct:\
:cm=\E[%i%d;%dH:\
:co#80:\
:li#24:\
:G1=k:\
In this example, the mnemonic ct is a Boolean switch that indicates that the terminal supports
color. The mnemonic cm specifies cursor motion and takes a string. The assignment operator
for string values is an equals sign (=). The mnemonics co and li specify the number of columns
and lines on the display and each takes an integer. The assignment operator for integer values
is a pound sign (#). The mnemonic G1 specifies the upper-right corner line-graphic character
and takes a character. The assignment operator for character values is an equals sign (=).
4–52
Maintaining User Environments
For readability, the Vermont Views section of an entry has two distinct columns:
• A list of the matching key label capabilities. The label in this column always starts
with “L_”.
Here is an example:
:ku=\E[A: :L_ku=<Up>:\
:kd=\E[B: :L_kd=<Down>:\
:kr=\E[C: :L_kr=<Right>:\
:kl=\E[D: :L_kl=<Left>:\
:kh=\E[E: :L_kh=<Home>:\
Note: For readability in the PROTERMCAP file, the bc, ku, kd, kl, and kr capabilities are usually
repeated in the Vermont Views part of the file, even though both OpenEdge and
Vermont Views use these capabilities as they appear earlier in the OpenEdge capabilities
part. To avoid confusion, the key sequences for the Vermont Views capabilities should
be the same as the OpenEdge capabilities.
Table 4–10 summarizes the Vermont Views key function capabilities mnemonics.
Mnemonic Description
PU Page up.
PD Page down.
ki Insert toggle.
DL Delete character.
4–53
OpenEdge Deployment: Managing 4GL Applications
Mnemonic Description
bt Back tab.
fk2 Function Key 3 (enter the menu bar, then exit the menu bar).
Akw Contents.
4–54
Maintaining User Environments
tc=v7kf:
If you modify or create new PROTERMCAP entries, be sure to include this line as the last line in
the entry. This line ensures that the terminal entry can support Progress Version 7 and later.
If you want to use Version 6 mappings with Progress Version 7 and later, change the pointer as
follows:
tc=v6kf:
Specifying colors
You specify colors in the OpenEdge terminal-specific key functions and capabilities section of
PROTERMCAP. You can specify up to 123 color fields in a terminal entry. This manual refers to
the color specifications as the color table.
Each line in the table performs two semantic functions: it defines a foreground/background
color pair and it maps that color pair to an integer from 5 to 127. The integer is how an
application references the color pair when making color assignments to a widget. (An
application typically assigns two color pairs to a widget: one for display mode and another for
prompt mode.)
Use the following syntax to specify a color field in a PROTERMCAP terminal entry:
color-number
An integer from 5 to 127 that specifies the location of the color in the color table. The color
number is the mechanism used to assign a color pair in an application.
4–55
OpenEdge Deployment: Managing 4GL Applications
color-name
The name of the color. You can use any color value except a OpenEdge keyword.
Although this is optional, including a name makes the color section of the terminal entry
self-documenting (you cannot embed comments) and also makes the color specifications
backwardly compatible.
start-sequence
stop-sequence
For example, the following fields from the Wyse 370 terminal define color table locations
5 and 6:
COLOR 5 RED/BLACK=\E[31;40m:\E[m:\
COLOR 6 GREEN/BLACK=\E[32;40m:\E[m:\
• Color 0 holds the Version 6 color NORMAL, which is set by the terminal initialization (is)
field.
• Color 1 holds the Version 6 color INPUT and is set and cleared by us and ue. As installed,
this is underline mode.
• Color 2 holds the Version 6 color MESSAGE and is set and cleared by so and se. As installed,
this is reverse-video.
• Color 3 holds the colors used for high intensity and is set and cleared by HS and HR.
• Color 4 holds the colors used for blink and is set and cleared by BB and BR.
Note: The PROTERMCAP file, as installed, does not support spacetaking (embedded attribute)
terminals. These are terminals that use characters on the display to hold control codes for
video and color capabilities. If you add support for such terminals, OpenEdge ignores
the capability when displaying the interface.
4–56
Maintaining User Environments
• Control characters
The conversion specifications allow OpenEdge to convert an integer row value and an integer
column value into the arguments the terminal expects.
The cm string syntax is exactly the same as that used in the standard UNIX termcap file, in
which the conversion specifications follow the pattern of the UNIX printf() command. Table
4–11 lists the supported conversion specifications, each of which begins with a percent sign
(%).
Mnemonic Description
%% Gives a single %.
4–57
OpenEdge Deployment: Managing 4GL Applications
Mnemonic Description
%x Gives a two-byte, zero-padded, hex value as in the “%0.2x” format for the
UNIX printf() function.
The following example is the cursor motion field for the wyse 370 terminal:
:cm=\E[%i%d;%dH:\
• \E[ — The standard ANSI console lead-in sequence (Escape, followed by a left square
bracket). OpenEdge transmits this literally.
• %i — Instructs OpenEdge to add one to the row and column values to compensate for a
terminal whose origin is 1,1.
• %d — Instructs OpenEdge to send the row and column values to the terminal in ASCII
format.
• H — A terminating character.
To create a cm string for a new terminal type, find the description of this capability in your
terminal’s documentation to determine the control characters and the arguments it expects to
move the cursor to a random spot on the display. The documentation specifies an algorithm for
converting a row/column integer pair to the arguments it needs. The manual also specifies the
order in which the row and column values are expected (typically row first), and the character
to use to separate the two values. For example, to move to column 65, row 66, a terminal might
expect the characters A and B, which have ASCII values of 65 and 66, respectively.
4–58
Maintaining User Environments
UNIX
Key function key label
ABORT CTRL-\
CTRL-ALT-DEL
APPEND-LINE CTRL-A
BACKSPACE BACKSPACE
CTRL-H
DEL-CHAR
BACK-TAB BACK-TAB
CTRL-U
SHIFT-TAB
BELL BELL
CTRL-G
BLOCK SELECT
CTRL-V
BOTTOM-COLUMN ESC-CTRL-B
BREAK-LINE ESC-B
CANCEL-PICK ESC-CTRL-X
CHOICES ESC-CTRL-H
CLEAR F8
CTRL-Z
CLOSE ESC-Z
COMPILE ESC-P
4–59
OpenEdge Deployment: Managing 4GL Applications
UNIX
Key function key label
COPY F11
ESC-C
CURSOR-DOWN CURSOR-DOWN
CTRL-J
CURSOR-LEFT CURSOR-LEFT
CTRL-O
CURSOR-RIGHT CURSOR-RIGHT
CTRL-L
CURSOR-UP CURSOR-UP
CTRL-K
CUT F10
ESC-X
DEFAULT-POP-UP ESC-U
DELETE-CHARACTER DEL
DELETE-COLUMN ESC-CTRL-Z
DELETE-END-LINE ESC-K
DELETE-FIELD ESC-CTRL-D
DELETE-LINE REMOVE
CTRL-D
DELETE-WORD ESC-D
EDITOR-BACKTAB CTRL-B
EDITOR-TAB CTRL-G
END END
ESC ->
ESC-.
4–60
Maintaining User Environments
UNIX
Key function key label
END-ERROR F4
PF4
ESC
CTRL-E
ENTER-MENUBAR F3
PF3
ESC-M
EXIT ESC-Q
FIND CTRL-F
FIND
FIND-NEXT ESC-F
FIND-PREVIOUS ESC-I
GET F5
ESC-O
GO F1
PF1
CTRL-X
DO
GOTO ESC-G
HELP HELP
F2
ESC-?
PF2
HOME HOME
ESC-H
ESC-h
ESC-<
ESC-,
INSERT-COLUMN ESC-CTRL-N
INSERT-FIELD ESC-CTRL-G
4–61
OpenEdge Deployment: Managing 4GL Applications
UNIX
Key function key label
INSERT-FIELD-DATA ESC-CTRL-F
INSERT-FIELD-LABEL ESC-CTRL-E
INSERT-MODE INS
F9
CTRL-T
CTRL-@
LEFT-END ESC-LEFT-ARROW
MAIN-MENU ESC-CTRL-M
MOVE ESC-CTRL-V
NEW ESC-N
NEW-LINE INSERT-HERE
CTRL-N
NEXT-ERROR ESC-E
NEXT-FRAME ESC-CTRL-I
NEXT-WORD CTRL-W
OPEN-LINE-ABOVE ESC-L
OPTIONS ESC-CTRL-O
PAGE-DOWN PAGE-DOWN
ESC-CURSOR-DOWN
ESC-DOWN-ARROW
NEXT-PAGE
NEXT-SCRN
PAGE-LEFT ESC-W
PAGE-RIGHT ESC-Y
ESC-CTRL-J
PAGE-RIGHT-TEXT ESC-CTRL-J
4–62
Maintaining User Environments
UNIX
Key function key label
PAGE-UP PAGE-UP
ESC-CURSOR-UP
ESC-UP-ARROW
PREV-PAGE
PREV-SCRN
PASTE F12
ESC-V
PICK ESC-CTRL-P
PICK-AREA ESC-CTRL-W
PICK-BOTH ESC-CTRL-Q
PREV-FRAME ESC-CTRL-U
PREV-WORD CTRL-P
PUT F6
ESC-S
RECALL F7
CTRL-R
REPLACE ESC-R
REPORTS ESC-CTRL-A
RESUME-DISPLAY CTRL-Q
RETURN RETURN
CTRL-M
RIGHT-END ESC-CURSOR-RIGHT
ESC-RIGHT-ARROW
SAVE-AS ESC-A
SCROLL-LEFT ESC-CTRL-L
SCROLL-MODE ESC-T
4–63
OpenEdge Deployment: Managing 4GL Applications
UNIX
Key function key label
SCROLL-RIGHT ESC-CTRL-R
SETTINGS ESC-CTRL-@
STOP CTRL-C
CTRL-BREAK
STOP-DISPLAY CTRL-S
TAB TAB
CTRL-I
TOP-COLUMN ESC-CTRL-T
To change any of these mappings or create new ones, use the following syntax:
keyfunction(key-label) = sequence:
keyfunction
key-label
sequence
As in other sections of the PROTERMCAP file, string values are assigned using an equal sign
(=) and the field is terminated with a colon (:).
For example:
RECALL(F7)=^AF\r:
4–64
Maintaining User Environments
This field in a PROTERMCAP terminal entry defines the F7 key as transmitting a CTRL-A followed
by a capital F followed by a carriage return, and associates use of F7 with the RECALL function.
PAGE-DOWN(SCROLL-DOWN)=\021:
If you assign the same key label to two or more different key functions, you get a warning
message when you start OpenEdge. For example, “You cannot use DELETE for both
DELETE-CHARACTER and BACKSPACE.”
If you use a key in the Progress ON statement or GO-ON option only, and do not have to assign it
to a standard action, then use the following syntax in the PROTERMCAP entry:
(key-label)=sequence:
For example, the following entry indicates that pressing F16 sends a capital O followed by a
carriage return:
(F16)=O\r:
If any of the control code sequences sent when you press a key on the keyboard begin with a
control key, you cannot use that control key on your keyboard and the key does not have its
normal OpenEdge meaning. For example, if you specify CTRL-F in a control code sequence
when creating a key mapping, you can no longer use CTRL-F for FIND. You have to map another
key to the FIND action.
The key labels that the UNIX stty command specifies for FLUSH and SUSPEND override the
PROTERMCAP file’s use of the same key labels. For example, if the stty settings for FLUSH and
SUSPEND are CTRL-Q and CTRL-S, you cannot map these key labels to key functions in the
PROTERMCAP file. If you do, you receive no warning; the labels assume their stty meanings at
run time and OpenEdge ignores them.
The installed PROTERMCAP file does not map the Progress functions ABORT, STOP, and UNIX-END
to key labels. OpenEdge instead uses the key labels that the UNIX stty command specifies for
QUIT, INTR and EOF respectively.
4–65
OpenEdge Deployment: Managing 4GL Applications
For example, the following stty command specifies that OpenEdge should use CTRL-\ for
ABORT, CTRL-C for STOP, and CTRL-D for UNIX-END:
The labels specified by the stty command are of two forms: either CTRL-X or DEL if the
DELETE key (octal 177, decimal 127) is used. When entering the stty command, indicate the
control character by holding down the CTRL key and pressing the specified key; you do not type
a caret (^) followed by the key.
If an entry in the PROTERMCAP file uses one of the key labels specified in the stty command, you
get a warning message when you start OpenEdge. For example, if the stty command specifies
the DELETE key for the STOP function and the PROTERMCAP file specifies the DELETE key for the
DELETE-CHARACTER function, you receive a warning message.
In UNIX environments that do not use the Bourne shell (for example, the Korn shell or C shell),
job control allows you to end a job currently executing on a terminal. In most environments this
is initiated using CTRL-Z; however, OpenEdge uses this character sequence to clear the editor.
If you use extended character sets, you must specify character mappings for each character set
on a per-terminal basis. For example, the following code fragment from the PROTERMCAP file
demonstrates how to map characters on the Wyse 60 keyboard to German language characters:
4–66
Maintaining User Environments
The IN statements in the preceding example map ASCII characters (B, A, a, O, o, U, and u) to
German characters (ß, Ä, ä, Ö, ö, Ü, and ü). When OpenEdge sees the character A (\101) on
input, it converts the character to Ä (\216). Likewise, when OpenEdge needs to send an Ä to the
terminal, it sends [ (\101). The terminal sees A and displays Ä.
Suppose the terminal cannot display an Ä. You can use the OUT statement to specify an
appropriate character to display for Ä, such as capital A. For example:
:OUT(\216)=\101:
The IN and OUT statements express both the ASCII character and the extended character in octal
(\nnn) format.
Given the appropriate PROTERMCAP file entries for a language and terminal, set the TERM
environment variable to terminal/language (for example, TERM=wy60/german).
You can also specify character mappings for the input and output streams using the MAP option
with each of the following Progress language elements:
• OUTPUT TO statement.
For more information about these language elements, see OpenEdge Development: Progress
4GL Reference.
If you need to create a new PROTERMCAP entry, first check the /etc/termcap file for an entry for
your terminal. The /etc/termcap file is the standard terminal definition file used by several
UNIX system programs, such as the vi editor. This file is usually provided with UNIX.
4–67
OpenEdge Deployment: Managing 4GL Applications
If this file contains an entry for your terminal, copy this entry to the PROTERMCAP file. Use this
file as a starting point to build an entry for your terminal in the PROTERMCAP file.
If your version of UNIX uses a personal termcap called terminfo, you must modify the
terminfo keywords to match the PROTERMCAP capability mnemonics described in the preceding
sections.
• Test to see that colors are working correctly on widgets and frames.
OpenEdge supports terminals based on definitions of their characteristics stored in a file called
the PROTERMCAP file. The PROTERMCAP file supplied with OpenEdge has built-in definitions for
many terminals. If your terminal is not included in the PROTERMCAP file supplied with
OpenEdge, you must make modifications to that file. OpenEdge uses the shell variable or
logical PROTERMCAP to find the PROTERMCAP file. By default, OpenEdge looks for this file
whenever you start the software in a character environment.
4–68
Maintaining User Environments
Operating
system Command Environment
Alternately, you can change the terminal type from within a Progress program with the
following Progress statement:
TERMINAL = termid
See the TERMINAL Function reference entry in OpenEdge Development: Progress 4GL
Reference for more information.
4–69
OpenEdge Deployment: Managing 4GL Applications
:tc=terminal-name
4–70
Maintaining User Environments
• To override a capability in the copied entry, specify the capability in the new terminal’s
entry. Commands specified first always override those specified later.
• To suppress the inclusion of a capability that you do not want to specify in the new
terminal’s entry, specify only the mnemonic, followed by an at symbol (@) in the new
terminal’s entry. This tells OpenEdge to ignore the capability when it reads it from the
similar terminal.
• You cannot use the Version 6 PROTERMCAP in Version 7 or later. You can edit the
PROTERMCAP to use the Version 6 key bindings by editing the following line at the end of
the file:
• Place the similar terminal entry in the PROTERMCAP file before entries that reference it.
• The combined length of all the definitions must be less than 8,192 bytes.
For example, the following code fragment is a terminal entry for a Wyse 370 in 132 column
mode. The entry specifies the name of the terminal, a terminal initialization sequence, the
number of columns, and then uses tc to append the specifications for the Wyse 370 terminal:
4–71
OpenEdge Deployment: Managing 4GL Applications
4–72
5
Managing Client Performance
On client systems, OpenEdge consumes system resources to execute Progress 4GL procedures,
store variables and record buffers, sort records, and store temporary files. When managing client
performance, be aware of key performance factors such as procedure loading and execution,
temporary file I/O, and sorting I/O. In addition to these factors, application design and coding
can significantly affect client performance. For information about this topic, see OpenEdge
Development: Programming Interfaces.
• Sorting I/O
OpenEdge Deployment: Managing 4GL Applications
OpenEdge provides two types of r-code libraries: standard and memory-mapped. A standard
library contains r-code procedures that execute in local memory. A memory-mapped library
contains r-code procedures that execute in shared memory. You create r-code libraries by using
the PROLIB utility. For information about using the PROLIB utility to create and manage
r-code libraries, see Chapter 6, “Managing R-code Libraries.”
When loading and executing r-code procedures from operating system files in a directory,
OpenEdge must open and close each file individually. When loading and executing r-code
procedures from standard or memory-mapped libraries, OpenEdge opens only one file—the
library itself—to access all of the r-code files in the library.
When you execute r-code procedures from either a standard library in local memory or a
memory-mapped library in shared memory, you gain the following advantages:
When you execute r-code procedures from a memory-mapped library in shared memory, you
gain the following additional advantages:
• Requires less memory because multiple clients access the same r-code segments in shared
memory.
5–2
Managing Client Performance
• Execution buffer — The portion of local memory that OpenEdge allocates and uses to
store the chain of loaded r-code segments for all standard r-code procedures executing in
local memory.
• Session sort file (.srt) — A file that OpenEdge uses to dynamically swap standard r-code
segments in and out of the execution buffer.
• Shared memory buffer — The portion of shared memory that the operating system
allocates and uses to store and execute the r-code segments for all memory-mapped r-code
procedures.
• Segment descriptor table — An in-memory table that references the r-code segments
required by all executing procedures, including the location of each r-code segment in
local or shared memory and usage count information.
• R-code directory — An in-memory table that contains information about all r-code
procedures executing in local or shared memory, including r-code size, usage count,
segment descriptions, and a reference to the segment descriptor table for each segment.
For more information about the r-code execution environment, see Appendix B, “R-code
Features and Functions.”
OpenEdge loads and executes r-code procedures in different ways, depending on whether you
store the r-code files in an r-code library and the type of library. The following sections provide
an overview of how OpenEdge loads and executes r-code from an operating system file, a
standard procedure library, and a memory-mapped procedure library.
When loading an r-code procedure from an operating system file in a directory, OpenEdge
opens the r-code file, loads the required r-code segments into local memory, and closes the file.
When executing an r-code procedure from an operating system file, OpenEdge accesses and
executes the r-code segments in the execution buffer in local memory. OpenEdge also swaps
segments to and from the session sort file, as necessary.
5–3
OpenEdge Deployment: Managing 4GL Applications
When loading an r-code procedure from a standard library, OpenEdge opens the library file and
loads the required r-code segments into local memory. The library remains open until the end
of your Progress 4GL session or until you remove the library from the PROPATH. When
OpenEdge needs to load an r-code segment for a procedure in that library, it accesses the open
library in local memory. This is much faster than loading the same procedure from an operating
system file.
When executing an r-code procedure from a standard r-code library, OpenEdge accesses and
executes the r-code segments in the execution buffer in local memory. OpenEdge does not swap
r-code segments to the session sort file unless you specify the PROLIB Swap (-pls) startup
parameter. By default, OpenEdge reloads segments from the open library in local memory.
When loading an r-code procedure from a memory-mapped library, OpenEdge opens the library
and maps it in shared memory where multiple users can access it. The library remains mapped
until the end of your Progress 4GL session or until you remove the library from the PROPATH.
When OpenEdge needs to execute an r-code segment for a memory-mapped procedure, it
accesses the library in shared memory. This is even faster than loading the same procedure from
a standard library.
5–4
Managing Client Performance
Table 5–1 lists the startup parameters you use to tune the r-code execution environment for a
session.
Maximum Memory (-mmax) Use this parameter to set the initial execution buffer
ceiling. The default is 3096K. OpenEdge increases the
execution buffer dynamically as required, but only after
attempting to swap segments to the sort file. To
minimize swapping I/O, increase this parameter.
Directory Size (-D) Use this parameter to set the initial number of r-code
directory entries. OpenEdge can reuse directory entries
for inactive r-code files. However, reusing an entry
requires some overhead. To reduce this overhead,
increase the value of the -D parameter. The default is
100 entries, the minimum is 5 entries, and the maximum
is 500 entries.
Stack size (-s) When you load data definitions for very large tables or
use recursive procedures, you might receive an error
message directing you to increase this parameter. This
parameter changes the size of the stack (an internal
memory area used by Progress program modules).
For more information about these startup parameters, see OpenEdge Deployment: Startup
Command and Parameter Reference.
5–5
OpenEdge Deployment: Managing 4GL Applications
Table 5–2 lists the startup parameters you use to tune standard r-code libraries for a session.
PROLIB Swap (-pls) Use this parameter to allow swapping from a standard
library to a sort file. OpenEdge typically reads
library-stored r-code from the library instead of
swapping to a sort file. However, when storing the
library over a network, swapping to a local sort file
might be faster than accessing the remote library.
If you specify the PROLIB Memory (-plm) and PROLIB Swap (-pls) startup parameters with
memory-mapped libraries, OpenEdge ignores them.
For more information about these startup parameters, see OpenEdge Deployment: Startup
Command and Parameter Reference.
5–6
Managing Client Performance
Statistics (-y) Collects procedure access and usage statistics throughout the
Progress 4GL session and writes them to an output file (by
default, client.mon in your current working directory). Use
the SHOW-STATS statement at any time during the session to
instruct OpenEdge to write the statistics immediately.
Statistics with CTRL-C Collects the same statistics as the -y parameter, but lets you
(-yc) press CTRL-C as an alternative to executing the SHOW-STATS
statement. Use this parameter if you cannot execute
SHOW-STATS.
Segment Statistics (-yd) Collects r-code segment statistics and writes them to the
client monitor file (by default, client.mon in your current
working directory). It provides a breakdown of an r-code file
by segment type, including the number of segments and its
size. It also summarizes read and write access to the sort file
by segment type and access type, including the number of
times the sort file was accessed and the number of bytes read
from or written to the sort file.
For more information about these startup parameters, see OpenEdge Deployment: Startup
Command and Parameter Reference.
5–7
OpenEdge Deployment: Managing 4GL Applications
Figure 5–1 shows a sample excerpt from the output of the Statistics (-y) startup parameter.
The Reads from temp file and Writes to temp file fields show the amount of swapping to and
from the sort file. Segments are written to the sort file only once. Once swapped, they remain in
the sort file, even when they are reloaded into memory. For this reason, the number of writes is
typically much smaller than the number of reads. If these numbers are relatively high, consider
putting the sort files on a dedicated disk. For more information, see the “Temporary file I/O”
section on page 5–13.
5–8
Managing Client Performance
The R-code Execution Buffer field shows the current size of the execution buffer, the peak
usage during the session, and the current ceiling. Use the data in these fields to determine the
optimal initial ceiling for the execution buffer (that is, the point at which OpenEdge starts
swapping to the sort file). Set this value with the Maximum Memory (-mmax) startup
parameter. For more information, see the “Tuning r-code execution” section on page 5–5.
5–9
OpenEdge Deployment: Managing 4GL Applications
Figure 5–2 shows a sample excerpt from the output of the Segment Statistics (-yd) startup
parameter.
5–10
Managing Client Performance
The Per procedure temp file access statistics fields show the swap rates for each segment of each
procedure executed during the session. The Per procedure segment information fields show the
number and size of r-code segments in each procedure. Use this information to determine how
your application design is affecting r-code performance. For more information about
application design and r-code performance, see Appendix B, “R-code Features and Functions.”
• Procedure files
• Temporary files
• Log files
Make sure you copy the correct OpenEdge executables for your LAN protocol. Also, make sure
that the operating system on each node knows the new location of the files you copy. Set the
appropriate environment variables to point to that directory.
For operating systems with a PATH environment variable or other standard search list
convention (such as search directories set with the map command in NetWare), be sure that the
local OpenEdge installation directory appears before the file server OpenEdge installation
directory in the search order. You can do this in the startup file for each network node that
receives the OpenEdge system files.
5–11
OpenEdge Deployment: Managing 4GL Applications
Once you have distributed your procedure files, modify the PROPATH environment variable in
the startup files on each application workstation to include the directory search path that
contains those files. The following example sets the PROPATH environment variable to the
working directory (.) and the \ACCTPAY directory on the C: drive of a Windows workstation:
SET PROPATH=.;C:\ACCTPAY
In Windows, you can use the registry or progress.ini file to set this environment variable. For
more information, see Chapter 4, “Maintaining User Environments.”
For more information about temporary files, see the “Temporary file I/O” section on page 5–13.
For more information about the Temporary Directory (-T) startup parameter, see OpenEdge
Deployment: Startup Command and Parameter Reference.
5–12
Managing Client Performance
• Event log, which contains a history of significant database events, such as OpenEdge
startup and shutdown and system errors. This file always has a .lg extension. Place the
event log file in the same directory as the database file.
• Transaction log, if you are using the two-phase commit feature. The log records two-phase
commit transactions, and uses a .tl extension. The transaction log file belongs on the
same disk as the database.
• OpenEdge AppServer log, if you are using the OpenEdge AppServer option. The log
records OpenEdge AppServer broker and server startup and shutdown information, and it
contains other system messages that are not directed elsewhere with the OUTPUT TO
KEEP-MESSAGES statement. The default location of the AppServer log is the directory
where the application broker starts. For information about moving the AppServer log file,
see OpenEdge Application Server: Developing AppServer Applications.
File Description
5–13
OpenEdge Deployment: Managing 4GL Applications
By default, OpenEdge stores the temporary files in the user’s working directory. Use the
Temporary Directory (-T) startup parameter to specify an alternate location. When a session
ends, OpenEdge deletes these files unless you specify the Save Temp Files (-t) startup
parameter. For more information about the Temporary Directory (-T) and Save Temp Files (-t)
startup parameters, see OpenEdge Deployment: Startup Command and Parameter Reference.
On UNIX, unless you use the Save Temp Files (-t) startup parameter, you do not see the
temporary files in the directory, because they are created unlinked. However, if your system
crashes, the UNIX file system recovery program, fsck, finds the files. This program might then
prompt you to delete the files. If this occurs, delete them.
On Windows, these temporary files are always visible during a Progress 4GL session, but the
file sizes are set to zero. Windows does not record file sizes until files are closed.
Writing to these temporary files creates I/O activity that might slow down client performance.
The amount of temporary file I/O activity varies among applications.
You might find that running a particular procedure results in OpenEdge abnormally terminating
in a way that indicates the hard disk is full. However, when you check the disk immediately
afterward, adequate space is available. One possibility is that temporary files created during a
Progress 4GL session become quite large, taking up disk space as they expand. Since OpenEdge
erases temporary files at the end of a session, they do not appear when you check the disk. Of
the temporary files, the following files are most likely to cause this problem:
• Temp table file (.dbi) — OpenEdge uses this file to store temporary tables. If the
application uses a lot of temporary tables, this file can grow quite large.
• Local before-image file (.lbi) — OpenEdge uses this file to back out of subtransactions
and variable value changes. If the local before-image file becomes too large, the
procedures probably use a lot of subtransactions. Examine the transaction structure of the
application procedures to understand why OpenEdge starts so many subtransactions. For
more information about transaction processing, see OpenEdge Development: Progress
4GL Handbook.
• Session sort file (.srt) — OpenEdge uses this file to dynamically swap r-code segments
in and out of the execution buffer. Use the r-code usage statistics startup parameters to
collect information about I/O to the sort file, as explained in the “Monitoring r-code
activity” section on page 5–7. Using r-code libraries helps reduce the amount of I/O
required to load r-code files. For more information, see the “Using r-code libraries to
improve r-code performance” section on page 5–2.
5–14
Managing Client Performance
If temporary files grow to exceed disk space, change the application to reduce the size of
temporary files, or use the Temporary Directory (-T) parameter to store the temporary files on
a disk with sufficient space to hold the files. To optimize performance, place the temporary files
on a dedicated disk.
Sorting I/O
Table 5–5 lists the startup parameters you use to improve performance when sorting records for
reports and during index rebuild operations.
Speed Sort (-TB) Increase this parameter to 8K, 16K, or even 31K, particularly
for index rebuild operations. Increasing this parameter
increases memory usage during sorting and index rebuilds. It
also slightly increases disk space usage.
Merge Number (-TM) Increase this parameter to 32 to speed the merge phase of the
sort process (at the cost of increased temporary memory
usage).
For more information about these startup parameters, see OpenEdge Deployment: Startup
Command and Parameter Reference.
5–15
OpenEdge Deployment: Managing 4GL Applications
5–16
6
Managing R-code Libraries
A Progress 4GL r-code library is a collection of r-code procedures combined in a single file. It
is similar to an object library in DOS or an archive file in UNIX. However, object libraries and
archive files are used solely for efficient storage. R-code libraries allow you to manage and
execute r-code procedures more efficiently.
• Library overview
• Setting up a library
Library overview
OpenEdge provides two types of r-code libraries: standard and memory-mapped. A standard
library contains r-code procedures that execute in local memory. A memory-mapped library
contains r-code procedures that execute in shared memory.
When you execute r-code procedures from either a standard library in local memory or a
memory-mapped library in shared memory, you gain the following advantages:
When you execute r-code procedures from a memory-mapped library in shared memory, you
gain the following additional advantages:
• Requires less memory because multiple users access the same r-code segments in shared
memory.
When loading and executing r-code procedures from operating system files in a directory,
OpenEdge must open and close each file individually. When loading and executing r-code
procedures from standard or memory-mapped libraries, OpenEdge opens only one file—the
library itself—to access all of the r-code files in the library.
The r-code files that you place in a library are called members. OpenEdge opens a library the
first time you run a member procedure from the library. The library stays open until the end of
your Progress 4GL session or until you remove the library from the PROPATH. For more
information about how standard and memory-mapped libraries interact with PROPATH during
a Progress 4GL session, see the “Libraries and PROPATH” section on page 6–9.
For information about monitoring and optimizing r-code execution during a client session, see
Chapter 1, “Progress 4GL Client Deployment Overview.” For more information about r-code
structure and execution, see Appendix B, “R-code Features and Functions.”
6–2
Managing R-code Libraries
Standard r-code
Execution buffer
in local memory
ADDCUST.R
Client
ADDCUST.R file
process
Sort file
(1 per user)
As shown in Figure 6–1, when a client process accesses an r-code procedure from an operating
system file, OpenEdge loads the procedure into local memory for that individual client and
executes the segments from local memory. OpenEdge swaps segments to the session sort file,
and reloads segments from the session sort file, as necessary.
6–3
OpenEdge Deployment: Managing 4GL Applications
Figure 6–2 shows the load operation when executing an r-code procedure from a standard
library.
Execution buffer
in local memory
Client APPL.PL
ADDCUST.R
process Llbrary
As shown in Figure 6–2, when a client process accesses an r-code procedure from a standard
library, OpenEdge loads the procedure into local memory for that individual client and executes
the segments from local memory. OpenEdge does not swap segments to and from the session
sort file unless you specify the PROLIB Swap (-pls) startup parameter. By default, OpenEdge
reloads segments from the open library in local memory.
6–4
Managing R-code Libraries
Figure 6–3 shows the load operation when executing an r-code procedure from a
memory-mapped library.
Client
process
A APPL.PL
ADDCUST.R
Client library
process
B
As shown in Figure 6–3, when one or more client processes access an r-code procedure in a
memory-mapped library, they access the same segments in shared memory. Because OpenEdge
executes the segments from the mapped library in shared memory (not local memory), no
reloading is necessary. If you specify the PROLIB Swap (-pls) startup parameter with
memory-mapped libraries, OpenEdge ignores it.
6–5
OpenEdge Deployment: Managing 4GL Applications
Setting up a library
This section provides step-by-step instructions for setting up a library using the PROLIB utility.
To set up a library:
1. Create the standard library with the PROLIB utility. (All libraries must have a .pl
extension.)
2. Add the r-code files to the library with the PROLIB utility.
3. If you are setting up a memory-mapped library, use the PROLIB utility to generate the
memory-mapped library from the standard library.
For more information about the PROLIB utility, see the “Using the PROLIB utility” section on
page 6–11. For more information about placing libraries in the PROPATH, see the “Libraries
and PROPATH” section on page 6–9.
To run a procedure from an operating system file in a specific directory, reference the procedure
using an absolute pathname. For example:
RUN /usr/appl/addcust.r
6–6
Managing R-code Libraries
To run a procedure from a library in a specific directory, reference the library and procedure
using an absolute pathname. For example:
RUN /usr/appl.pl<<addcust.r>>
When you reference a procedure in a specific library, you must enclose the member name in
double angle brackets as shown.
When you reference a procedure in either an operating system file or an unspecified library
using a relative pathname, OpenEdge searches each directory and library defined in the
PROPATH until it finds the first occurrence of the procedure. For example:
RUN mydir/appl/addcust.r
When you reference a procedure in a specific library using a relative pathname, OpenEdge
searches the PROPATH until it finds the first occurrence of the library. For example:
RUN mydir/appl.pl<<addcust.r>>
When you reference a procedure in a specific library, you must enclose the member name in
double angle brackets as shown.
The most flexible way to find procedures is to specify relative pathnames for all procedures run
in your application. This allows you to put a procedure into a library for production, but
maintain separate procedure and r-code files during development. In a development
environment, either place the library in the PROPATH after your development directories or
omit it from the PROPATH entirely. In a production environment, place the library at or near
the beginning of the PROPATH to avoid long searches.
Note: OpenEdge cannot find procedure files in a library; it can find only r-code files.
6–7
OpenEdge Deployment: Managing 4GL Applications
For more information about how libraries interact with PROPATH, see the “Libraries and
PROPATH” section on page 6–9. For more information about the RUN statement, see OpenEdge
Development: Progress 4GL Reference.
Related functions
If a file is in a library, the SEARCH function returns the file’s pathname using the following
syntax:
library-pathname<<member-name>>
For example:
/usr/dictionary/dictionary.pl<<dict.r>>
Other Progress functions make use of this syntax. The LIBRARY function parses the pathname
and returns the name of the library (in this example, /usr/dictionary/dictionary.pl). If the
argument to LIBRARY is not in the form library-pathname<<member-name>>, the LIBRARY
function returns the unknown value (?). This is also true of the MEMBER function, which parses
the pathname and returns the name of the member file (in this example, dict.r).
For more information about the SEARCH, LIBRARY, and MEMBER functions, see OpenEdge
Development: Progress 4GL Reference.
6–8
Managing R-code Libraries
• The first time you run a member procedure from a standard or memory-mapped library
that is specified in the PROPATH, OpenEdge locates the procedure by searching through
each directory and library in the PROPATH until it finds the procedure. To search a library
for a member procedure, OpenEdge must open the library. When OpenEdge opens a
standard library, it loads the procedure into local memory. When OpenEdge opens a
memory-mapped library, it maps the library in shared memory.
• When searching through directories and libraries in the PROPATH, OpenEdge starts at the
beginning of the PROPATH and searches each directory and library, in defined order, until
it finds the procedure. Thus, placing the library at the beginning of the PROPATH
improves performance.
• A library remains open until the end of your Progress 4GL session or until you remove the
library from the PROPATH. If you remove a library from the PROPATH while a member
procedure is still active (either running, or waiting for a subprocedure to return),
OpenEdge displays an error message and the library remains open until you end your
Progress 4GL session. Otherwise, OpenEdge closes a standard library and unmaps a
memory-mapped library.
• If you use a SEARCH or RUN statement to open a library that is not in the PROPATH, the
library remains open until you end your Progress 4GL session.
• If you use libraries, OpenEdge accesses r-code files as if you had specified the Quick
Request (-q) startup parameter. That is, OpenEdge searches the PROPATH only on the
first reference to a procedure. Thereafter, if the procedure still resides in memory, in the
local session compile file, or in an r-code library, OpenEdge reuses the procedure instead
of searching the PROPATH again. For more information about the Quick Request (-q)
startup parameter, see OpenEdge Deployment: Startup Command and Parameter
Reference.
Note: To ensure that all users access the same memory-mapped library in shared memory, each
user must place the library in their PROPATH using the same library pathname.
For more information about running procedures from a library, see the “Running procedures
from a library” section on page 6–6.
6–9
OpenEdge Deployment: Managing 4GL Applications
By default, OpenEdge tries to load the entire directory of each library into memory. In some
cases, you might not have enough available memory to store a library’s entire internal directory.
Use the PROLIB Memory (-plm) startup parameter to limit the size of a standard library’s
internal directory in memory. This parameter allocates a 512-byte cache for a standard library’s
directory. This parameter is especially useful when running in limited memory with several
libraries opened simultaneously. If you specify the PROLIB Memory (-plm) startup parameter
with memory-mapped libraries, OpenEdge ignores it.
If you run OpenEdge over a network and place a standard library on a file server, remote reads
from the library might take longer than reading an r-code procedure and storing it locally in the
session sort file. Use the PROLIB Swap (-pls) startup parameter to store standard library r-code
procedures locally in the session sort file. If you specify the PROLIB Swap (-pls) startup
parameter with memory-mapped libraries, OpenEdge ignores it.
For more information about the PROLIB Memory (-plm) and PROLIB Swap (-pls) startup
parameters, see OpenEdge Deployment: Startup Command and Parameter Reference.
6–10
Managing R-code Libraries
Operating
system Syntax
UNIX
Windows
prolib library-name parameter [ file-name ... ]
library-name
Specifies the name of an r-code library. The library name must have a .pl extension.
parameter
Specifies what action to take on the library. Table 6–1 lists the parameters and their
descriptions.
Parameters Description
-list Lists library information such as library name, format, code page,
and file contents.
-extract Extracts files from a standard library. This parameter copies a file
from the library into another file, outside of the library, and gives it
the same name.
-yank Extracts files from a standard library and places them in the current
working directory.
6–11
OpenEdge Deployment: Managing 4GL Applications
Parameters Description
-nowarn Suppresses any warning message that might occur during the
operation of the primary parameters. If you add a file to a standard
library with the -add and -nowarn parameters, and the file already
exists in the library, PROLIB replaces the file.
-date Specifies the format of the date as it appears when you use the -list
parameter.
When specifying a parameter, you do not have to type the complete parameter name. You
can type the minimally unique string for each parameter (for example, -l for -list and
-e for -extract).
The -nowarn and -verbose parameters modify the behavior of the -create, -makeshared,
-add, -replace, -delete, -list, -extract,and -yank parameters.
You can place the -nowarn, -pf, and -verbose parameters anywhere on the command
line. They affect the processing of all other specified parameters.
You must place the -create parameter before all other parameters. PROLIB processes
parameters in left-to-right order as they appear on the command line. If an error occurs
during the PROLIB command, PROLIB terminates. This behavior occurs so that options
specified later in the command line, which might depend on the failed option, do not
execute.
You cannot use the -add, -replace, -delete, -extract, -yank, or -compress parameters
with a memory-mapped library (that is, when you specify a memory-mapped library in
library-name).
file-name
Specifies the name of an r-code file, or a memory-mapped library file when using the
-makeshared parameter.
6–12
Managing R-code Libraries
The -add and -replace parameters act on operating system files. PROLIB uses system calls to
copy the files. Thus, when you use these parameters, use your operating system’s standard
conventions to specify wild cards.
The -extract, -list, -delete, and -yank parameters act on files that are already placed in a
library. PROLIB does not use system calls to act on the files, but instead uses its own internal
code. On UNIX, you must escape your wild card arguments by either enclosing them in quotes
(for example, prolib app.pl -delete "sys*.r") or escaping the wild card characters
individually (for example, prolib app.pl -delete sys\*.r). Your operating system might
use different techniques to escape wild cards. In Windows, you do not need to escape wild card
arguments because the operating system does not expand them before passing them to PROLIB.
Operating
system Syntax
All libraries must have a .pl extension. You can add libraries to the PROPATH
environment variable by specifying the file’s absolute or relative pathname.
codepage-name
Specifies the name of the code page for the library you want to create.
6–13
OpenEdge Deployment: Managing 4GL Applications
A library can contain r-code procedures with different code pages. All r-code procedures
retain their respective code pages.
If you do not specify the -codepage parameter at creation time, OpenEdge marks the
r-code library with the code page specified in the Internal Code Page (-cpinternal) startup
parameter.
For information about code page compatibility, see the “Code page compatibility” section
on page 6–23.
Operating
system Syntax
standard-library-name
Specifies the name of the standard library from which to generate the memory-mapped
library. The library name must have a .pl extension. You can add libraries to the
PROPATH environment variable by specifying the file’s absolute or relative pathname.
Note: Save the standard library. It is the source of modification for the memory-mapped
library. Each time you modify the standard library you must regenerate the
memory-mapped library.
mapped-library-name
Specifies the name of the memory-mapped library you are generating. The library name
must have a .pl extension.
6–14
Managing R-code Libraries
PROLIB generates a memory-mapped library with the standard library’s code page. All text
segments in all r-code procedures retain their respective code pages.
For information about code page compatibility, see the “Code page compatibility” section on
page 6–23.
Operating
system Syntax
library-name
Specifies the name of the library where you want to add the file.
file-name
Specifies the pathname of the file. You can add a file to a library by specifying the file’s
absolute or relative pathname.
When you add a file to a library, the library entry for that file retains the entire pathname. For
example, enter a file into a library called newlib.pl using the following command:
The pathname /usr/apps/proc1.r appears in the library’s table of contents. You can display
the library’s table of contents with the -list parameter.
When you extract a file from a library, PROLIB copies the file into the directory specified by
the pathname (in this example, /usr/apps). See the “Extracting files from a standard library”
section on page 6–19 for more information.
If you try to add a file that already exists, PROLIB displays an error message. However, if you
specify the -nowarn parameter, PROLIB replaces the existing file. See the “Replacing files in a
standard library” section on page 6–16 for more information.
6–15
OpenEdge Deployment: Managing 4GL Applications
Operating
system Syntax
library-name
Specifies the name of the library with the file you want to replace.
file-name
When you replace a file, the system overwrites the old file with a file of the same name.
Therefore, the pathname you supply for the file has to be the same as the pathname you used
originally to add the file to the library. If you try to replace a file that does not exist, PROLIB
displays an error message. However, if you specify the -nowarn parameter, PROLIB adds the
existing file to the library. See the “Adding files to a standard library” section on page 6–15 for
more information.
Operating
system Syntax
library-name
Specifies the name of the library with the file you want to delete.
file-name
Specifies the name of the file. You can specify more than one file at a time.
6–16
Managing R-code Libraries
Operating
system Syntax
library-name
Specifies the name of the library with the contents you want to list.
file-name
Specifies that PROLIB should list information about that file only; file-name has to be
the same absolute or relative pathname as when you originally add the file. You can
specify more than one file at a time.
Table 6–2 lists the information that appears in the header section of the output.
Information Description
Code Page The code page in which the library was created.
Format The format of the library. The valid library formats are STANDARD and
MAPPED.
6–17
OpenEdge Deployment: Managing 4GL Applications
Table 6–3 lists the information that appears in the output for each file in the library.
Information Description
Type The file type. PROLIB recognizes two file types: R (r-code file type)
and O (any other file type). Although libraries are specifically
designed to hold r-code files, you can place any type of file in them.
Offset The distance, in bytes, of the start of the file from the beginning of the
library.
Added To Lib The date and time the file was entered into the library.
You can also change the format of the dates as they appear in the
Modified and Added To Lib fields with the -date parameter, where
date-format is three letters: m (month), d (day), and y (year). To
specify a format, place the letters in the order you want the months,
days, and years to appear on screen. The default is mdy.
6–18
Managing R-code Libraries
Operating
system Syntax
library-name
Specifies the name of the library with the file you want to extract.
file-name
Specifies the name of the file. You can specify more than one file at a time.
Note: You must create all subdirectories required by a library before trying to extract files from
the library. You can see what directories and subdirectories a library needs by using the
PROLIB -list parameter to view the contents of the library.
When you extract a file from a library, PROLIB copies the file and places it in its original
directory. Depending on how you add a file to a library, PROLIB extracts differently:
• If you added the file by specifying a relative pathname, PROLIB searches your current
working directory for the subdirectory indicated in the pathname. For example, if you
added a file by using the relative pathname apps/proc1.r, PROLIB searches your current
working directory for the subdirectory apps. If the directory does not exist, PROLIB
displays an error message.
• If you added the file by specifying its absolute pathname, PROLIB searches for the
original directory. If the directory does not exist, PROLIB displays an error message.
Note: If you specify the -yank parameter instead of -extract, OpenEdge strips everything but
the filename from the pathname and places the file in your current directory.
6–19
OpenEdge Deployment: Managing 4GL Applications
If the file you are extracting (or yanking) already exists in the directory outside of the library,
PROLIB displays the following message:
where file-name is the pathname of the file you are extracting (or yanking). If you answer yes,
PROLIB overwrites the file. If you answer no, PROLIB does not overwrite the file. If you
answer rename, PROLIB displays the following message:
where file-name is the pathname of the file you are extracting (or yanking). After you enter the
pathname, PROLIB gives the file the new pathname and places it in the appropriate directory.
To extract files from a library using the -yank parameter, enter the following command:
Operating
system Syntax
library-name
Specifies the name of the library with the file you want to extract.
file-name
Specifies the name of the file. You can specify more than one file at a time.
6–20
Managing R-code Libraries
Operating
system Syntax
library-name
Specifies the name of the library you are compressing. The -compress parameter removes
extra spaces that occur in the library as a result of repeated adds or deletes.
To compress a library, PROLIB creates a temporary file that requires an area of disk space equal
to the size of the compressed library. Before compressing a library, make sure you have enough
disk space for the temporary file. Temporary files have names that begin with the letters PLB,
followed by numbers and possibly letters.
If your system goes down during a compress operation, the temporary file might remain on your
disk. Delete this file to free up disk space. The original library will not be damaged.
Repeated adds create empty spaces in the library over time. To minimize the rate at which these
empty spaces are created, you can use one command instead of many. For example, instead of
entering the following commands:
You can use the -list parameter to determine how much space in your library is unused.
6–21
OpenEdge Deployment: Managing 4GL Applications
The following example creates a standard library called app.pl in your current directory:
The following example adds all the r-code files in the current directory that begin with the
letters sys to the standard library app.pl. In this example, the r-code files are in a directory, so
the operating system processes the wild card argument:
The following example deletes all r-code files ending with the letters dev from the standard
library app.pl and lists all of the files in the library. In this example, the r-code files are in the
app.pl library, so PROLIB processes the wild card argument. This requires escaping the
*dev.r argument. On UNIX, this means placing quotes around it. Your operating system might
use different techniques to escape wild cards:
The following example replaces the files appmenu.r and apprept.r in the standard library
app.pl, then compresses the library to free up unused disk space:
The following example creates a standard library called app.pl in your current directory, adds
all the r-code files in the current directory that begin with the letters sys to the library app.pl,
and generates a memory-mapped library called app_map.pl:
6–22
Managing R-code Libraries
If the code page for a standard r-code procedure, from either an operating system file or a
standard library, is not the same as the session’s internal code page, OpenEdge performs an
in-memory conversion of the r-code text segments to the session’s internal code page.
Note: If you use the R-code In Code Page (-cprcodein) startup parameter to specify a code
page for reading r-code text segments, OpenEdge reads the text segments as if they were
written in that code page, even if the text segments were written in a different code page.
For more information about the Internal Code Page (-cpinternal) and R-code In Code Page
(-cprcodein) startup parameters, see OpenEdge Deployment: Startup Command and
Parameter Reference.
6–23
OpenEdge Deployment: Managing 4GL Applications
6–24
7
Managing Print Devices
System administrators are responsible for setting up and maintaining the output devices
required by an application. Most OpenEdge applications access printers to print reports or other
output. This chapter provides an overview of how to set up print devices on
OpenEdge-supported operating systems. It also describes how to use OpenEdge to set up and
control output routing and printing characteristics.
• Printing in OpenEdge
• Printing on UNIX
• Printing in Windows
• Setting up output-routing
• Configuring a printer
OpenEdge Deployment: Managing 4GL Applications
Printing in OpenEdge
Most operating systems support two general printing techniques: direct printing and spooled
printing. Direct printing sends application output directly to a printer set up on the operating
system. This technique of printing is frequently found on single-user systems. However, you
can use direct printing in other situations (for example, printing tickets and special forms).
Spooled printing sends application output to a temporary file and places a print request in a print
queue set up on the operating system. Spooling permits you to queue a print request and
continue processing; the system executes the print request when a printer becomes available. A
spooled device can help balance the demand on line printers if you are running applications on
a time-shared system.
OpenEdge runs with most printers and, depending on the operating system in use, makes default
assumptions about printer setup. OpenEdge uses the printer port or spooler named at execution
time, not at compile time. Thus, precompiled OpenEdge applications work regardless of the
printer port or spooler in effect.
This section provides an overview of the Progress language elements you can use to direct
application output, which includes the:
• OUTPUT TO statement
7–2
Managing Print Devices
OUTPUT TO statement
By default, all OpenEdge output is directed to the terminal. The OUTPUT TO statement allows an
application to redirect output to other output devices. Following is a partial syntax example of
the OUTPUT TO statement:
[ PAGED ]
[ PAGE-SIZE { constant | VALUE ( expression ) }]
.
.
.
Use the OUTPUT TO statement with the PRINTER option to send output to the default print device
on the current operating system. For example:
OUTPUT TO PRINTER.
On UNIX, the OUTPUT TO PRINTER statement sends output to the default spooler. To use a
spooler other than the default, start OpenEdge using the Printer (-o) startup parameter.
In Windows, the OUTPUT TO PRINTER statement sends output to the printer defined in default
print context. The default print context is the set of values that defines the default printer and
setup for that printer in Windows. If there is no default print context, OpenEdge uses the printer
control settings from the current environment.
7–3
OpenEdge Deployment: Managing 4GL Applications
Use the SYSTEM-DIALOG PRINTER-SETUP statement to display the Windows Print dialog box and
let the user change the default print context at runtime. Use the PRINTER-NAME attribute of the
SESSION system handle to change the printer name in the default print context without user
intervention. You can change the system default printer from the Windows Control Panel.
Use the OUTPUT TO PRINTER statement with its various options to override the default print
context for a specific print job. For example, send output to a printer other than the default
printer by using the following syntax:
OpenEdge assumes that all printers can handle hard-coded form feed characters (CTRL-L or 0C
Hex). The OUTPUT TO PRINTER statement automatically paginates OpenEdge output on the
default printer. To paginate output on a printer, other than the default printer, use the OUTPUT TO
PRINTER statement with the PAGED or PAGE-SIZE option.
Use the Printer (-o) startup parameter to specify a default printer to use when processing the
OUTPUT TO PRINTER statement in procedures. The specified printer must be set up on the current
operating system.
7–4
Managing Print Devices
You can also use the OUTPUT THROUGH statement to access spooling capabilities on UNIX
systems. For example, this command sends output to the printer named lw on a UNIX system:
For a complete description of the OUTPUT THROUGH statement, see OpenEdge Development:
Progress 4GL Reference.
Printing on UNIX
Since UNIX is a multi-tasking operating system, print devices are usually spooled. However, it
is possible to print directly to a device that is not spooled. This section describes the setup of
spooled print devices on UNIX System V and Berkeley 4.n systems. The default spooler name
for all systems that run UNIX System V is lp. The default spooler name for all other UNIX
systems, including Berkeley 4.n, is lpr.
To set up a printer on a UNIX System V system, make sure that the lp system and the printer
hardware are installed and that the LP scheduler is shut down. The LP scheduler services print
requests for all destinations by routing requests to the interface programs that do the printing on
devices. The LP scheduler is usually started when you boot your system. To shut down the LP
scheduler, use the lpshut command. After you log in as the root user, you can set up a printer
on a UNIX System V system.
1. Install and configure a device in the /dev directory. Make sure the device is not configured
as a login terminal.
2. Use the lpadmin command to set up a new printer. This command allows you to specify a
printer name and a printer-interface program, and connects them with a print device that
exists in the /dev directory.
3. Use the lpsched command to start the LP scheduler once the printer has been set up.
4. Use the accept and enable commands to let the printer accept print requests and enable
spooling for the printer.
7–5
OpenEdge Deployment: Managing 4GL Applications
To set up a printer on a UNIX Berkeley 4.n system, make sure that the lpr system and the
printer hardware are installed and that the lpd daemon is running. The lpd daemon is the master
server that services print requests and routes them to the proper spooling directories for printing.
The lpd daemon usually starts when you boot your system. After you log in as the root user, you
can set up the printer.
1. Install and configure a device in the /dev directory. Make sure the device is not configured
as a login terminal.
2. Edit the /etc/printcap file. This file contains definitions for all of the printers on a
system (or accessible over a network). Each printer definition in /etc/printcap does the
following:
3. Create the spooling directory and make sure the spooling directory and the directories of
the lpr system have the proper permissions and ownership.
4. Use the lpc start and lpc enable commands to let the printer accept print requests and
enable spooling for the printer.
Most UNIX System V or Berkeley 4.n systems have printer installation scripts that perform the
printer installation steps described in this section.
The OUTPUT TO PRINTER statement sends output to the UNIX system default spooler. To use a
spooler other than the default, start OpenEdge using the Printer (-o) startup parameter followed
by the name of the spooler. For example:
7–6
Managing Print Devices
Alternately, you can use the OUTPUT THROUGH statement to direct output to a spooler other than
the default spooler:
or:
With both the OUTPUT THROUGH statement and the Printer (-o) startup parameter, you can specify
UNIX spooler options for the spooler that you designate. If you want to specify spooler options
with the Printer (-o) startup parameter, surround the spooler name and options with quotes. For
example:
For more information about printing on UNIX, see the UNIX system documentation.
On TCP/IP networks, remote spooling is handled with two spooling queues, one on the local
machine and one on the remote machine.
1. Be sure that the required TCP/IP system files are set up on both the local and remote
machines. The local and remote machines have entries in their /etc/hosts and
/etc/hosts.equiv files to facilitate network operations.
7–7
OpenEdge Deployment: Managing 4GL Applications
3. Define an entry for the remote printer in the /etc/printcap file on the local machine.
This remote-printer entry must have an empty field for the lp capability, a remote machine
designation, a remote printer designation, and a remote spooler directory designation. The
remote printer that you define in the /etc/printcap file can be the default print spooler
for the local machine.
4. Create the spooling directory, then use the lpc start and lpc enable commands to
allow the remote printer to receive print requests and to enable spooling for the printer.
When you initiate a remote print job with lpr, the job is queued locally and a daemon process
is created to oversee the transfer of the job to the remote machine. If the destination machine is
unreachable, the job remains queued until it is possible to transfer the files to the spooling queue
on the remote machine.
1. Be sure that the Basic Networking Utilities (uucp) are installed on both the remote and
local machines. The Basic Networking Utilities use a series of files to define network
machines (L.sys), to set up communications mechanisms and characteristics (L.devices
and L-dialcodes), to determine what commands can be executed remotely (L-cmd), and
to set up network permissions (USERFILE). An entry is also required in the /etc/passwd
file on each network machine to allow uucp logins.
3. Create an executable script to use the uux command to enact a print job on the printer
attached to the remote node.
When you use the uux command to execute a remote print job, the network request is queued in
the local uucp spooling directory, permissions are checked, and the request is sent to the remote
machine. The remote machine places the print request in the spooling directory of the printer.
For more information about UNIX networks and printers, see the UNIX system administration
documentation.
7–8
Managing Print Devices
Printing in Windows
In Windows, you can choose either of two printing modes:
• Default mode.
In default mode, OpenEdge uses the Windows device drivers. This mode is sufficient for all
basic printing that does not use any printer access control codes, such as those sent by PUT, PUT
CONTROL, or DISPLAY statements.
In WPP mode, OpenEdge bypasses the Windows device drivers. This means you can send
control codes (such as POSTSCRIPT commands) directly to the printer with the PUT, PUT
CONTROL, or DISPLAY statements. To enable windows passthrough printing for a session, use the
Windows Passthrough Printing (-wpp) startup parameter. You can only use this parameter on
the command line.
You cannot use WPP mode with a POSTSCRIPT printer to print OpenEdge standard reports,
such as those produced by the Data Dictionary.
Note: When using windows passthrough printing under Windows95, you must change the
Spool Data Format from EMF spooling to RAW spooling. Use the Control Panel to
access the Printer Properties for the printer, then select Spool Setting from the Details
tab of the Printer Properties tab. Change the Spool Data Format to RAW spooling.
For a complete description of the PUT, PUT CONTROL, and DISPLAY statements, see OpenEdge
Development: Progress 4GL Reference. For more information about the Windows Passthrough
Printing (-wpp) startup parameter, see OpenEdge Deployment: Startup Command and
Parameter Reference.
7–9
OpenEdge Deployment: Managing 4GL Applications
Setting up output-routing
For systems with multiple printers, you might want to set up an output-routing scheme.
Output-routing schemes direct application output to different devices based on criteria that you
specify. Since OpenEdge uses the printer port or spooler named at execution time, not at
compile time, you can set up output-routing schemes to send application output to different
printers based on user identification, the type of procedure the user runs, or some other criteria.
When setting up an output-routing scheme, examine the application and system requirements.
For example, your system users might want to direct output to different printers. In this case,
you would have to set up an output-routing scheme based on the user identification. An
application might have reports that require different types of printers. For example, one report
might require a 132-character printer and another report might require an 80-character printer.
In this case, you would have to set up an output-routing scheme based on the report type.
Another output-routing scheme could direct output to different printers based on both the user
and the type of report.
7–10
Managing Print Devices
Figure 7–1 shows a sample application startup procedure on UNIX. This application startup
procedure designates lpr -Plw as the default print device for the current OpenEdge session and
starts up an OpenEdge application located in the /usr/appl1 directory that access a database
called appldb.
Figure 7–2 shows a sample application startup procedures on NT. This application startup
procedure designates LPT2 as the default print device for the current OpenEdge session and
starts up an OpenEdge application located in the /usr/appl1 directory that access a database
called appldb.
echo off
set APPL1=\usr\APPL1
set PROPATH=%PROPATH%;%APPL1%
%DLC%\_progres -D 20 -o LPT2 -p
\usr\APPL1\mainmenu.p appldb
After the startup procedures are set up for each system printer, you can designate users to use
different startup procedures depending on which output destination they want. For easy user
access and maintenance, all of the startup procedures should be located in the directory where
the system software is located.
7–11
OpenEdge Deployment: Managing 4GL Applications
Just as you can use Progress 4GL tables (_User) to set up security for OpenEdge applications,
you can also use Progress 4GL tables for output routing. If you want to route application output
to different printers based on user ID, set up a table in the application database containing each
of the valid user IDs and the corresponding print commands.
Usrprnt
userid outdev
The database table shown in the figure contains records that have a userid field and an outdev
field containing an operating system output device. The userid field is a unique primary index
for the table. You have to keep the Usrprnt table up to date with a record for each new user on
your system.
7–12
Managing Print Devices
After setting up the database table, create an include file that determines the current user ID and
then searches the Usrprnt table for a matching user ID and corresponding output device. For
example:
The include file searches the Usrprnt table for a record that has a user ID that matches the user
ID established for the current application session. If there is no user ID match or established user
ID for the application session, OpenEdge uses the default system printer. If there is a match,
OpenEdge sends the application output to the output device contained in the corresponding
outdev field.
The VALUE option of the OUTPUT THROUGH statement allows you to designate a substitutable
output device. The USERID function allows you to capture system user IDs on UNIX. For more
information about the _User table, see OpenEdge Data Management: Database Administration.
After creating an include file to route application output, replace all OUTPUT statements in your
application with the include file. For example:
{output1.i}.
7–13
OpenEdge Deployment: Managing 4GL Applications
Configuring a printer
Many printers have a set of control sequences that you can use to specify different print
characteristics, such as compressed printing or italics typeface. These control sequences often
involve special characters that can be represented by their octal (base 8) equivalent. To denote
these octal codes, precede the three octal digits with an escape character. On UNIX, the escape
character is a tilde (~) or a backslash (\). Table 7–1 lists the standard control sequences using a
tilde as the escape character.
~nnn Single character Use to send a single character to the printer, where
nnn is an octal code between 000 and 377. You
must specify all three digits.
~t Tab character Use to send the 011 octal code to the printer.
~r Carriage return Use to send the 015 octal code to the printer.
~n Line feed Use to send the 012 octal code to the printer.
~f Form feed Use to send the 014 octal code to the printer.
The PUT statement with the CONTROL option allows you to specify a control sequence that you
want to send to a printer. The PUT statement has the following syntax:
7–14
Managing Print Devices
In the following example, the control sequence ~017 turns on the compressed printing feature
of the current print device:
The control sequences sent to the output destination do not affect the current line, page counters,
and positions maintained within OpenEdge. For more information about the PUT CONTROL
statement, see OpenEdge Development: Progress 4GL Reference.
There is no easy way to employ a Progress UPDATE statement to interpret the printer-control
sequences and enter them into a printer-control table. For example, the Progress UPDATE
statement interprets the octal sequence ~017 as the character string:
[TILDE][ZERO][ONE][SEVEN]
[CONTROL-0]
You can create a system administration procedure that lets you convert printer-control
sequences into the appropriate ASCII character strings, and store the printer-control sequences
as ASCII character strings in the fields of a printer-control table.
7–15
OpenEdge Deployment: Managing 4GL Applications
Keep the printer-control table up to date with a record for each printer on your system. Figure
7–4 shows a sample printer-control table.
prntcfg
default ** ** ... ** ** **
lpr -Pcx1 ** ** ** ** **
lpr -Plw1 ** ** ** ** **
** The ASCII character strings stored in the table represent nonprintable characters and
cannot be viewed. Attempts to display them on a terminal can lead to unpredictable
results.
The field containing the print device name must index the table. In this sample control table, the
outdev field indexes the table.
To access the proper control sequences for a printer from a printer-control table, set up an
include file to determine the print device used in the application, then substitute the
corresponding control sequences into the PUT CONTROL statements of the application. For
example:
The include file searches the Usrprnt table to determine the output device (Usrprnt.outdev) for
the current user ID. After determining the output device, the include file searches the
printer-control table to find the appropriate control sequences for the current printer. Notice that
the printer-control table contains a default entry for the default printer.
7–16
Managing Print Devices
The PUT CONTROL statements in your application should use a field in the printer-control table
or a variable name to access the proper control sequence for the current printer. This allows you
to change print devices without recoding the printer-control sequences for all the PUT CONTROL
statements in your application. For example:
{output2.i}.
In this procedure, the first PUT CONTROL statement turns on compressed printing, and the second
PUT CONTROL statement turns off compressed printing for the current print device.
7–17
OpenEdge Deployment: Managing 4GL Applications
7–18
Part II
Developer’s Toolkit
Chapter 8, Introduction
The Developer’s Toolkit is a product that helps you deploy applications written in the Progress
4GL. It contains several utilities, procedures, and scripts to help you prepare OpenEdge
applications for wider distribution. The Developer’s Toolkit documentation describes:
• Different Progress 4GL code formats and how they affect deployment.
• Upgrading applications.
Toolkit components
You can use the following set of Developer’s Toolkit components when deploying OpenEdge
applications:
• DBRSTRCT utility
Use the DBRSTRCT utility to specify the kinds of access the user has to an application
database.
• MKDUMP utility
• XCODE utility
Use the XCODE utility to encrypt your source procedures for shipment to the user. Users
can compile your procedures against their existing databases without the ability to read the
contents of the procedures.
• BUNDLE utility
Use the BUNDLE utility to put binary files into a file called a bundle, then transport the
bundle to another machine using FTP, tape, or some other mechanism, and extract the files
from the bundle.
• Toolkit templates
Use these templates to perform various tasks related to deploying OpenEdge applications.
See Chapter 12, “Deployment Topics and Tasks,” and Appendix D, “Toolkit Contents and
Reference,” for more information about these components.
8–2
9
Choosing a Code Format
Choosing a code format is the fundamental decision that you must make about deploying an
application. This chapter describes the three types of code format, the OpenEdge product
requirements for those code formats, and the advantages and disadvantages of each format in
the following sections:
• Unencrypted source
• Encrypted source
Unencrypted source
Unencrypted source is uncompiled source that users can read and edit with any standard text
editor. Users with full compilation capabilities can read and modify unencrypted source. Thus,
when you choose to deploy using unencrypted source, you give users unrestricted access to your
application code and application database.
The following sections provide information about the requirements for using unencrypted
source, and discuss some advantages and possible disadvantages to deploying unencrypted
source.
• Application extendability.
Since users have full access to your source code and full compilation capabilities, they can
modify your application code any way they want.
Other code formats require you to manage multiple code trees and might require you to
keep multiple copies of your application database.
9–2
Choosing a Code Format
When you choose unencrypted source, deploying your application is usually easier than
with other code formats. Chapter 10, “Initial Deployment,” describes the steps required for
each code format.
• Simpler upgrades.
When you choose unencrypted source, upgrading your application is usually less complex
than with other code formats. Chapter 11, “Upgrades,” describes the steps required for
each code format.
• Easier maintenance.
Since users have full development environments, it is relatively easy to modify or enhance
your application at their sites.
• Full portability.
Both unencrypted and encrypted source are completely portable across platforms and user
interfaces (character mode and GUI), provided you have followed the necessary
guidelines for writing portable applications. This is not true for r-code, which is not
portable across user interfaces.
Unencrypted source files usually occupy much less storage space than r-code files,
decreasing their physical media shipment costs. (Encrypted source files also have this
advantage over r-code files.)
Users can modify the application source, which can potentially cause difficulty when
applying application upgrades.
Unencrypted source does not protect your application from the user. Many Independent
Software Vendors (ISVs) do not want the user to be able to see their code.
9–3
OpenEdge Deployment: Managing 4GL Applications
Many ISVs do not want users to modify their application database. If you deploy using
unencrypted source, you lose the ability to prevent unwanted changes. Users can modify
your application and application database any way they want.
Only r-code can contain multiple text segments for different spoken languages. For more
information, see OpenEdge Development: Translation Manager.
Users might create bugs when they modify the source code.
Encrypted source
Encrypted source is source code that is encrypted with the XCODE utility (provided with the
Developer’s Toolkit). The user cannot make changes to encrypted source code because it is not
readable by the user, so encrypting the source code protects your application.
The following sections provide information about the requirements for using encrypted source
and discuss some advantages and possible disadvantages to deploying encrypted source.
9–4
Choosing a Code Format
• Application protection.
Because encrypted source cannot be read by users, it protects your application from users
by preventing them from making changes. Encrypted source shares this advantage with
r-code, which is also not user-readable.
Encrypting source code requires storing two code trees: the unencrypted source tree and
the encrypted source tree (which must be kept in a parallel directory structure). While this
is twice what is required with unencrypted source, it is still less than what is required for
r-code.
• Full portability.
Like unencrypted source, encrypted source is completely portable across platforms and
user interfaces (character mode and GUI). This is not true of r-code, which is not portable
across user interfaces.
• Compile-time flexibility.
Because encrypted code is not precompiled, your application can take advantage of
compile-time functionality. For example, you might want to pass arguments to include
files to determine sort order, field lists, etc. You can take advantage of this behavior at the
user site, allowing users to specify their preferences before compilation. This option is not
available with r-code, which you must compile at the development site.
If users have full development OpenEdge products, they can modify their indexes without
invalidating your application code (provided that you have not explicitly named indexes
in your code). This flexibility is not available with r-code. R-code that specifically
references a new or changed index will not work. Because the index Cyclic Redundancy
Check (CRC) value is checked at run time, not all r-code will be affected.
Time-stamp-based r-code is even more restrictive.
9–5
OpenEdge Deployment: Managing 4GL Applications
Encrypted source files usually occupy much less storage space than r-code files, making
your physical media shipment smaller and less expensive. (Unencrypted source files also
have this advantage over r-code files.)
• Encryption keys.
Encrypted source allows you to specify different encryption keys for different code trees
or subsystems within a code tree. Therefore, it is possible to deploy an entire application
at once, but only give the user encryption keys for certain parts of the application. This
way, you can upgrade the user’s application without physically distributing code a second
time.
• The Encrypted Compiler Mode (-rx) parameter changes the capabilities of the Compiler.
When you start OpenEdge with the -rx parameter, the Progress Compiler can compile
only encrypted source, not unencrypted source. If users have the 4GL Development
System, ProVISION, ProVISION Plus, or WebSpeed, they must start OpenEdge again
without the -rx parameter to write and compile their own procedures.
9–6
Choosing a Code Format
R-code
R-code, or run-time code, is precompiled code. When you compile a source procedure, Progress
places the compiled version of the procedure into a file that has the same name as the source
procedure with a .r extension. There are two types of r-code: time-stamp-based and
CRC-based. For a complete discussion of these two types of r-code, see Appendix B, “R-code
Features and Functions.”.
Like encrypted source, r-code is not readable to the human eye and therefore protects your
application from users attempting to make changes.
Note: If a procedure contains no code that writes to the screen, its r-code is portable
across user interfaces. This is typical, for example, of database schema trigger
procedures.
All machines that require 4-byte or less alignment are compatible. Thus, r-code compiled on one
of these machines (a Sun SPARCstation, for example) can run on most other machines. One of
the few machines not compatible with this class is the AS/400, which requires greater than
4-byte alignment.
Thus, you can use the same r-code compiled for a character interface and the ORACLE
DataServer on any compatible machine (for example, Sun SPARCstation and RS-6000) that
also accesses the ORACLE DataServer. Similarly, you can use the same r-code compiled in
Windows on any DataServer-compatible Windows system.
You must be able to reproduce the target environment to generate the required r-code. For each
combination, you have to keep track of a different code tree. For each combination, you also
require a full development OpenEdge product (the 4GL Development System, ProVISION,
ProVISION Plus, or WebSpeed) to do the compilations.
9–7
OpenEdge Deployment: Managing 4GL Applications
Advantages of r-code
R-code provides several advantages over other code formats:
• Speed
This format is faster because the R-code does not have to compile at run time.
• Application protection
Like encrypted source, r-code protects your application from possible user changes.
R-code is the only code format that can contain multiple text segments. This means that
the same application can contain strings for multiple spoken languages (French and
German, for example). For more information about translating OpenEdge applications,
see OpenEdge Development: Translation Manager.
9–8
Choosing a Code Format
With either r-code format, you can further restrict access to your application database with
the DBRSTRCT utility. This procedure restricts everyone’s access to the database,
including your own. After you run this procedure, no one can write or compile code that
updates the database or changes the database’s schema. The only code that can access the
database is r-code that you compiled before running the DBRSTRCT utility. This level of
database protection is available only with r-code. For more information about the
DBRSTRCT utility, see Chapter 12, “Deployment Topics and Tasks.”
The “Developer product requirements and r-code portability” section on page 9–7 earlier
in this chapter describes the limitations of r-code portability. Depending on the number of
incompatible environments requiring a separate compilation, you might have to keep track
of multiple r-code trees.
Because you deliver your application in a precompiled format, you cannot make use of
compile-time functionality. For example, you cannot pass arguments to include files to
determine sort order, field lists, etc. Users therefore cannot specify their preferences before
compilation.
R-code’s limited portability often requires you to manage multiple code trees for a single
version of a single application. As you modify or fix your application and create new
versions, the number of code trees can become quite large.
R-code is also tightly coupled with the application database. This tight coupling requires
you to keep a copy of all of your application databases that have different CRC values or
different time stamps (depending on which type of r-code you have). After numerous
upgrades and fixes, the number of databases can grow quite large.
9–9
OpenEdge Deployment: Managing 4GL Applications
When you modify the schema of your application database, you invalidate the existing
r-code because you change the database’s time stamps. To deploy an upgrade, therefore,
you must provide users with a new database (with the correct time stamps) for each new
version of the application. Users are then required to dump their old data and load it into
the new database. This is a time consuming process for larger databases. For very large
databases, the time required to perform a dump and load can be unacceptable. Progress
Software recommends that you use CRC checked sums instead of time stamps for more
flexibility.
9–10
10
Initial Deployment
This chapter provides an overview of the steps that are required to deploy an OpenEdge
application using different code formats. It does not cover every possible contingency, but
rather tries to give you a general understanding of the initial deployment process for the
different code formats. This chapter puts more emphasis on what to do, rather than how to do it.
These steps are not meant to be performed in a strictly chronological order. More detailed
information about particular aspects of deployment is provided in Chapter 12, “Deployment
Topics and Tasks.”
• Unencrypted source
• Encrypted source
• CRC r-code
OpenEdge Deployment: Managing 4GL Applications
When deploying application procedures, you can choose to deploy either unencrypted or
encrypted source code, or to deploy compiled r-code. An important consideration in which
method you choose is whether there is a full development product (4GL Development System,
ProVISION, ProVISION Plus, or WebSpeed) capable of compiling code at the deployment site.
Users with OpenEdge products that cannot compile unencrypted source code will have to
deploy encrypted source code and compile it at the site, or deploy r-code. If you deploy r-code,
you must ensure that the platforms, operating systems, and software versions at the deployment
site match those at the development site. Otherwise, you will have to compile the r-code at the
deployment site to ensure compatibility. The following sections address these considerations in
more detail.
10–2
Initial Deployment
Check compatibility:
Database Database
Platform
Operating System
OpenEdge version
Create: Create:
Application
.df files
Dump: database
.d files load:
.df files
.d files .df file
.d files
Database triggers OR
OR
R-code library
R-code library
(.r files)
Scripts Scripts
10–3
OpenEdge Deployment: Managing 4GL Applications
Unencrypted source
This section provides an overview of the steps to follow to deploy an application using
unencrypted source when you are done developing and testing your application.
You must dump your application schema (.df) and/or data (.d) into ASCII format. This
step copies your data from the application database, which is not portable, into a format
that is portable.
Keep in mind that the .d and .df files should be represented with the appropriate code
page for the target platform.
2. Transfer files.
You must transfer the resultant .d and .df files and your unencrypted source procedures
(which also must be in the appropriate code page) to the target platform. This is a
preliminary step to creating your distribution media.
There is more than one way to transfer files. For example, you can use FTP or other
protocols, such as CROSSTALK. Or you can put the files on tape or other storage media
and physically transport the files.
You must provide a way for users to build the application database at their site. To do this,
the users must be able to load your .df and .d files into an empty database.
Because you are deploying unencrypted source, users must have either the 4GL
Development System, ProVISION, ProVISION Plus, or WebSpeed products. These
products contain a complete Data Dictionary, which users can use to load the .df and .d
files into an empty database. (In character environments, the Data Dictionary contains data
administration capabilities. In Windows, these capabilities are provided with the Data
Administration tool.)
However, even though the user can perform these tasks, usually it is a good idea to write
a script that automates this process. This not only frees the user from performing this task,
but also makes your application easier to install. When you buy a full development
OpenEdge product, you get all of the Data Dictionary procedures in the
install-dir/src/gui|tty/product subdirectories. The procedures that load data
definitions and data are called load_df.p and load_d.p respectively. Within your script,
you can start OpenEdge and run these procedures to load your data definitions and data.
10–4
Initial Deployment
If you decide not to write a script and instead rely on the users’ ability to load the data
definitions and data, make sure you provide the users with adequate documentation to
guide them through the process.
To rebuild your application database at the user’s site, you must make a copy of the empty
database and rename it. An empty database is included in the installation directory at the
user’s site. Because databases are not portable, you must use an empty database that
already is ported to the target platform.
Users can copy their empty database and rename it. Or you can write a script that does this
task for them. This script can call the PRODB command to make a copy of the database
and rename it appropriately. The Developer’s Toolkit also provides a newdb script that
creates a database. For more information about this script, see Appendix D, “Toolkit
Contents and Reference.”
If you decide to let the users perform this step, you must provide adequate documentation
to guide them through the process.
You must provide a way for users to install your application. OpenEdge must be installed
before they can use your application. You can create one install for both OpenEdge and
your application. To do this, create an install program using a third-party tool, such as
Installshield, and call the OpenEdge Install batch mode from within it.
This step is optional because users must have either the 4GL Development System,
ProVISION, ProVISION Plus, or WebSpeed products, which can compile your
application on the fly. However, an application that is precompiled runs faster than an
application that is compiled at run time. Therefore, you might want to provide a routine
that compiles all of your procedures before it is run.
You can provide a script to do the compilations, or you can provide the user with adequate
documentation to do this task on their own. The Developer’s Toolkit provides a template
procedure, compile.p that you can use to compile your application.
Provide a way for users to start the application. You can either write a script to do this or
provide adequate documentation.
10–5
OpenEdge Deployment: Managing 4GL Applications
8. Provide documentation.
You must provide users with enough documentation to use your application and to
complete the above tasks if you do not automate them.
– All scripts.
10–6
Initial Deployment
Encrypted source
This section provides an overview of the steps to follow to deploy an application using
encrypted source when you are done developing and testing your application.
Before you can deploy your application, you must encrypt all of your procedures and
include files with the XCODE utility. For more information about how to do this, see the
“Encrypting source code procedures” section on page 12–2 in Chapter 12, “Deployment
Topics and Tasks.” Before encrypting the files, make sure they are represented with the
appropriate code page for the target platform.
As with unencrypted source, you must dump your application schema (.df) and/or data
(.d) files into ASCII format. This step copies your data from the application database,
which is not portable, into a format that is portable. You do not have to encrypt your .df
and .d files.
Like your procedure files and include files, the .d and .df files must be represented with
the appropriate code page for the target platform.
You must transfer the resultant .d and .df files to the target platform. This is a
preliminary step to creating your distribution media.
There is more than one way to transfer files. For example, you can use FTP or other
protocols, such as CROSSTALK. Or you can put the files on tape or other storage media
and physically transport the files.
After you encrypt procedures and include files, they become binary files.
You must provide a way for users to build the application database at their site. To do this,
users must be able to load your .df and .d files into an empty database.
10–7
OpenEdge Deployment: Managing 4GL Applications
Any OpenEdge client, server, or stand-alone database product can compile and run
encrypted source. However, only those products that can fully compile can load .d files
into a database. The 4GL Development System, ProVISION, ProVISON Plus, and
WebSpeed are the only products with this capability.
If you deploy to users whose licensed products do not have this capability, you must
provide a way for them to load your .d files. For more information about providing a
dump/load facility for users, see the “Dumping and loading” section on page 12–12.
Note: The dump/load procedures should be considered part of your application. The
decision to distribute encrypted source versions of your application procedures
applies to the dump/load procedures as well.
The 4GL Development System, ProVISION, ProVISON Plus, and WebSpeed products
contain a complete Data Dictionary, which users can use to load the .df and .d files into
an empty database. (In character environments, the Data Dictionary contains data
administration capabilities. In Windows, these capabilities are provided with the Data
Administration tool.) However, even though the user can perform these tasks, usually it is
a good idea to write a script that automates this process. This not only frees the user from
performing this task, but also makes your application easier to use.
Within your script, you can use pre-existing procedures in the install-dir/tty and
install-dir/gui directories (installed for full development OpenEdge products). Within
these directories are procedures that load .df and .d files, called load_df.p and load_d.p,
respectively. Your script can start OpenEdge and run these procedures to load your data
definitions and data. To run these procedures at the user site in the case where users do not
have a license for the 4GL Development System, ProVISION, or WebSpeed, the
procedures must be encrypted or in r-code format. This step is necessary because
OpenEdge must be started with the -rx parameter to run or compile the procedures where
users do not have a license. When started with this startup parameter, OpenEdge cannot
run or compile unencrypted source.
If you decide not to write a script and instead rely on the users’ ability to load the data
definitions and data, make sure you provide adequate documentation to guide them
through the process.
10–8
Initial Deployment
To rebuild your application database at the user’s site, you must make a copy of the empty
database and rename it. An empty database is included in the installation directory of all
OpenEdge client, server, or stand-alone database products. Because databases are not
portable, you must use an empty database that already is ported to the target platform.
Users can use OpenEdge to copy the empty database and rename it. Or you can write a
script that does this task for them. This script can call the PRODB command to make a
copy of the database and rename it appropriately. The Developer’s Toolkit also provides
a newdb script that creates a database.
If users have an OpenEdge product that provide these capabilities, and you decide to let
them perform this step, you must provide them with adequate documentation to guide
them through the process.
You must provide a way for users to install your application. OpenEdge must be installed
before they can use your application. You can create one install for both OpenEdge and
your application. To do this, create an install program using a third-party tool, such as
Installshield, and call the OpenEdge Install batch mode from within it.
When you deploy with encrypted source, you typically provide a compilation routine.
Though this is not necessary in all cases, it is usually a good idea because it frees the user
from performing the task of compiling your application. In the case where you specify
unique encryption keys, providing a compilation routine becomes a necessity.
All OpenEdge client, server, and stand-alone database products can compile encrypted
source. Therefore, if you use the default encryption key, users can compile your
application without a specialized routine. However, if you have users compile your
application, you must provide adequate documentation to guide them through the process.
Because encrypted code is not precompiled, your application can take advantage of
compile-time functionality. For example, you might want to pass arguments to include
files to determine sort order, field lists, etc. You can take advantage of this behavior at the
user site, allowing users to specify their preferences before compilation. This option is not
available with r-code, which must be compiled at the development site. Whether you can
repeatedly take advantage of compile-time features during the ordinary day-to-day
operation of your application depends on what OpenEdge products the users have.
10–9
OpenEdge Deployment: Managing 4GL Applications
To compile encrypted source code, OpenEdge must be started with the -rx startup
parameter. When an OpenEdge session is running with this startup parameter, the Progress
Compiler can compile encrypted source but cannot compile unencrypted source. If users
have a full development product (the 4GL Development System, ProVISION, ProVISION
Plus, or WebSpeed), they will probably want to write and compile their own unencrypted
procedures. Thus, in their day-to-day operation of OpenEdge, they must run OpenEdge
without the -rx startup parameter. For users with full development products, therefore,
you probably want to perform a one-time compilation with the -rx parameter, then restart
OpenEdge without this parameter. For users with OpenEdge products that cannot compile
ordinary unencrypted source, running permanently with the -rx parameter is not an issue.
The Developer’s Toolkit provides a template procedure, compile.p, that you can use to
compile your application. For more information about compile.p, see the “Decryption
and compilation” section on page 12–4.
You must provide a way for users to start the application. You can either write a script to
do this or provide adequate documentation.
You must provide users with enough documentation to use your application and to
perform the above tasks if you do not automate them.
Now that you have completed the above steps, you need to prepare your distribution media. It
should include:
• All scripts.
10–10
Initial Deployment
CRC r-code
This section provides an overview of the steps to follow to deploy an application using
CRC-based r-code. When you are done developing and testing your application and are ready
to begin deploying, follow the steps described in the following sections. For a complete
description of CRC-based r-code, see Appendix B, “R-code Features and Functions.”
If you deploy your application to users with full development products (the 4GL
Development System, ProVISION, or ProVISION Plus), they can write their own
applications to access the database and modify the database schema. Depending on the
nature of your application, you might not want this to happen. To restrict access to the
database, you can use the DBRSTRCT utility that comes with the Developer’s Toolkit. For
more information about using this procedure, see the “Restricting database access” section
on page 12–15.
If you decide to restrict access to the database, you must physically deploy a copy of your
application database with your application. It is not possible for users to build your
database at their site. Because databases are not portable, you must generate a copy of the
database for each target platform. Then you must run the DBRSTRCT utility on each
platform against all of the databases.
In general, restricting access to the database makes it more difficult to initially deploy and
upgrade applications, but it also helps minimize user-created errors. For each release of
the application, the development site must:
10–11
OpenEdge Deployment: Managing 4GL Applications
To update the application, the user must dump the existing database and load the data into
a new database that you supply. For users with large mission-critical databases, this might
be an unacceptable requirement.
10–12
Initial Deployment
Unless you explicitly specify the Time Stamp (-tstamp) startup parameter when you start
OpenEdge, OpenEdge generates CRC-based r-code files at compilation.
If you decide not to restrict database access, you should dump your application schema
(.df) and/or data (.d) files into ASCII format. This step copies your data from the
application database, which is not portable, into a format that is portable.
The .d and .df files should be represented with the appropriate code page for the target
platform.
You must transfer the resultant .d and .df files to the target platform.
There is more than one way to transfer files. For example, you can use FTP or other
protocols, such as CROSSTALK. Or you can put the files on tape or other storage media
and physically transport the files.
To aid in moving r-code files between platforms, you can use the BUNDLE utility. For
more information about the BUNDLE utility, see Chapter 12, “Deployment Topics and
Tasks.”
10–13
OpenEdge Deployment: Managing 4GL Applications
If you have decided not to restrict access to the database, then you must provide a way for
users to rebuild your application database at their site. To do this, users must be able to
load your .df and .d files into an empty database.
Note: You can restrict access to the database and provide compiled code to load .d files.
Any OpenEdge client, server, or stand-alone database product can run r-code. However,
not all of these products can load .d files into a database. The 4GL Development System,
ProVISION, and ProVISION Plus are the only products that have this capability.
If you deploy to users whose licensed products do not have this capability, you must
provide a way for them to load your .d files. For more information about providing a
dump/load facility for users, see the “Dumping and loading” section on page 12–12.
Note: The dump/load procedures should be considered part of your application. The
decision to distribute r-code versions of your application procedures applies to the
dump/load procedures as well.
Within your script, you can use pre-existing procedures in the install-dir/tty and
install-dir/gui directories (installed for full development OpenEdge products). Within
these directories are procedures that load .df and .d files, called load_df.p and
load_d.p, respectively. Your script can start OpenEdge and run these procedures to load
your data definitions and data. To run these procedures at user sites where users do not
have a license for the 4GL Development System or ProVision, the procedures must be in
r-code format.
If you decide not to write a script and instead rely on the users’ ability to load the data
definitions and data, make sure you provide adequate documentation to guide them
through the process.
10–14
Initial Deployment
To rebuild your application database at the user’s site, you must make a copy of the empty
database and rename it. An empty database is included in the installation directory of all
OpenEdge client, server, or stand-alone database products. Because databases are not
portable, you must use an empty database that already is ported to the target platform.
Users can use OpenEdge to copy the empty database and rename it. Or you can free them
from this responsibility by writing a script that does this task for them. This script can call
the PRODB command to make a copy of the database and rename it appropriately. The
Developer’s Toolkit also provides a newdb script that creates a database.
If users have an OpenEdge product that provide these capabilities, and you decide to let
them perform this step, you must provide adequate documentation to guide them through
the process. For example, you should let them know there are multiple empty databases,
and you should recommend which one they should use.
You must provide a way for the user to install your application. OpenEdge must be
installed before they can use your application. You can create one install for both
OpenEdge and your application. To do this, create an install program using a third-party
tool, such as Installshield, and call the OpenEdge Install batch mode from within it.
You must provide a way for the user to start the application. You can write a script to do
this or provide adequate documentation.
You must provide the user with enough documentation to use your application and to
perform the above tasks if you do not automate them.
10–15
OpenEdge Deployment: Managing 4GL Applications
Now that you have completed the above steps, you need to prepare your distribution media. It
should include:
Time-stamp r-code
This section provides an overview of the steps to follow to deploy an application using
time-stamp-based r-code when you are done developing and testing your application. For a
complete discussion of time-stamp-based r-code, see Appendix B, “R-code Features and
Functions.”
If you deploy your application to users with full development OpenEdge products (the
4GL Development System, ProVISION, or ProVISION Plus), the users can write their
own applications to both access and modify the application database. Depending on the
nature of your application, you might not want this to happen. To restrict access to the
database, you can use the DBRSTRCT utility that comes with the Developer’s Toolkit. For
more information about using this procedure, see the “Restricting database access” section
on page 12–15.
If you decide to restrict access to the database, you must physically deploy a copy of your
application database with your application, because it is not possible for users to build your
database at their site. Databases are not portable, so you must generate a copy of the
database for each target platform. Then you must run the DBRSTRCT utility on each
platform against all of the databases.
10–16
Initial Deployment
In general, restricting access to the database makes it more difficult to initially deploy
applications. The development site must:
Restricting the database removes any advantage that the portability of r-code gives you.
However, it does ensure that the database schema cannot be modified.
Time-stamp-based r-code is closely coupled with the application database: both the
database time stamps and the r-code time stamps must match for the application to run. It
is therefore necessary to build the database on each target platform before you compile
your application. To build the database, you can copy an empty database to your target
platform, then load a .df file. You can also load .d files into the database.
After you create r-code for each target platform, you need to duplicate the r-code and
database as a preliminary step to creating your distribution media. At your development
site, you must keep a copy of the application database for each target platform.
Unless you explicitly specify the -tstamp parameter when you start OpenEdge, OpenEdge
generates CRC-based r-code files at compilation.
10–17
OpenEdge Deployment: Managing 4GL Applications
You must transfer any .d files that are part of your application to the target platform. This
is a preliminary step to creating your distribution media, which must be created on the
target platform.
There is more than one way to transfer files. For example, you can use FTP or other
protocols, such as CROSSTALK. You can also put the files on tape or other storage media
and physically transport the files.
To aid in moving r-code files between platforms, you can use the BUNDLE utility. For
more information about the BUNDLE utility, see the “Using the BUNDLE utility” section
on page 12–4.
If users have the 4GL Development System, ProVISION, or ProVISION Plus products,
they have full dump/load capabilities. If users do not have these products, you must
provide a dump/load facility. If the database is restricted, you must supply r-code files to
dump and load. For more information, see the “Dumping and loading” section on
page 12–12.
Note: The dump/load procedures should be considered part of your application. The
decision to distribute r-code versions of your application procedures applies to the
dump/load procedures as well.
You must provide a way for the users to install your application. If they do not have an
OpenEdge product installed, they must install OpenEdge before they can use your
application. You can create one install for both OpenEdge and your application. To do this,
create an install program using a third-party tool, such as Installshield, and call the
OpenEdge Install batch mode from within it.
You must provide a way for users to start the application. You can either write a script to
do this or provide adequate documentation.
10–18
Initial Deployment
9. Provide documentation.
You must provide users with enough documentation to use your application and to
perform the above tasks if you do not automate them.
• Application database.
• All procedure and include files (or application r-code if the database is restricted), and
dump/load procedures.
• All scripts.
10–19
OpenEdge Deployment: Managing 4GL Applications
10–20
11
Upgrades
After you distribute your application and users have been using it, you might want to upgrade,
fix, or modify either the application procedures or the application database. It is a good idea to
develop a strategy for dealing with application upgrades before distributing an application. That
way, when you have to upgrade an application, you are less likely to have unexpected problems.
• Deploying upgrades
Deploying upgrades
Figure 11–1 illustrates the steps needed and options available when upgrading and distributing
changes to the database structure or application procedures. When making changes to the
database structure, you must to create an incremental .df file that contains the changes in the
database structure. You can then load this .df file into the existing database structure to update
that database. For information on creating an incremental 4GL .df file, see OpenEdge Data
Management: Database Administration. See Appendix B, “R-code Features and Functions,” for
more information about deploying changes to database structures.
When modifying application procedures, you can choose to deploy either unencrypted or
encrypted source code, or to deploy modified r-code. An important consideration in which
method you choose is whether there is a full development product (4GL Development System,
ProVISION, ProVISION Plus, or WebSpeed) capable of compiling code at the deployment site.
When deploying to users with OpenEdge products that cannot compile unencrypted source
code, developers will have to deploy encrypted source code and compile it at the site, or deploy
r-code. If you deploy r-code, you must ensure that the platforms, operating systems, and
software versions at the deployment site match those at the development site. Otherwise, you
will have to compile the r-code at the deployment site to ensure compatibility.
Modifying an application is relatively straightforward if you have not made changes to the
database schema. If you have made changes to the database schema, modifying the application
requires more steps.
11–2
Upgrades
Modify database:
Update .df file Load:
Incremental .df file Incremental .df file
Create:
Incremental .df file
11–3
OpenEdge Deployment: Managing 4GL Applications
Unencrypted source
To upgrade your application, distribute the modified versions of your procedures.
As described in Chapter 10, “Initial Deployment,” when you deploy with encrypted source, you
usually want to provide a compilation procedure. Although this is not necessary in all cases, it
is a good idea because it frees the user from having to compile your application. When you
specify unique encryption keys, providing a compilation routine is a necessity.
All OpenEdge client, server, and stand-alone database products can compile encrypted source.
Therefore, if you use the default encryption key, the user can compile your application without
a specialized procedure. However, if you have the user compile your application without a
script, you must provide adequate documentation to guide them through the process.
Time-stamp-based r-code
If you are supplying time-stamp-based versions of new or modified procedures, you must
compile the procedures against the same version of the database that users are currently using,
and on the same machine type. Otherwise, the r-code versions of the new or modified
procedures will not run, because database file time-stamps are different at the user site.
Once you have precompiled the procedures against the original database, you can distribute the
new r-code files to the user.
11–4
Upgrades
CRC-based r-code
If you supply new or modified CRC-based r-code files, you must precompile the procedures
against a version of the database that is structurally the same as the user’s database. You must
also compile it on a machine of the same class, same user interface, and same combinations of
DataServers (if any). However, since the r-code you create has no time-stamps, it does not
matter when the database tables were created or modified.
If you are upgrading with time-stamp-based r-code, you must supply the following:
• A new empty application database that includes the modified tables, fields, and indexes.
• Dump/load utilities that will dump the user’s data and definitions and load them into the
new empty database.
• Obtain copies of the current user database and the new modified database.
• Compare the data definitions in the user database with the data definitions of your new
updated database, creating a new incremental .df file that reflects the changes.
11–5
OpenEdge Deployment: Managing 4GL Applications
• Provide a utility for users that loads the incremental .df file into the existing database.
1. In Windows, open the Data Administration Tool (for character interfaces, open the Data
Dictionary).
3. Select the database that includes the new, modified data definitions as your current
database by choosing Database→Select Working Database.
This option compares the data definitions in the non-empty copy to the current database
schema and creates a new data definition (.df) file. The new .df file contains a record for
each difference between the two schemas. The differences include any added, renamed,
changed, or deleted file, field, or index.
If a file, field, or index exists in the old database but not in the new schema, OpenEdge
asks you whether the object has been renamed. If you respond no, a record appears in the
new .df file marking the object as deleted.
If the new schema includes a new unique active index, OpenEdge asks you whether you
want to deactivate it. If you do not deactivate the index, and there are duplicate keys in the
old database, OpenEdge aborts your attempt to load new definitions into the old database.
If you deactivate the index, the load procedure defines the new index, but does not create
the index file. You must build and activate the index after loading the new data definitions.
11–6
Upgrades
5. Perform steps a through d below for testing purposes. Then prepare a tool for users that
performs these steps on site:
Note: (The upgrade template provided with the Developer’s Toolkit outlines one way to
do this. Before you can use this template, you probably need to modify it.)
c. If you deactivated any indexes in Step 3, re-create data in the indexed fields as
required to avoid duplicate keys. Then reactivate the indexes with PROUTIL
IDXBUILD. For more information, see OpenEdge Data Management: Database
Administration.
d. OpenEdge now updates the old database schema to match the modified schema.
Compile and test all your procedures against the updated database.
7. Use the XCODE utility to encrypt procedures invalidated by the new data definitions.
Since the new .df file changes CRC check sums and time-stamps only on the database
tables that are actually modified, you only have to encrypt and ship the source versions of
those procedures that access the changed tables. (If you compile your procedures with the
XREF option, you get a listing of the tables accessed by each procedure.)
The upgrade template, all .p files it uses, and all .inp files it uses are only templates; you must
check each file and modify it to suit your particular application. Following is a list of checks and
modifications you must make before using upgrade; your application might require additional
changes.
11–7
OpenEdge Deployment: Managing 4GL Applications
The upgrade template performs three basic actions to upgrade an application at the user’s site:
1. Loads the new .df file, which you created from your version of the upgraded database
with the Admin→Dump Data and Definitions→Create Incremental .df File option.
2. Rebuilds any indexes deactivated during the data definition load process.
Changes to the upgrade template for the data definition load stage (Step 1.):
• Modify upgrade.p (not the upgrade template) and the files it uses:
– If you and your users do not freeze the database files, delete the call to freeze.p.
(Leave the call to unfreeze.p in case your users ever freeze the database files
without your knowledge.)
Changes to the upgrade template for the rebuild deactivated indexes stage (Step 2.):
• If you and your users will not be deactivating indexes, remove the _proutil command line
from upgrade.
• If you have added a new unique active index, modify rebuild.inp to include the correct
responses to prompts by _proutil $1 -C idxbuild. That is, test _proutil idxbuild on
your database and add a line to rebuild.inp to answer each question appropriately.
• You might want to add a procedure to upgrade that checks rebuild.log and, if necessary,
fixes duplicate key data and rebuilds the index again. Alternatively, you might want to
check the .log file and just stop before compilation proceeds.
11–8
Upgrades
Changes to upgrade template for the compile encrypted procedures stage (Step 3.):
• Modify the COMPILE statement in compile.p to use the encryption key you want.
• Prepare to ship compile.p: either encrypt compile.p, possibly with the default key, or
compile compile.p, thereby hiding your encryption key in the .r file. If you ship
compile.r, it must be compiled on the target machine type. It can be compiled against any
database because it does not reference any database files.
The upgrade template is relevant when you want to distribute only new data definitions and
encrypted versions of affected application procedures. However, you might choose instead to
ship a complete new version of the database and application, as described in the following
section.
1. Create an incremental .df file of your application database using the Data
Administration tool (for graphical environments) or the Data Dictionary’s Admin
submenu (for character environments). For more information on creating an incremental
.df file, see OpenEdge Data Management: Database Administration.
2. Recompile source files that were affected by the new schema changes.
3. Send the .df file and copies of the new r-code files that were affected by the schema
changes to your users. After the users load the incremental .df file, they can immediately
run your new .r code.
Essentially, the steps you take are the same as when you use encrypted source, but you gain the
following advantages:
• You do not have to encrypt your procedures. However, you need to recompile some
r-code.
11–9
OpenEdge Deployment: Managing 4GL Applications
One possible disadvantage of using CRC-based r-code is that a user with Progress 4GL
Development System, ProVISION, ProVISION Plus, or WebSpeed can create a counterfeit
database (a database with the same structure as your application database). The user can then
write a program, compile the program, and run it against your application database. (The user
cannot do this if you use time-stamp-based r-code because the time-stamps in the counterfeit
code would not match those in your database.)
If this concerns you, the PROUTIL utility’s DBAUTHKEY qualifier enables you to set an
authorization key for your database. When compiling a procedure, OpenEdge includes the value
of this key in your r-code. CRC-based r-code that does not include the correct authorization key
will not run against your database.
You can insert the authorization key into existing CRC-based r-code with the PROUTIL
utility’s RCODEKEY qualifier.
For more information on the PROUTIL utility’s DBAUTHKEY and RCODEKEY qualifiers, see
OpenEdge Data Management: Database Administration.
2. Recompile all your procedures, including those not directly affected by the schema
change, so that r-code file time-stamps match the database file time-stamps.
3. Distribute the new basic database and the recompiled procedures to users.
Your users will have to dump their data from the old database and load it into the new
database. Therefore, you must also provide your users with a dump/reload facility.
11–10
Upgrades
4. If you are changing any of the file formats used in your application, you must modify the
set of load files to work with those new formats.
5. Run the mkdump script against the new version of the database.
6. Supply a modified set of file load procedures so the user can reload the database using
procedures that are compatible with the old data format. These procedures will probably
be different from the file load procedures the user will use to reload the new database after
dumping it.
7. Supply new file dump, file load, and subdirectory procedures so the user can later dump
and reload the database, if necessary.
1. Use the old dump procedure to dump the data in the existing database. (Note that dumping
and reloading a large database might take days, depending on the database size.)
Note: You can use the binary dump and load to reduce this time dramatically. See the
section on PROUTIL in OpenEdge Data Management: Database Administration for
more information on binary dump and load.
3. Use the new load procedure to load the old database data into the new database. You must
ensure that the new load procedure is prepared to accept data in the format and order
dumped by the old dump procedures.
11–11
OpenEdge Deployment: Managing 4GL Applications
To allow the users of a previously restricted application database to run your application
using the capabilities of their new, less restrictive version of OpenEdge:
The user must use the dump/load facility you provided to dump the existing database, make a
copy of the new basic database, and reload the existing data into that new database.
If the new version of OpenEdge is being installed in a different directory than the old version,
UNIX users can use the _tlr module to edit the value of the DLC variable in your application
scripts.
11–12
12
Deployment Topics and Tasks
This chapter describes issues related to deploying OpenEdge applications as outlined in the
following sections:
XCODE utility
Use the XCODE utility to encrypt Progress 4GL procedures and include files. This is the syntax
for XCODE:
Syntax (UNIX)
key
A character string up to 8 characters long. On UNIX, key is case sensitive. If you do not
specify key, XCODE uses a default key. When OpenEdge is started with the Encrypted
Compiler Mode (-rx) startup parameter, the Progress Application Compiler automatically
uses this default key, unless you specify the XCODE option on the COMPILE statement.
directory
The directory where XCODE places the encrypted files. The specified directory must
be different from the source directory, because each encrypted file retains the name of its
original source file. XCODE overwrites existing files in directory if they are encrypted.
files
The relative pathnames of the files you want to encrypt. XCODE appends the pathnames
supplied to directory.
12–2
Deployment Topics and Tasks
You must encrypt both your procedure and include files in order for your encrypted procedures
to run.
The dash (-) option tells XCODE to take filenames from the standard input. On UNIX, this
allows you pipe output from an ls, cat, or find command to XCODE.
Here is an example of how you can use XCODE on UNIX. Suppose you have just finished
developing and testing the procedures in /usr/test and its four subdirectories and want to
encrypt them for shipment to users.
cd /usr/test
mkdir /usr/testx
mkdir /usr/testx/ar
mkdir /usr/testx/fm
mkdir /usr/testx/inv
mkdir /usr/testx/oeFk
cd /usr/test
Encrypted versions of the source procedures in /usr/test and its subdirectories now
reside, with the same names, in /usr/testx and its subdirectories.
12–3
OpenEdge Deployment: Managing 4GL Applications
The XCODE option of the COMPILE statement decrypts the specified source files-and any
encrypted include files-using the same keys supplied in XCODE. Decrypting is incremental
during compilation. That is, having the decryption key does not allow a user to examine a
decrypted version of the source code. Furthermore, the key can be easily hidden in an object
version of your compile program.
When started with the Encrypted Compiler (-rx) startup parameter, OpenEdge places you (or a
user) by default in the Progress Procedure Editor. The COMPILE statement and the icompile.p
procedure will only compile encrypted procedures when OpenEdge is started with -rx. When
shipping encrypted source code, you must supply either an encrypted .p or a .r version of your
compile program, which can be run in encrypted compiler mode. The Toolkit includes a sample
template, called upgrade, that invokes OpenEdge with the -rx parameter and compiles
encrypted source programs.
You invoke the encrypted source code compiler with the command PROGRESS/XCOMPILER. See
upgrade.com in the Toolkit samples subdirectory for more information.
After the procedures are compiled, you might want users to delete the source to regain the disk
space. If you do this, consider freezing the database files; otherwise, the user can modify the
database and invalidate object procedures for which the user no longer has the source.
The BUNDLE utility consists of two C language programs: bundle.c and unbundle.c. These
programs are described in the following sections.
12–4
Deployment Topics and Tasks
Syntax (UNIX)
-ascii | -binary
Specifies whether the input file is to be read as an ASCII text file or as a binary file. The
default is binary.
-uppercase | -lowercase
Tells bundle to convert the names of files being bundled to uppercase or lowercase. By
default, filenames are used without case conversion.
bundle-file
Provides the name of the file into which input files are bundled. If the file does not exist,
bundle creates it. If it does exist, bundle appends data to the end of it.
-select selection-file
Indicates that the names of the input files are to be read from a selection file. By default,
the selection file is read from standard input.
Syntax
Each entry must be on a line by itself and cannot continue across lines.
If ascii or binary is absent, the command line specification is used. Use an exclamation
point ( ! ) or pound sign ( # ) as comment characters. Everything from a comment character
to the end of line is ignored. The comment character must be separated from any preceding
text by a blank space. Blank lines are also ignored. Wild cards are not supported.
12–5
OpenEdge Deployment: Managing 4GL Applications
# First line.
# Config files follow.
cfg-show.x # Depending on command-line, ascii or binary.
cfg-doc.txt ascii
cfg-make ascii
# The next line is blank. # Last line.
input-file
The name of a single input file. Wild cards are not supported.
Syntax (UNIX)
Indicates the operation to perform. The default, toc, lists a table of contents that shows the
name and type (ascii or binary) of each file in the bundle. The fulltoc value lists a table of
contents containing: 1) toc information, 2) date information, and 3) the input files’ file
specifications, modify dates, and sizes. The date value lists time stamps showing when
bundle was run. The all value unbundles all files in the bundle putting the unbundled files
in the current directory.
-select selection-file
Allows you to select by name the files to unbundle or to list with toc or fulltoc.
Syntax
filename [ unbundle-as-file-spec ]
12–6
Deployment Topics and Tasks
The filename value names the file to be processed. When you are unbundling,
unbundle-as-file-spec specifies the name unbundle is to use as the unbundled filename.
Comments and blank lines are permitted as described earlier for the bundle command’s
selection-file. Wild cards are not supported.
# UNIX example
# First line.
cfg-show.x pdir/cfg-show.p
cfg-doc.txt docdir/cfg-doc.doc
cfg-make # Created as cfg-make in current directory.
readme.txt # Created as readme.txt in current dir.
# The next line is blank.
# Last line.
First you have to create a “bundle” file. To do this you specify the output file (that is, the bundle)
and one or more input files (the encrypted source files). For these examples, the bundle file has
a .bun extension and the encrypted source files have a .x extension. The bundle is created on
UNIX, copied to Windows, and unbundled on Windows.
Or put all encrypted source files in the current directory in the bundle:
12–7
OpenEdge Deployment: Managing 4GL Applications
# cat >xcode.sel
this.x
that.x
what.x
^D
# bundle xcode.bun -select xcode.sel
Note that files are always appended to the bundle, so you can incrementally add files to it. Thus,
the above sequence created xcode.bun with this in it: foo.x, all xcode files in the current
directory, this.x, that.x, and what.x.
Now you need to copy the bundle to some destination. You can use FTP, making sure that
binary mode is in effect; KERMIT, making sure that binary mode is in effect; or dd.
The unbundle program lists a short table of contents. To see a full table of contents, enter this
command:
To unbundle everything in the bundle and put the files in the current directory, enter this
command:
12–8
Deployment Topics and Tasks
To unbundle selected files (this.x and that.x) and put them in specified directories, enter this
command:
Once you have unbundled the files, they can be executed or compiled in OpenEdge.
Text files can also be bundled. You can specify -ascii on the command line, thereby making
ascii the default file type; or you can specify ascii after the filename in the selection list:
12–9
OpenEdge Deployment: Managing 4GL Applications
Since bundle always appends files to the end, multiple files with the same name might appear
in a bundle:
In this example, the filename foo.p appears twice and represents two different files. When
unbundling this (with -all) foo.p (ascii) is unbundled first and then foo.p (binary) is unbundled
overwriting the other foo.p. To unbundle both files, use a selection list to give each file a unique
name or put each in a different directory:
You can also use a selection list to skip over a file by directing it to the null device, as shown in
the following UNIX example:
12–10
Deployment Topics and Tasks
To help differentiate files with identical names, unbundle -full shows files’ input file
specifications, modify dates, and sizes in bytes; the current directory when the bundle was
created; and a time stamp showing when the files were bundled:
(The V0 denotes version 0 of the bundle record format. It allows backward compatibility should
this format have to be changed.) You can use -select with -full to see information on selected
file names.
Note: Binary dump and loads are dramatically faster. See the section on PROUTIL in
OpenEdge Data Management: Database Administration for more information on binary
dump and load.
12–11
OpenEdge Deployment: Managing 4GL Applications
• Convert data to ASCII format for transporting among machines or database products.
The Progress 4GL Development System, ProVISION, ProVISION Plus, and WebSpeed
products all provide full dump/load capabilities via either the GUI Data Administration Tool,
Character Data Dictionary Tool, or command line PROUTIL utility. For more information
about these capabilities, see OpenEdge Data Management: Database Administration. Other
OpenEdge products provide less complete dump/load capabilities. Other OpenEdge products
such as Query Results provide less complete dump/load capabilities.
Note: Progress Software recommends you use binary dump and load instead of MKDUMP
when moving table contents. Refer to OpenEdge Data Management: Database
Administration for more information about binary dump and load, and loading of
sequence values.
The Progress Developer’s Toolkit includes sample utilities that you can use to create your own
dump/load facility. This section covers these samples and explains how to modify them for your
own use.
MKDUMP utility
This sample utility contains a dump/load facility. When you run the MKDUMP utility, it creates
two Progress 4GL procedures: one that dumps a database and one that reloads a database. For
example, you would run MKDUMP to create a dump/reload facility for the sports database, as
follows:
Syntax
mkdump sports
12–12
Deployment Topics and Tasks
$ mkdump
Runs
filedump.p
Creates
dmpprocs Idprocs
filedump.p fileload.p
subdirectory subdirectory
The MKDUMP utility runs a Progress 4GL procedure, mkdump.p, which creates and compiles
two other Progress 4GL procedures, filedump.p and fileload.p. The filedump.p procedure
dumps the files from a database; fileload.p loads the files into a database.
In addition, mkdump.p creates two directories. The dmpprocs subdirectory contains a database
dump procedure for each of the files in the database. The ldprocs subdirectory contains a
database load procedure for each of the files in the database. The mkdump.p procedure also
precompiles all the procedures it creates. These precompiled procedures may not be appropriate
for your use if the deployed database does not have the same name as the original database that
MKDUMP was run against.
The MKDUMP utility creates these files and subdirectories in your current working directory.
Before distributing them to users, you must move them to your application master directory.
You can then supply either the encrypted source or object versions of the filedump.p
procedure, fileload.p procedure, and each of the procedures in the dmpprocs and ldprocs
subdirectories.
12–13
OpenEdge Deployment: Managing 4GL Applications
You can modify MKDUMP or any of the mkdump.p, filedump.p, or fileload.p procedures as
needed. However, once you have created and perhaps modified the dump/load scripts or batch
files, be sure to provide a way for users to use these procedures. You should also provide
adequate documentation for users to use the facility.
Note: The dump/load procedures should be considered part of your application. The decision
to distribute r-code or encrypted source versions of your application procedures applies
to the dump/load procedures as well.
• Uses either prodb or newdb to make a fresh copy of the basic database.
Before you supply the filedump.p, fileload.p, and subdirectories of dump and reload
procedures to a user, you must understand the following points:
• The filedump.p and fileload.p procedures were written to run from an interactive
Progress 4GL procedure. If you plan to have users run these procedures from the operating
system command level, you must supply an output destination by adding OUTPUT TO
filename at the top of each procedure. Comments in the dumpdb and reloaddb files
explain these modifications.
• If the database to be loaded does not have the same name as the database that the
MKDUMP was run against, then you must recompile the fileload.p procedure against
the database with the proper name.
12–14
Deployment Topics and Tasks
Because database access restrictions apply to you as well as to your users, you must make a copy
of your original, unrestricted and unfrozen database, and store it under a separate name.
That way, if you want to lessen the restrictions at a later time, you can dump the data in the
restricted database and reload it into a copy of the original, unrestricted database.
You use the DBRSTRCT utility to define the kinds of database access all users, including
yourself, are allowed. This is the syntax for the DBRSTRCT utility:
Syntax (UNIX)
dbrstrct database-name
12–15
OpenEdge Deployment: Managing 4GL Applications
In these commands, database-name is the name of the database you want to restrict. The utility
starts OpenEdge and displays the following menu from which you can choose options that let
you define privileges for the update and query activities:
To deny update or query access to all database files that are currently defined, choose 1. A
second menu screen appears.
If you choose 1 (Deny updates), at this second menu, users can query but not update the
database.
Any procedures you compile against a database before restricting that database are exempt from
any restrictions you apply with the DBRSTRCT utility.
Make sure that you compile a complete set of dump procedures before you restrict the database.
Otherwise, users will not be able to dump their database.
12–16
Part III
Appendices
When you purchase an OpenEdge product, you receive a set of executable files, database files,
and other files that are necessary to run the product on your system. In most cases, the files
included in your initial product installation fulfill your system requirements. However, you
might need to customize an OpenEdge executable by adding or removing product capabilities.
For example, you might need to change network protocols or access a non-OpenEdge data
source. When you need to customize an OpenEdge executable, use the OpenEdge make utility.
The make utility is a set of scripts that you use to build customized versions of certain OpenEdge
executables.
This appendix provides information about the process and requirements for building
customized OpenEdge 4GL executables. It also provides instructions for using the make utility
scripts on UNIX and in Windows. This appendix contains the following sections:
• Licensing requirements.
• Troubleshooting
Licensing requirements
You are obligated to ensure that the customers who purchase your product have purchased and
installed a properly licensed version of OpenEdge before you install any OpenEdge executables
you deliver as part of your product.
The make utility script calls the buildenv.sh script. The buildenv.sh script sets default values
for environment variables that point to objects, libraries, and options involved in linking
executables. You can edit this script to customize environments for different sites.
• Verify that there is a linker installed on your system, and that the PATH environment
variable contains the path to the C++ compiler and the linker.
• Verify settings for OpenEdge environment variables. Set DLC to the directory where you
have installed OpenEdge.
• Verify that the buildenv.sh script (located in the $DLC/oebuild/make directory) includes
the appropriate environment variable settings for your system.
A–2
Building OpenEdge 4GL Executables
For more information about maintaining environment variables in the buildenv script, see the
“Maintaining the UNIX user environment” section on page 4–39.
For more information about UNIX environment variables, see OpenEdge Getting Started:
Installation and Configuration for UNIX.
1. Open a terminal and invoke a Bourne shell (/bin/sh) on the system where OpenEdge is
installed.
3. Set and export the environment variable DLC to the OpenEdge installation directory. For
example:
> DLC=/usr/OpenEdge/dlc
> export DLC
4. Optionally set and export the environment variable IMAGE to the full pathname of the
executable to be generated. By default the client executable will be named
$DLC/oebuild/_progres.
5. Unset all the library path variables for your operating system. The script will set these
variables as required. For example:
A–3
OpenEdge Deployment: Managing 4GL Applications
7. Edit the script to add customized objects and any necessary libraries to accommodate them
on the link line, and save the file. Available objects and libraries are located in
$DLC/oebuild/obj.
8. Run the script $DLC/oebuild/make/build_rx.sh. If you did not set the IMAGE variable,
the client executable is built as $DLC/oebuild/_progres; otherwise, the executable is built
as specified by $IMAGE.
To use the new executable, you must replace the default executable and set appropriate
permissions.
2. Copy the newly built executable into your installed bin directory. For example:
3. Change permissions on the newly created executable to include the Set UID bit. For
example:
A–4
Building OpenEdge 4GL Executables
The make utility script calls the progress.ini file. The progress.ini file sets default values
for environment variables that define objects, libraries, and options required for building
executables in Windows. You can edit the progress.ini file to customize environments at
different sites.
When you install OpenEdge, the installation program automatically updates the Registry with
the information in the progress.ini file that is shipped to you. Progress Software recommends
that you maintain environment variables in both the progress.ini file and the Registry. If you
modify environment variables in the progress.ini file, you must update the information in the
Registry.
Although there are several methods for adding and deleting information from the Registry
directly, Progress Software recommends that you do not use these direct update methods.
Instead, maintain the Registry information by editing the progress.ini file and using the
INI2REG utility to update the Registry. This approach synchronizes the information in the
progress.ini file and the Registry without causing unintended edits to the Registry.
• Verify settings for OpenEdge environment variables. Set DLC to the directory where you
have installed OpenEdge.
A–5
OpenEdge Deployment: Managing 4GL Applications
• Verify that the Microsoft Visual C++ .NET compiler is installed on the system.
• Verify that the PATH environment variable contains the path to the C++ compiler and the
linker command (link.exe).
For more information about maintaining environment variables in the progress.ini file and
the Registry, and using the INI2REG utility, see the “Maintaining the Windows user
environment” section on page 4–2.
For information about Windows environment variables, see OpenEdge Getting Started:
Installation and Configuration for Windows.
2. Set the variable DLC to the OpenEdge installation directory. For example:
C:\> cd %DLC%\oebuild\make
A–6
Building OpenEdge 4GL Executables
5. Make a backup copy the original link options script. For example:
6. Edit the link script to add customized objects and any necessary libraries to accommodate
them on the link line, and save the file. Available objects and libraries are located in
%DLC%\oebuild\obj.
7. Run the link command to create a customized 4GL client dynamic link library:
link @build_prow32.link
9. Copy the customized 4GL client DLL into the installed bin directory. For example:
Troubleshooting
Following are some common errors that might occur when you attempt to link an executable:
For link utility error and troubleshooting information, see the documentation supplied with the
operating system.
A–7
OpenEdge Deployment: Managing 4GL Applications
A–8
B
R-code Features and Functions
R-code is the intermediate binary code that OpenEdge generates when it compiles 4GL source
files. This is the code that OpenEdge actually runs when it executes a procedure, whether from
session compiles or from permanently generated r-code (.r) files.
OpenEdge provides a dynamic r-code execution environment, as well as integrity and security
mechanisms to ensure that your r-code is running in a compatible environment.
• R-code structure
• R-code libraries
• R-code execution
• R-code portability
R-code structure
R-code is divided into multiple segments of varying length. Each r-code file contains an object
header and segment location table followed by the actual r-code segments. The object header is
a fixed-length descriptor that identifies the file as an r-code file and contains information about
the version and size of the r-code file. The segment location table is a variable-length descriptor
that contains the size and location of each r-code segment in the file. The maximum size for
most segment types is 4MB.
Table B–1 describes and lists the types, maximum size, and maximum number of segments in
an r-code file.
Action code 4MB 4 for the Holds the actual executable code in the form of
main action cells. Action cells drive the 4GL
procedure, interpreter and contain the executable code for
4GL verbs. There are between one and four
1 per action code segments for the main procedure,
internal and one separate action code segment for each
procedure internal procedure.
Text 4MB 1 per Holds all literal character strings for the r-code
language file. There is one text segment for the default
language and one for each language specified in
the COMPILE statement. Duplicate literals are
removed. Only one text segment is loaded into
memory at run time.
B–2
R-code Features and Functions
You can reduce the size of an action code segment (for either the main procedure or an internal
procedure) by consolidating multiple 4GL statements into one. This can also increase the speed
of execution, because the interpreter executes only one action instead of several.
B–3
OpenEdge Deployment: Managing 4GL Applications
For example, you can reduce action code size by combining several consecutive assignment
statements into one ASSIGN statement. The following examples require the same amount of
expression code:
a = 1.
b = 2.
c = 3.
ASSIGN a = 1
b = 2
c = 3.
Note: The compiler creates up to four main action code segments, as needed. If, during
compilation, the main action code segments exceed the total size of all four segments,
the compilation fails.
You can reduce the size of the initial value segment by limiting the number of SHARED variables
that are accessed in a procedure. The r-code required to support a SHARED variable is larger than
the r-code to support a NEW SHARED variable. OpenEdge uses approximately 36 additional bytes
in the initial value segment to resolve each SHARED variable at run time. This value can change
depending on the environment.
B–4
R-code Features and Functions
There can also be multiple text segments, one segment for the default language and each
language that you choose for translation. The default language segment contains the literal
character strings defined in the original 4GL source file. You can create additional text segments
by using the Translation Manager. Although multiple text segments are possible, only one text
segment is available per language. Thus, the literal character strings for a given language cannot
exceed 4MB. For more information about natural language translation for 4GL procedures, see
OpenEdge Development: Translation Manager.
Object header
·
· Up to four
·
Frame segment
·
· One per frame
·
Text segment
·
· One per language
·
Debugger segment
B–5
OpenEdge Deployment: Managing 4GL Applications
R-code libraries
You can organize and store r-code files in a Progress 4GL r-code library. A 4GL r-code library
is a collection of r-code procedures combined in a single file. R-code libraries allow you to
manage and execute r-code procedures more efficiently. You create r-code libraries by using the
PROLIB utility.
OpenEdge provides two types of r-code libraries: standard and memory-mapped. A standard
library contains r-code procedures that execute in local memory. A memory-mapped library
contains r-code procedures that execute in shared memory.
For information about using the PROLIB utility to create r-code libraries, see Chapter 6,
“Managing R-code Libraries.”
• The first time you run a member procedure from a standard or memory-mapped library
that is specified in the PROPATH, OpenEdge locates the procedure by searching through
each directory and library in the PROPATH until it finds the procedure. To search a library
for a member procedure, OpenEdge must open the library. When OpenEdge opens a
standard library, it loads the procedure into local memory. When OpenEdge opens a
memory-mapped library, it maps the library in shared memory.
• When searching through directories and libraries in the PROPATH, OpenEdge starts at the
beginning of the PROPATH and searches each directory and library, in defined order, until
it finds the procedure. Thus, placing the library at the beginning of the PROPATH
improves performance.
• A library remains open until the end of your Progress 4GL session or until you remove the
library from the PROPATH. If you remove a library from the PROPATH while a member
procedure is still active (either running, or waiting for a subprocedure to return),
OpenEdge displays an error message and the library remains open until you end your
Progress 4GL session. Otherwise, OpenEdge closes a standard library and unmaps a
memory-mapped library.
B–6
R-code Features and Functions
• If you use a SEARCH or RUN statement to open a library that is not in the PROPATH,
the library remains open until you end your Progress 4GL session.
• If you use libraries, OpenEdge accesses r-code files as if you had specified the Quick
Request (-q) startup parameter. That is, OpenEdge searches the PROPATH only on the
first reference to a procedure. Thereafter, if the procedure still resides in memory, in the
local session compile file, or in an r-code library, OpenEdge reuses the procedure instead
of searching the PROPATH again. For more information about the Quick Request (-q)
startup parameter, see OpenEdge Deployment: Startup Command and Parameter
Reference.
R-code execution
OpenEdge executes r-code procedures in different ways, depending on whether you store the
r-code files in an r-code library and the type of library.
When executing an r-code procedure from an operating system file in a directory, or from a
standard r-code library, OpenEdge accesses and executes the r-code file segments in an
execution buffer in local memory. For more information about the standard r-code execution
environment, see the “Standard r-code execution environment” section on page B–8.
For information about monitoring execution environment activity during a Progress 4GL client
session, see the “R-code execution environment statistics” section on page B–15.
For information about monitoring and optimizing r-code performance, see Chapter 5,
“Managing Client Performance.”
B–7
OpenEdge Deployment: Managing 4GL Applications
• Execution buffer — The portion of local memory that OpenEdge allocates and uses to
store the chain of loaded r-code segments for all procedures executing in local memory.
• Session sort file (.srt) — A file that OpenEdge uses to dynamically swap r-code segments
in and out of the execution buffer.
• Segment descriptor table — An in-memory table that references the r-code segments
required by all executing procedures, including the location of each r-code segment in the
execution buffer and usage count information.
• R-code directory — An in-memory table that contains information about each executing
r-code procedure, including r-code size, usage count, segment descriptions, and a
reference to the segment descriptor table for each segment.
OpenEdge uses the segment descriptor table and the r-code directory to manage r-code
procedures from operating system files, standard libraries, and memory-mapped libraries.
B–8
R-code Features and Functions
Figure B–2 shows the layout for the standard r-code execution environment.
·
· R-code
· segment
·
·
·
In Figure B–2, OpenEdge located and loaded the cust.r and orders.r files into local memory
from either operating system files or standard libraries. The execution buffer is shown with three
cust.r segments and two orders.r segments. Note that one orders.r segment is located in the
execution buffer, while the other segment is swapped to the session sort file. When space in the
execution buffer is needed for new r-code segments, OpenEdge uses the session sort file to swap
out the least-recently used segments. When OpenEdge needs a segment that has been swapped
to the session sort file, it reloads the segment from the session sort file into the execution buffer.
B–9
OpenEdge Deployment: Managing 4GL Applications
When you run a standard r-code procedure for the first time, from either an operating system
file or a standard library, OpenEdge loads and executes the procedure as follows:
1. Opens the procedure file (.p or .r) or procedure library (.pl), if the library is not already
open.
2. Reads the r-code procedure into memory and creates an r-code directory entry for the
procedure. OpenEdge first compiles a procedure into r-code, if necessary.
a. Loads the r-code segment at the head of the segment chain in the execution buffer.
b. Adds an r-code segment entry to the segment descriptor table that references the
segment in the execution buffer.
c. Inserts a segment descriptor reference in the r-code directory entry for the procedure.
If all the required r-code segments do not fit in the execution buffer, OpenEdge attempts
to free space by swapping r-code segments already in the buffer to the session sort file. If
OpenEdge cannot free enough space by swapping segments, it increases the execution
buffer ceiling and allocates more space for the execution buffer.
Note: When accessing r-code procedures stored in a standard library, OpenEdge does not
swap r-code segments to the session sort file unless you specify the PROLIB Swap
(-pls) startup parameter. By default, if OpenEdge needs an r-code segment in a
standard library, it reloads the segment into the execution buffer from the library in
local memory.
4. Once the required r-code segments in the procedure are registered in the execution
environment, the interpreter begins executing the r-code procedure at the start of the first
main action code segment and accesses the remaining segments directly from local
memory as required.
B–10
R-code Features and Functions
The number of standard r-code procedures that you can run at one time and the memory used
are determined by the following factors:
• R-code directory size — The default is 100 entries, the minimum is 5 entries, and the
maximum is 500. You can set the initial number of entries using the Directory Size (-D)
startup parameter. OpenEdge dynamically increases the directory size up to the maximum,
as required. Use the Hardlimit (-hardlimit) startup parameter to force OpenEdge to adhere
to the limit specified by the Directory Size (-D) startup parameter.
• Execution buffer ceiling — The default is 3096K. You can set the initial ceiling for this
buffer up to 65,534K using the Maximum Memory (-mmax) startup parameter. OpenEdge
dynamically increases the execution buffer size up to the maximum, as required. Use the
Hardlimit (-hardlimit) startup parameter to force OpenEdge to adhere to the limit specified
by the Maximum Memory (-mmax) startup parameter.
• Available memory — Available memory is a factor only if it is smaller than the execution
buffer ceiling or OpenEdge needs to allocate memory beyond that ceiling.
While OpenEdge loads an r-code file, all of its segments are locked in memory. After all
required segments are loaded for the procedure, OpenEdge unlocks all segments except its main
action code segments and text segment. These segments stay locked in memory until execution
of the r-code file terminates. Internal procedure action code segments stay locked only until they
return to the invoking procedure and are relocked each time they execute.
When a standard r-code segment does not fit in the execution buffer, OpenEdge attempts to free
space by swapping r-code segments already in the buffer to the session sort file. OpenEdge can
swap out any unlocked segments. OpenEdge removes these segments from the tail end of the
execution buffer chain, in least recently used (LRU) order.
If OpenEdge cannot free enough memory for a newly loaded segment by swapping out older
segments, it dynamically increases the maximum execution buffer size (execution buffer
ceiling) and allocates the required memory up to the memory available.
B–11
OpenEdge Deployment: Managing 4GL Applications
When OpenEdge needs a segment that has been swapped to the sort file, it reloads the segment
from the sort file into the execution buffer. However, OpenEdge keeps the reloaded segments
in the sort file.
Note: When accessing r-code procedures stored in a standard library, OpenEdge does not swap
r-code segments to the session sort file unless you specify the PROLIB Swap (-pls)
startup parameter. By default, if OpenEdge needs an r-code segment in a standard
library, it reloads the segment into the execution buffer from the library in local memory.
• Shared memory buffer — The portion of shared memory that the operating system
allocates and uses to store r-code segments for procedures in a memory-mapped procedure
library.
• Segment descriptor table — An in-memory table that references the r-code segments
required by all executing procedures, including the location of each r-code segment in
memory and usage count information.
• R-code directory — An in-memory table that contains information about each executing
r-code procedure, including r-code size, usage count, segment descriptions, and a
reference to the segment descriptor table for each segment.
OpenEdge uses the segment descriptor table and the r-code directory to manage r-code
procedures from operating system files, standard libraries, and memory-mapped libraries.
B–12
R-code Features and Functions
Figure B–3 shows the layout for the memory-mapped r-code execution environment.
Shared Memory
R-code Directory Segment Descriptor Table
Buffer
cust.r cust.r Main Action Code R-code
Segment
·
·
·
· ·
·
· ·
· cust.r Text R-code
Segment
cust.r Initial Value ·
·
orders.r · ·
· R-code
·
Segment
·
orders.r Main Action Code ·
· ·
· R-code
· Segment
·
orders.r Initial Value ·
·
·
R-code
·
·
Segment
·
·
·
In Figure B–3, OpenEdge located the cust.r and orders.r files in a memory-mapped library.
Note that all r-code segments in a memory-mapped library are located in shared memory. When
OpenEdge needs a segment, it executes the segment directly from shared memory.
When you run a memory-mapped r-code procedure for the first time, OpenEdge loads and
executes the procedure as follows:
1. Opens the procedure library, if not already open, and memory-maps the library in shared
memory.
2. Reads the r-code procedure and creates an r-code directory entry for the procedure.
B–13
OpenEdge Deployment: Managing 4GL Applications
a. Adds an r-code segment entry to the segment descriptor table that references the
segment in shared memory.
b. Inserts a segment descriptor reference in the r-code directory entry for the procedure.
4. Once the required r-code segments in the procedure are registered in the execution
environment, the interpreter begins executing the r-code procedure at the start of the first
main action code segment and accesses the remaining segments directly from shared
memory as required.
The number of memory-mapped r-code procedures that you can run at one time and the shared
memory used are determined by the following factors:
• R-code directory size — The default is 100 entries, the minimum is 5 entries, and the
maximum is 500. You can set the initial number of entries using the Directory Size (-D)
startup parameter. OpenEdge dynamically increases the directory size up to the maximum,
as required. Use the Hardlimit (-hardlimit) startup parameter to force OpenEdge to adhere
to the limit specified by the Directory Size (-D) startup parameter.
• Available memory — The number of memory-mapped r-code libraries you can have
open is limited by the amount of shared memory available on the system.
When OpenEdge needs a memory-mapped r-code segment, it executes the segment directly
from shared memory. OpenEdge does not store active memory-mapped r-code segments in the
execution buffer. Nor does it swap non-active segments to the session sort file. OpenEdge relies
on the operating system to manage the swapping of r-code segments in and out of shared
memory.
B–14
R-code Features and Functions
2. Frees the r-code directory entry for the LRU r-code file.
3. Frees all of the segment descriptor entries in the segment descriptor table for the LRU
r-code file.
4. When reusing a standard r-code directory entry, OpenEdge removes all r-code segments
for the LRU r-code file from both the execution buffer and the session sort file. When
reusing a memory-mapped r-code directory entry, the memory-mapped r-code file
remains mapped in shared memory.
When OpenEdge needs to reload a standard r-code file, it follows the standard execution
sequence. When OpenEdge needs to reload a memory-mapped r-code file, it follows the
memory-mapped execution sequence.
For information about monitoring and optimizing r-code performance, see Chapter 5,
“Managing Client Performance.”
B–15
OpenEdge Deployment: Managing 4GL Applications
Figure B–4 through Figure B–8 show sections of client.mon output generated with the -yd
startup parameter.
In Figure B–4, the “Progress 4GL client startup options” section shows the r-code directory size
(-D), in this case, set to the default of 100 entries. The -y startup parameter also generates this
information.
-A = 0 | -d = mdy | -D = 100 | -h = 7
.
.
.
In Figure B–5, the “Execution buffer map” section shows the order and size of procedures
loaded into the execution buffer.
In Figure B–6, the “Per procedure temp file access statistics” section lists each r-code segment
that has been read or written to the session sort file (.srt). Each segment is listed under its r-code
file by segment type (“Int-Proc Action”), number (5), and size (1364 bytes).
B–16
R-code Features and Functions
In this example, all segments shown have been read and written once. A large number of
segments read or written a large number of times indicates a likely need for more memory.
B–17
OpenEdge Deployment: Managing 4GL Applications
In Figure B–7, the “Per procedure segment information” section lists all the r-code segments
loaded during the session. Each segment is listed under its r-code file by segment type
(“Int-Proc”), number (2), and size (816 bytes).
B–18
R-code Features and Functions
Thus, if there are three internal procedure action segments in appedit/_proedit.r, they are
listed in order (Int-Proc: 1 through 3). Likewise, multiple main action code segments are listed
in order (A-Code: 1 and 2). The number of segments for each entry is always 1. Note that the
“Initial” segment has no segment number, because there is never more than one of this segment
type per r-code file.
In Figure B–8, the listed sections provide memory and segment usage summaries. The -y startup
parameter also generates this information.
-----------------------------------------
Program access statistics: Times Bytes
.
.
.
------------------------------------------------
The “R-code Execution Buffer” statistics show how far your application pushes the execution
buffer ceiling. The “Segment Descriptors Usage” statistics shows how close your application is
to running out of segment descriptors, and thus, whether you need to optimize the number of
r-code segments in your application.
B–19
OpenEdge Deployment: Managing 4GL Applications
R-code portability
R-code is portable between any two environments if the following are true:
Note: If a procedure contains no user interface code, its r-code can run across user
interfaces without change. This is typical, for example, of database schema trigger
procedures.
All machines that require four-byte alignment or less are compatible. Thus, r-code compiled on
one of these machines (for example, a Sun SPARCstation) can run on most other machines. One
of the few machines not compatible with this class is the AS/400, which requires greater than
four-byte alignment.
Thus, you can use the same r-code compiled for Windows on any DataServer-compatible
Windows system, and you can use the same r-code compiled in character mode on any
DataServer-compatible character-mode system.
If the code page for a standard r-code procedure, from either an operating system file or a
standard library, is not the same as the session’s internal code page, OpenEdge performs an
in-memory conversion of the r-code text segments to the session’s internal code page.
Note: If you use the R-code In Code Page (-cprcodein) startup parameter to specify a code
page for reading r-code text segments, OpenEdge reads the text segments as if they were
written in that code page, even if the text segments were written in a different code page.
B–20
R-code Features and Functions
For more information about the Internal Code Page (-cpinternal) and R-code In Code Page
(-cprcodein) startup parameters, see OpenEdge Deployment: Startup Command and
Parameter Reference.
When executing a procedure using time stamp validation, OpenEdge checks to make sure that
the time stamps for all accessed tables match those contained in the r-code. If a time stamp does
not match, the procedure does not execute.
To use time stamp validation, compile the procedure with each database connected using the
Time Stamp (-tstamp) connection parameter. Otherwise, OpenEdge uses CRC validation.
Note: The Time Stamp (-tstamp) parameter is obsolete, and is supported only for backward
compatibility.
B–21
OpenEdge Deployment: Managing 4GL Applications
CRC validation
For each table, OpenEdge computes a CRC value (database CRC) from selected elements of
the table metaschema. When compiling a procedure, OpenEdge inserts the database CRC for
each database table the procedure accesses. The database CRC for each table is stored in the
metaschema _File record _CRC field for the table. A matching CRC ensures that the schema
referenced by the r-code is compatible with the table schema, regardless of its time stamp.
Time stamps and CRCs both help maintain database integrity, but they do it differently. Time
stamps change whenever a table schema is updated or recreated at another time or place; CRCs
change only when certain schema elements critical to field or record definitions change. As long
as a table is structurally compatible with the r-code that references it, the CRCs match and the
r-code can execute. It does not matter when or where the table’s schema was created or updated.
When executing a procedure using CRC validation, OpenEdge follows these steps:
1. For each table accessed by the r-code, check the time stamp. If it matches, execute the
procedure. Otherwise, go to Step 2.
2. If the table is in a database that was not connected using the Time Stamp (-tstamp)
parameter when the procedure was compiled, check the CRC. If it matches, execute the
procedure. Otherwise, reject the procedure.
Thus, if the time stamps match, OpenEdge assumes that the database schema and r-code must
be compatible. Otherwise, the CRCs determine the outcome.
Note: The Time Stamp (-tstamp) parameter is obsolete, and is supported only for backward
compatibility.
B–22
R-code Features and Functions
CRC calculation
Table B–2 lists the metaschema fields that are involved in each CRC calculation.
Metaschema table
1
The _Field–Name for index fields is referenced in the _Field table using _Field–recid in _Index–Field.
All of the listed metaschema fields, participate in the CRC calculation for each database table.
The resulting CRC is stored in the _CRC field of the _File record for each table. A change to any
of these fields automatically changes the value of _CRC.
• Forcing the user to dump and reload their data into a new database that you supply with
new r-code.
• Forcing the user to compile new source code (possibly encrypted) that you supply with
new data definitions to update their database schema.
B–23
OpenEdge Deployment: Managing 4GL Applications
Depending on the schema changes, the user still might have to dump and reload some data, but
you can always supply r-code for their updated database.
You must recompile procedures that reference a database table in which you have made any of
the following changes:
• Modified an index by changing its name, uniqueness, field components, collation order,
or the abbreviation option.
Although you do not have to recompile procedures when you make other schema changes, such
changes do not apply to procedures that you do not recompile. For example, changes to the
following features appear only when you recompile:
• Data entry — initial value, mandatory value, case sensitivity, validation expression,
delete validation, and security.
B–24
R-code Features and Functions
You must recompile procedures using CRC-based deployment for the same schema changes
that change a time stamp. In addition, you must recompile procedures that reference a database
table in which you have made these changes to a field:
Table B–2 lists all the metaschema fields involved in database CRC calculation.
Note: The order in which indexes are defined has no effect on database CRCs.
Using time stamp validation, if you deploy r-code, you must compile the procedures against a
schema-updated version of the user’s database and send both the r-code and the new database
to the user. Otherwise, the r-code cannot run, and you must deploy source code for the user to
compile along with new database definitions to update their schema.
CRC-based deployment
Using CRC validation, if you deploy r-code, you only have to compile the procedures against a
database with the same basic structure as the end-user database. It does not matter when or
where the database was created. If you make schema changes to an existing database, you can
distribute the newly compiled r-code to end users, along with a data definition files to install the
schema changes.
1. Install a copy of the production database from the target site in your development
environment.
B–25
OpenEdge Deployment: Managing 4GL Applications
2. Create an incremental data definition file that captures the difference between your
development database and the production copy. For information about creating an
incremental data definition file, see OpenEdge Data Management: Database
Administration.
3. Apply the incremental data definition file to your copy of the production database.
4. Recompile all procedures affected by the schema changes against your copy of the
production database.
5. Apply the incremental data definition file to the original production database (on site). The
CRC for the original production database should now be identical to the production copy,
but probably not identical to your development database.
6. Distribute the new r-code files (from Step 4) to the updated production site.
The steps for CRC-based deployment are essentially the same as those for time stamp-based
deployment, but you gain these advantages:
• You are not required to encrypt and give end users source code.
• End users do not have to dump and reload all their data into your new database.
One possible drawback of using CRC validation is that anyone having an OpenEdge
development environment can create a counterfeit database (a database with the same structure
as your database). The user can then write a program, compile it, and run it against your
database. Using time stamp validation prevents this because the time stamps in the counterfeit
code do not match those in your database.
However, you can also combine CRC validation with additional security to prevent
unauthorized r-code access. The DBAUTHKEY option of the PROUTIL utility allows you to set an
authorization key for your database. When you compile your source code, OpenEdge includes
the value of this authorization key in your r-code. You can also use the RCODEKEY option of
PROUTIL to insert the authorization key in existing r-code. Any r-code that does not include
the correct authorization key cannot run against your database. For more information about
using PROUTIL to create and set database authorization keys, see OpenEdge Data
Management: Database Administration.
B–26
R-code Features and Functions
During compilation, OpenEdge always inserts both database time stamps and CRCs in the
r-code. If a database is not connected with the Time Stamp (-tstamp) parameter during
procedure compilation, OpenEdge turns on a bit in the r-code. This bit tells the run-time
interpreter to check the CRC if the time stamp check fails.
Note: The Time Stamp (-tstamp) parameter is obsolete, and is supported only for backward
compatibility.
If you choose to have CRCs checked for a schema trigger, the r-code CRC of the trigger
procedure definition is stored in the trigger schema. The trigger procedure cannot run unless it
has a matching r-code CRC. This prevents a trigger procedure with the same name, but different
4GL code, from being improperly substituted for the original trigger procedure. Such a
substitution can cause damage to your database or override your security.
For other application r-code files, you can use the RCODE–INFO handle to build a procedure
security table that contains the name and r-code CRC of each r-code file in your application
(except the startup procedure). Before running a procedure, your application can use the
RCODE–INFO handle to validate the r-code CRC of its r-code file against the entry established for
it in the procedure security table.
Note: If there is no r-code for the procedure, any source (.p) procedure returns an unknown (?)
CRC value.
B–27
OpenEdge Deployment: Managing 4GL Applications
If you want CRC checking for all your schema triggers, you must specify it for each schema
trigger in your database. For more information, see OpenEdge Development: Basic
Development Tools (Character only) and, in graphical interfaces, the on-line help for the Data
Dictionary.
Trigger CRC validation works for both r-code and source versions of a trigger procedure. For
source versions, OpenEdge calculates the CRC during the session compile.
RCODE–INFO handle
The RCODE-INFO handle allows you to read the r-code CRC from an r-code file. You can use this
value to build a procedure security table, and then to verify the integrity of your application
r-code against it. You can also use this value in a deployment procedure that you run in a secure
context to automatically install database schema trigger definitions.
B–28
R-code Features and Functions
To read the r-code CRC from an r-code file, first set the FILE-NAME attribute of the RCODE-INFO
handle to the pathname of your r-code file. Then read the value of the CRC-VALUE attribute:
Note: The RCODE-INFO handle cannot read the r-code CRC from a session compile. For source
(.p) procedures, the CRC-VALUE attribute returns the unknown value (?).
• CRC — INTEGER field for the r-code CRC of the specified r-code file.
2. Construct a text file, crctable.dat, that contains a list of the relative pathnames for all
the secure procedures called by your application.
3. Compile and save the r-code for all the secure procedures in your application.
B–29
OpenEdge Deployment: Managing 4GL Applications
4. Run a procedure that contains code like this to build the RcodeSecurity table:
i = 0.
REPEAT:
SET proc-name.
FIND RcodeSecurity WHERE Filename = proc-name NO-ERROR.
IF NOT AVAILABLE(RcodeSecurity) THEN
CREATE RcodeSecurity.
RCODE-INFO:FILE-NAME = proc-name.
SET RcodeSecurity.Filename = proc-name
RcodeSecurity.Crc = RCODE-INFO:CRC-VALUE.
i = i + 1.
END.
INPUT CLOSE.
MESSAGE i "procedure security records created".
5. At each point where you call a secure procedure in your application, insert this code:
B–30
R-code Features and Functions
The following procedure installs new schema trigger definitions in an existing database. It reads
dump files that contain the new data for table and field metaschema trigger records and updates
these records with the new trigger procedure names and CRCs:
trload.p (1 of 2)
/* trload.p */
DEFINE VARIABLE i AS INTEGER.
DEFINE VARIABLE event AS CHARACTER FORMAT "x(6)".
DEFINE VARIABLE proc-name AS CHARACTER FORMAT "x(32)".
DEFINE VARIABLE table-name AS CHARACTER FORMAT "x(32)".
DEFINE VARIABLE field-name AS CHARACTER FORMAT "x(32)".
DEFINE VARIABLE rCRC AS INTEGER.
INPUT FROM "_file-tr.dat". /* Table trigger data */
i = 0.
_fl-loop:
REPEAT:
SET table-name event proc-name.
RCODE-INFO:FILE-NAME = proc-name.
rCRC = RCODE-INFO:CRC-VALUE.
FIND _file WHERE _file-name = table-name.
FIND _file-trig WHERE _file-recid = RECID(_file) AND
_event = event NO-ERROR.
IF AVAILABLE _file-trig THEN DO:
IF _File-trig._Proc-name = proc-name
AND _File-trig._Trig-CRC = rCRC THEN
NEXT _fl-loop.
ELSE DO:
/* Progress doesn’t let you modify a trigger record, so delete and
recreate. */
DELETE _File-trig.
CREATE _File-trig.
ASSIGN _File-trig._File-recid = RECID(_File)
_File-trig._Event = event
_File-trig._Override = TRUE
_File-trig._Proc-Name = proc-Name
_File-trig._Trig-CRC = rCRC
i = i + 1.
END.
END.
END.
B–31
OpenEdge Deployment: Managing 4GL Applications
trload.p (2 of 2)
INPUT CLOSE.
MESSAGE i "_file-trig records updated.".
INPUT FROM "_field-t.dat". /* Field trigger data */
i = 0.
_fld-loop:
REPEAT:
SET table-name field-name event proc-name.
RCODE-INFO:FILE-NAME = proc-name.
rCRC = RCODE-INFO:CRC-VALUE.
FIND _file WHERE _file-name = table-name.
FIND _field WHERE _file-recid = RECID(_file) AND
_field-name = field-name.
FIND _field-trig WHERE _field-trig._file-recid = RECID(_file) AND
_field-trig._field-recid = RECID(_field) AND
_event = event NO-ERROR.
IF AVAILABLE _Field-trig
AND _Field-trig._Proc-name = proc-name
AND _Field-trig._Trig-CRC = rCRC THEN NEXT _fld-loop.
ELSE DO:
DELETE _Field-trig.
CREATE _Field-trig.
ASSIGN
_Field-trig._File-recid = RECID(_File)
_Field-trig._Field-recid = RECID(_Field)
_Field-trig._Event = event
_Field-trig._Override = TRUE
_Field-trig._Proc-Name = proc-Name
_Field-trig._Trig-CRC = rCRC
i = i + 1.
END.
END.
INPUT CLOSE.
MESSAGE i "_field-trig records updated.".
Note: As this example shows, you must use the RECID function rather than the ROWID function
to reference metaschema table record locations.
B–32
C
OpenEdge Application Limits
The hardware and operating system version on which applications run often determines the
limits for applications. This appendix lists the limits you must consider when developing an
application. The limits are organized in the following sections:
• Input/output limits
• Sorting limits
• Name limits
• Compiler limits
For information about database limits, see OpenEdge Data Management: Database
Administration.
OpenEdge Deployment: Managing 4GL Applications
Input/output limits
Table C–1 lists the maximum number of characters you can use for input and output devices
(unless otherwise specified).
Operating
Device system Limit
Windows 80 columns.
Export file All 1 to 3,000 characters per field; 32K bytes per
record.
Import file All 1 to 3,000 characters per field; 32K bytes per
record.
Note: Windows NT batch files limit you to no more than nine (9) input parameters. This is a
Windows limitation. Actual executables handle more than nine.
C–2
OpenEdge Application Limits
Sorting limits
Table C–2 lists the limits for sorting data (unless otherwise specified).
Category Limit
Size Typically, 1 to 197 bytes (that is, approximately 200 bytes minus some
overhead per column and expression). The size limit depends on the
number of columns and expressions you are sorting. Each column and
expression uses up some number of available bytes.
C–3
OpenEdge Deployment: Managing 4GL Applications
Name limits
Table C–3 lists the maximum number of characters you can use in names (unless otherwise
specified).
Operating
Name type system Limit
C–4
OpenEdge Application Limits
Compiler limits
Table C–4 lists the limits for each element of the Compiler (unless otherwise specified).
Element Limit
Variables 32,000 bytes for UNDO and NO-UNDO variables per external procedure.
32,000 bytes for local UNDO and local NO-UNDO variables per internal
procedure or trigger block.
Statements 1 to 32,000 characters per statement. Use the Input Characters (-inp)
startup parameter to limit the number of characters allowed in a single
statement.
The number of tokens allowed per statement is limited only by the
available system resources. Each word or special character, such as a
parenthesis, plus sign, and minus sign, counts as one token. Use the
Token (-tok) startup parameter to limit the number of tokens allowed
in a single statement.
Nested blocks 1 to 255 blocks, including called procedures. Use the Nested Blocks
(-nb) startup parameter to limit the number of nested blocks allowed
in a procedure.
For more information about the Input Characters (-inp), Token (-tok), and Nested Blocks (-nb)
startup parameters, see OpenEdge Deployment: Startup Command and Parameter Reference.
C–5
OpenEdge Deployment: Managing 4GL Applications
C–6
D
Toolkit Contents and Reference
This appendix provides reference information for the Developer’s Toolkit utilities as described
in the following sections:
• Toolkit templates
Toolkit templates
You can use the templates provided with the Developer’s Toolkit, tailor them to the needs of
your application, and supply them with your application. The following templates are located
in the install-dir/toolkit/samples directory:
• upgrade — Upgrades an existing application with new data definitions and/or procedures.
D–2
Toolkit Contents and Reference
Utility Description
DBRSTRCT Defines the type of access that all users, including you, have
to your application.
D–3
OpenEdge Deployment: Managing 4GL Applications
DBRSTRCT utility
Defines the access that all users, including you, have to your application database.
Syntax
dbrstrct database-name
database-name
The name of the database for which you want to restrict access.
Notes • Before you define database access, it is very important that you make a copy of your
application database and precompile all of your application procedures against that
database. For example, suppose you do not precompile a procedure that updates the
database and then you deny update access to the database. You will be unable to compile
that procedure against the newly restricted database.
• Keeping a copy of the unrestricted database also lets you redefine the database restrictions
at a later time. To redefine database restrictions, dump the data from the restricted
database, make a copy of the unrestricted database, define restrictions on that database
copy, and reload the data into it.
dbrstrct mydb
D–4
Toolkit Contents and Reference
As you can see from the options listed in Figure D–1, you can define access globally, for all
files, or you can define access on a file-by-file basis. Any restrictions you define affect all users,
including yourself.
If you choose option 1 and deny update access but permit query access, no users, including
yourself, will have update access to files or fields in the database, unless that update is being
done by a procedure that was precompiled against the database before the database was
restricted. However, all users will be able to write procedures that query the database.
D–5
OpenEdge Deployment: Managing 4GL Applications
MKDUMP utility
Creates a set of file dump and file load procedures for a database.
Syntax
mkdumpc database-name
database-name
The name of the database for which you want to create dump and load procedures.
Note • The filedump.p and fileload.p procedures created by mkdump are meant to run from an
application menu inside OpenEdge. If you plan to have end users run these procedures
directly from the operating system level, you must first modify filedump and fileload.
Comments in the dumpdb and reloaddb scripts or batch files explain these modifications.
mkdump mydb
This command creates two main Progress 4GL procedures: filedump.p and fileload.p. In
addition, it creates two subdirectories: dmpprocs and ldprocs. The dmpprocs subdirectory
contains a single dump procedure for each file in the database; the ldprocs subdirectory
contains a single load procedure for each file in the database.
An end user runs the filedump.p procedure to dump the database. That procedure runs the
procedures in the dmpprocs subdirectory. To load the database, the user runs fileload.p, which
runs the procedures in the ldprocs subdirectory.
D–6
Toolkit Contents and Reference
XCODE utility
Encrypts Progress 4GL procedures and include files using either the default or a specified
encryption key.
Syntax
key
The encryption key. The key is an ASCII character string up to eight characters long. If key
is not supplied, the default key supplied by OpenEdge is used.
directory
The directory where the encrypted files are placed. The specified directory must be
different from the source directory, because each encrypted file retains the name of its
original source file. Existing files in directory are overwritten only if they are encrypted.
files
The relative pathnames of files to be encrypted. The pathnames supplied are appended to
directory. Therefore, you should build a directory structure exactly parallel to the source
directory structure, move to the source root, and specify relative pathnames.
- SYS$INPUT
Example
cd /applr001
xcode -k key1 -d applx001 *.p
D–7
OpenEdge Deployment: Managing 4GL Applications
Notes • You must create the full directory structure desired for your encrypted files before running
XCODE; XCODE does not create any directories implied by directory or files.
• The encryption algorithm is based on known techniques; therefore, the code is breakable.
If your source code is highly sensitive, consider additional security methods.
• Encrypted include files must use the same key as any procedure that includes them.
• Decrypt encrypted procedures with the XCODE option on the COMPILE statement. (The
XCODE option is not required if the procedures were encrypted with the default key.) The
XCODE option requires the same key used with the XCODE utility. Decryption is
incremental during compilation. Having the decryption key does not enable you to
examine a decrypted version of the source code. OpenEdge Development: Progress 4GL
Reference describes the COMPILE statement in detail.
D–8
Toolkit Contents and Reference
_tlr Module
Changes the default values of environment variables as defined in various scripts.
Syntax
_tlr var-name replace-value file-name ...
The first syntax format processes one file at a time. The second processes a list of files read from
a file.
var-name
A constant character string that identifies the environment variable whose value you want
to modify.
replace-value
A constant character string that identifies the new default value of the environment
variable.
file-name
The name of the file in which you want to modify the default value of the environment
variable.
file-list
The name of a file containing a list of filenames in which you want to modify the value of
the environment variable.
Example Several of the scripts provided with OpenEdge and the Toolkit name the DLC environment
variable as follows:
DLC=${DLC-/usr/dlc}
In this example, if the value of the DLC environment variable has been defined, the script uses
the value of that variable. Otherwise, it uses /usr/dlc as the value of DLC.
D–9
OpenEdge Deployment: Managing 4GL Applications
To change the default value of the DLC variable to /tmp/dlc in a script named test.dat, use
this command:
DLC=${DLC-/usr/dlc}
to:
DLC=${DLC-/tmp/dlc}
D–10
Index
A B
Action code segment, r-code B–2 Blank user IDs 3–7
Index–2
Index
Index–3
OpenEdge Deployment: Managing 4GL Applications
F K
File descriptor limits 2–2 KERMIT 10–4
File system recovery program (fsck) 5–14 Key bindings. See progress.ini file,
PROTERMCAP file
Files
buildenv scripts A–2 Keymapping
client.mon 5–7 See also progress.ini file,
distributing files on a network 5–11 PROTERMCAP file
edit buffer contents files 5–13 Version 6 4–55
local before-image files 5–13
parameter files 2–5
printcap files 7–6 L
printer control files 7–14
proc.mon 5–7 .lbi files 5–13
procedure library (.pl) files 6–6
progress.ini file 4–9, 5–12 Libraries B–6
PROTERMCAP file 4–41 See also PROLIB utility, R-code
sort (.srt) B–8 advantages 5–2
sort (.srt) files 5–3, 5–13 and code pages 6–23
temporary changes files 5–13 and PROPATH 6–9
temporary files 5–13 and r-code performance 5–2
temporary table files 5–13 listing contents 6–17
memory and network considerations
Fonts. See progress.ini file 6–10
memory-mapped format 6–2
Frame segment, r-code B–3 advantages 6–2
fsck (file system recovery program). See generating 6–14
loading and executing 5–4, 6–5
File system recovery program (fsck)
overview 6–2
PROPATH B–6
running procedures 6–6
I using a relative pathname 6–7
using an absolute pathname 6–6
IMAGE environment variable A–3 setting up 6–6
Index modifications 9–6 standard format 6–2
adding files 6–15
INI2REG Utility advantages 6–2
See also Registry compressing files 6–21
command line interface 4–4 creating 6–13
deleting files 6–16
Initial value segment, r-code B–2, B–4 extracting files 6–19
loading and executing 5–4, 6–4
Input/output device limits replacing files 6–16
number of characters C–2 tuning 5–6
Internationalization 9–4, 9–8 LIBRARY function 6–8
Index–4
Index
licensing A–2 N
Limits
Name limits
compiler C–5
number of characters C–4
input/output devices
number of characters C–2 newdb template D–2
name limits
number of characters C–4 Non-English character support 4–66
sorting C–3
Non-Progress databases 2–14
Loading 12–12 to 12–14
Index–5
OpenEdge Deployment: Managing 4GL Applications
Index–6
Index
Index–7
OpenEdge Deployment: Managing 4GL Applications
Index–8
Index
Table permissions
CAN-CREATE 3–4
U
CAN-DELETE 3–4
Unencrypted source 9–2 to 9–4
CAN-DUMP 3–5
CAN-LOAD 3–5 steps for deployment 10–4 to 10–6
upgrading applications 11–4
CAN-READ 3–4
CAN-WRITE 3–4 Unicode 4–20
Tables UNIX environment variable A–2
CRC calculation B–23
Upgrade templates 11–7, D–2
Templates D–2
Upgrades
Temporary changes files 5–13
Progress products 11–12
Temporary files User count, exceeding 2–15
defined 5–13
distributing 5–12 User environments
maintaining in Windows 4–2
Temporary table files 5–13
maintaining on UNIX 4–39
Index–9
OpenEdge Deployment: Managing 4GL Applications
Utilities W
See also Data Administration tool, Data
Dictionary Wide area networks, connecting 2–16
BUNDLE. See BUNDLE utility
DBRSTRCT. See DBRSTRCT utility Wild cards
INI2REG 4–2 and the PROLIB utility 6–13
MKDUMP. See MKDUMP utility
PROLIB 6–1, 6–11 Windows icons 4–37
PROUTIL 3–2
XCODE. See XCODE utility Working databases, selecting 2–17
Y
-y startup parameter, statistics B–15
Index–10