4 Ds
4 Ds
4 Ds
Product Guide
Copyright© 2000 Progress Software Corporation. All rights reserved.
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.
Progress®, Progress Results®, and WebSpeed® are registered trademarks of Progress Software Corporation.
Apptivity™, AppServer™, ProVision™, ProVision™ Plus, SmartObjects™, SonicMQ™, and all other
Progress product names are trademarks of Progress Software Corporation.
Progress Software Corporation acknowledges the use of Raster Imaging Technology copyrighted by
Snowbound Software 1993-1997. Progress® SonicMQ™ contains the IBM® XML Parser for Java Edition
and the IBM® Runtime Environment for Windows®, Java™ Technology Edition Version 1.1.8 Runtime
Modules.
Copyright© IBM Corporation 1998-1999. All rights reserved. U.S. Government Users Restricted Rights —
Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
Progress® is a trademark of Progress Software Corporation and is used by IBM Corporation in the mark
Progress/400 under license. Progress/400 AND 400® are trademarks of IBM Corporation and are used by
Progress Software Corporation under license.
All other company and product names are the trademarks or registered trademarks of their respective
companies.
June 2000
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Organization of This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii
Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx
Syntax Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
Progress Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiv
Other Useful Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvi
Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvi
Development Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvii
Reporting Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxviii
4GL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxix
Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxx
DataServers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxx
SQL-89/Open Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxx
SQL-92 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxi
Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxi
WebSpeed. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxii
Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxii
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–1
1.1 Progress/400 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–2
1.1.1 Client/Server, Web-based, or N-tier Architecture . . . . . . . . . . . 1–2
1.1.2 Native 4GL and Progress/400 AppServer Architecture . . . . . . 1–3
1.1.3 Inside Progress/400 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–4
1.2 Progress/400 Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–5
1.2.1 A Dictionary Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–5
1.2.2 The Server Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–5
1.2.3 Progress/400 Dictionary Objects . . . . . . . . . . . . . . . . . . . . . . . 1–7
Contents
iv
Contents
v
Contents
vi
Contents
vii
Contents
viii
Contents
ix
Contents
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Glossary–1
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Index–1
x
Contents
Figures
Figure 1–1: Progress/400 Client/Server Architecture . . . . . . . . . . . . . . . . . . . . . . . 1–2
Figure 1–2: Progress/400 Host-based Architecture . . . . . . . . . . . . . . . . . . . . . . . . 1–3
Figure 1–3: Progress/400 Internals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–4
Figure 2–1: DDM Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–8
Figure 3–1: The Progress/400 Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–2
Figure 4–1: How Progress/400 Accesses DB2/400 Database Files . . . . . . . . . . . . 4–2
Figure 4–2: TCP/IP Communications Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–3
Figure 4–3: SNA Communications Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–6
Figure 7–1: Progress/400 AdminServer Architecture . . . . . . . . . . . . . . . . . . . . . . . 7–3
Figure 7–2: Progress/400 AppServer Instance Architecture . . . . . . . . . . . . . . . . . . 7–4
Figure 7–3: NameServer Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–5
Figure 8–1: Server and Client Code Page Relationships . . . . . . . . . . . . . . . . . . . . 8–10
Figure 8–2: DUPPRODB Prompts and Responses . . . . . . . . . . . . . . . . . . . . . . . . 8–15
Figure 8–3: Collation Table Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–19
Figure 8–4: Specifying a Sort Order in a Collation Table . . . . . . . . . . . . . . . . . . . . 8–20
Figure 8–5: How DUPPRODB Works with the *FULLCPY Option . . . . . . . . . . . . . 8–33
Figure 8–6: How DUPPRODB Works with the *DCTONLY Option . . . . . . . . . . . . . 8–34
Figure 9–1: Progress/400 Data Dictionary Window . . . . . . . . . . . . . . . . . . . . . . . . 9–6
xi
Contents
Tables
Table 1–1: Progress/400 Server Schema Files . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–6
Table 1–2: How to Use This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–12
Table 1–3: Progress-related Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–13
Table 2–1: Progress and DB2/400 Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–2
Table 2–2: DB2/400-to-Progress Data Type Mapping . . . . . . . . . . . . . . . . . . . . . . 2–10
Table 2–3: DB2/400 Date Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–13
Table 2–4: Progress/400 Data Dictionary Options for SQL NULL and
Unknown Value Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–15
Table 2–5: Standard Progress and Progress/400 Transactions . . . . . . . . . . . . . . . 2–16
Table 2–6: CRTPROLKT Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–19
Table 2–7: OS/400 Impact on Progress Applications . . . . . . . . . . . . . . . . . . . . . . . 2–21
Table 2–8: Word Index Corruption Recovery Procedures . . . . . . . . . . . . . . . . . . . 2–33
Table 3–1: AS/400 Network Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–5
Table 3–2: Network Connection Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–8
Table 3–3: AS/400 Network Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–12
Table 3–4: Network Connection Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–16
Table 4–1: Progress/400 Connection Parameters . . . . . . . . . . . . . . . . . . . . . . . . . 4–7
Table 4–2: DataServer (-Dsrv) Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–9
Table 4–3: Network Type (-N) Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–14
Table 4–4: Server Name (-Sn) Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–15
Table 4–5: Connection Failure Responses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–19
Table 4–6: Connection Failure Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–20
Table 5–1: QSYS.LIB and IFS Path Resolutions . . . . . . . . . . . . . . . . . . . . . . . . . . 5–3
Table 5–2: DUPPRODB Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–5
Table 5–3: Integrated File System INPUT FROM Syntax . . . . . . . . . . . . . . . . . . . . 5–7
Table 5–4: Integrated File System OUTPUT TO Syntax . . . . . . . . . . . . . . . . . . . . 5–8
Table 5–5: QCMD Commands for File Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–10
Table 5–6: Defaults for -cp* Startup Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . 5–12
Table 8–1: DataServer (-Dsrv) Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–5
Table 8–2: CL Commands for Journaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–7
Table 8–3: Code Pages and Corresponding ALTSEQ Tables . . . . . . . . . . . . . . . . 8–16
Table 8–4: PROSET Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–23
Table 8–5: CHGPRODCT PROATR Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–29
Table 9–1: DataServer Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–2
Table 9–2: DB2/400 File Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–8
Table 9–3: DB2/400 Data Types with Progress Equivalents . . . . . . . . . . . . . . . . . 9–22
Table 9–4: Progress-to-DB2/400 Data Type Mapping . . . . . . . . . . . . . . . . . . . . . . 9–31
Table 10–1: ENDADMSVR Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10–6
Table 10–2: SETPROENV Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10–6
Table 10–3: Environment Variables Affected by SETPROENV . . . . . . . . . . . . . . . . 10–7
Table 10–4: CHGPRODCT Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10–9
Table 10–5: CRTPROLKT Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10–13
Table 10–6: CRTSCHIMG Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10–13
xii
Contents
xiii
Contents
xiv
Contents
Procedures
PGM1.P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–11
PGMA1.P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–11
CL Program That Calls a Progress Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–4
RPG IV Program That Calls a Progress Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–5
Progress Program sample.p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–5
Progress 4GL Program TestCall.P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11–7
CL Program TESTCLP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11–7
xv
Contents
xvi
Preface
Purpose
This manual explains how to use the Progress/400 products that include the Progress/400
DataServer, the Native 4GL Client, and the Progress/400 AppServer. This manual discusses
database design and programming issues to consider when creating applications that access the
Progress and DB2/400 database management systems. Additionally, it describes the client and
server utilities that support the Progress/400 products. Note that this manual is intended
specifically for Version 9.1 and later of the Progress/400 Product.
Throughout this document, DB2/400 refers to any database on the AS/400 that was created or
is maintained using DDS, IDDU, or SQL/400. Progress Software Corporation uses this name to
be consistent with IBM documentation.
If you are a Progress/400 customer, use this manual and the standard Progress (MS-Windows,
OS/2, and UNIX) documentation set for your specific Progress needs.
Audience
The Progress/400 Product Guide addresses these audiences:
• AS/400 developers
Describes the basic architecture of the Progress/400 products and presents guidelines for
using the Progress/400 DataServer, the Native 4GL Client, and the Progress/400
AppServer.
Explains how the Progress 4GL works with the Progress/400 products. It includes
information on data-type mapping and differences in the Progress 4GL when used against
a DB2/400 database.
Provides step-by-step instructions for setting up the server schema that allows you to
access DB2/400 database files with Progress applications through the Progress/400
DataServer. This chapter also provides step-by-step instructions for moving a Progress
database to the AS/400.
Describes the supported network protocols-SNA and TCP/IP-and provides instructions for
starting and maintaining the OS/400 communications jobs that these protocols require.
This chapter also describes how to connect to the schema holder and the DB2/400 database
in client/server mode. It includes information on Progress connection parameters and
connection troubleshooting.
Provides information on how to set up and use the AS/400-based clients. Topics discussed
here include the Integrated File System (IFS), creating a schema image, executing
Progress code on the AS/400, and internationalizing the native clients.
Explains starting, passing parameters, and executing triggers on the Native 4GL Client.
xviii
Preface
Describes how Progress uses the native AS/400 facilities to handle database security,
recovery, transaction undo, and locking. It also explains how to provide foreign character
support, tune the DataServer environment, submit batch jobs from the Progress client, and
duplicate a Progress/400 Dictionary Library to create a production or test environment.
Describes the utilities that you use to create and maintain the client schema holder on the
client. It also discusses how to use the Progress/400 Data Dictionary to maintain DB2/400
data definitions.
Describes the Progress/400 server utilities that you use to create and maintain the
DataServer environment on the AS/400.
Provides options with detailed steps to help you manage your Dictionary Library with
Progress/400.
Discusses issues related to legacy unknown values and Progress/400 support for the SQL
NULL value.
“Glossary”
xix
Progress/400 Product Guide
Typographical Conventions
This manual uses the following typographical conventions:
– New terms
– Code examples
– System output
• Small capitals are used for Progress key functions and generic keyboard keys.
END-ERROR, GET, GO
ALT, CTRL, SPACEBAR, TAB
• When you have to press a combination of keys, they are joined by a dash. You press and
hold down the first key, then press the second key.
CTRL-X
• When you have to press and release one key, then press another key, the key names are
separated with a space.
ESCAPE H
ESCAPE CURSOR-LEFT
xx
Preface
Syntax Notation
The syntax for each component follows a set of conventions:
• Uppercase words are keywords. Although they are always shown in uppercase, you can
use either uppercase or lowercase when using them in a procedure.
SYNTAX
• Italics identify options or arguments that you must supply. These options can be defined
as part of the syntax or in a separate syntax identified by the name in italics. In the
ACCUM function above, the aggregate and expression options are defined with the
syntax for the ACCUM function in the Progress Language Reference.
• You must end all statements (except for DO, FOR, FUNCTION, PROCEDURE, and
REPEAT) with a period. DO, FOR, FUNCTION, PROCEDURE, and REPEAT
statements can end with either a period or a colon, as in this example:
• Square brackets ([ ]) around an item indicate that the item, or a choice of one of the
enclosed items, is optional.
SYNTAX
In some instances, square brackets are not a syntax notation, but part of the language.
xxi
Progress/400 Product Guide
For example, this syntax for the INITIAL option uses brackets to bound an initial value
list for an array variable definition. In these cases, normal text brackets ( [ ] ) are used:
SYNTAX
• Braces ({ }) around an item indicate that the item, or a choice of one of the enclosed
items, is required.
In this example, you must specify the items BY and expression and can optionally specify
the item DESCENDING, in that order:
SYNTAX
{ BY expression [ DESCENDING ]}
In some cases, braces are not a syntax notation, but part of the language.
For example, a called external procedure must use braces when referencing arguments
passed by a calling procedure. In these cases, normal text braces ( { } ) are used:
SYNTAX
{ &argument-name }
In this example, EACH, FIRST, and LAST are optional, but you can only choose one:
SYNTAX
xxii
Preface
SYNTAX
• Ellipses (...) indicate that you can choose one or more of the preceding items. If a group
of items is enclosed in braces and followed by ellipses, you must choose one or more of
those items. If a group of items is enclosed in brackets and followed by ellipses, you can
optionally choose one or more of those items.
In this example, you must include two expressions, but you can optionally include more.
Note that each subsequent expression must be preceded by a comma:
SYNTAX
In this example, you must specify MESSAGE, then at least one of expression or SKIP, but
any additional number of expression or SKIP 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" ] ... }
• In some examples, the syntax is too long to place in one horizontal row. In such cases,
optional items appear individually bracketed in multiple rows in order, left-to-right and
top-to-bottom. This order generally applies, unless otherwise specified. Required items
also appear on multiple rows in the required order, left-to-right and top-to-bottom. In cases
where grouping and order might otherwise be ambiguous, braced (required) or bracketed
(optional) groups clarify the groupings.
xxiii
Progress/400 Product Guide
SYNTAX
In this example, ASSIGN requires one of two choices: either one or more of field, or one
of record. Other options available with either field or record are grouped with braces and
brackets. The open and close braces indicate the required order of options:
SYNTAX
Progress Messages
Progress displays several types of messages to inform you of routine and unusual occurrences:
• Compile messages inform you of errors found while Progress is reading and analyzing a
procedure prior to 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 Progress 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 following
execution messages.
xxiv
Preface
• Returns to the Progress Procedure Editor so that you can correct an error in a procedure.
This is the usual action taken following compiler messages.
• Halts processing of a procedure and returns immediately to the Procedure Editor. This
does not happen often.
Progress messages end with a message number in parentheses. In this example, the message
number is 200:
Use Progress online help to get more information about Progress messages. On the Windows
platform, many Progress tools include the following Help menu options to provide information
about messages:
• Choose Help→ Recent Messages to display detailed descriptions of the most recent
Progress message and all other messages returned in the current session.
• Choose Help→ Messages, then enter the message number to display a description of any
Progress message. (If you encounter an error that terminates Progress, make a note of the
message number before restarting.)
On the UNIX platform, you can use the Progress PRO command to start a single-user mode
character Progress client session and view a brief description of a message by providing its
number. Follow these steps:
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 Procedure Editor menu, and choose
File→ Exit.
xxv
Progress/400 Product Guide
Getting Started
Progress Electronic Documentation Installation and Configuration Guide (Hard copy only)
A booklet that describes how to install the Progress EDOC viewer and collection on UNIX
and Windows.
A manual that describes how to install and set up Progress Version 9.1 for the UNIX
operating system.
A manual that describes how to install and set up Progress Version 9.1 for all supported
Windows and Citrix MetaFrame operating systems.
A guide that provides a brief description of each new feature of the release. The booklet
also explains where to find more detailed information in the documentation set about each
new feature.
Progress Language Tutorial for Windows and Progress Language Tutorial for Character
Platform-specific tutorials designed for new Progress users. The tutorials use a
step-by-step approach to explore the Progress application development environment using
the 4GL.
xxvi
Preface
Progress Master Glossary for Windows and Progress Master Glossary for Character (EDOC
only)
Platform-specific master glossaries for the Progress documentation set. These books are
in electronic format only.
Progress Master Index and Glossary for Windows and Progress Master Index and Glossary for
Character (Hard copy only)
Platform-specific master indexes and glossaries for the Progress hard-copy documentation
set.
A reference manual that describes the Progress startup commands and parameters in
alphabetical order.
A booklet that explains how Progress software and media are packaged. An icon-based
map groups the documentation by functionality, providing an overall view of the
documentation set. Welcome to Progress also provides descriptions of the various services
Progress Software Corporation offers.
Development Tools
Progress ADM 2 Guide
A programmer’s guide to using the Progress AppBuilder visual layout editor. AppBuilder
is a Rapid Application Development (RAD) tool that can significantly reduce the time and
effort required to create Progress applications.
Progress Basic Database Tools (Character only; information for Windows is in online help)
A guide for the Progress Database Administration tools, such as the Data Dictionary.
xxvii
Progress/400 Product Guide
Progress Basic Development Tools (Character only; information for Windows is in online help)
A guide for the Progress development toolset, including the Progress Procedure Editor and
the Application Compiler.
A guide for the Progress Application Debugger. The Debugger helps you trace and correct
programming errors by allowing you to monitor and modify procedure execution as it
happens.
A guide that describes how to develop and integrate an online help system for a Progress
application.
A guide that describes how to use the Progress Translation Manager tool to manage the
entire process of translating the text phrases in Progress applications.
A guide that describes how to use the Progress Visual Translator tool to translate text
phrases from procedures into one or more spoken languages.
Reporting Tools
Progress Report Builder Deployment Guide (Windows only)
An administration and development guide for generating Report Builder reports using the
Progress Report Engine.
A tutorial that provides step-by-step instructions for creating eight sample Report Builder
reports.
A guide for system administrators that describes how to set up and maintain the Results
product in a graphical environment. This guide also describes how to program, customize,
and package Results with your own products. In addition, it describes how to convert
character-based Results applications to graphical Results applications.
xxviii
Preface
Progress Results User’s Guide for Windows and Progress Results User’s Guide for Unix
Platform-specific guides for users with little or no programming experience that explain
how to query, report, and update information with Results. Each guide also helps advanced
users and application developers customize and integrate Results into their own
applications.
4GL
Building Distributed Applications Using the Progress AppServer
A guide to accessing non-Progress applications from Progress. This guide describes how
to use system clipboards, UNIX named pipes, Windows dynamic link libraries, Windows
dynamic data exchange, Windows ActiveX controls, and the Progress Host Language Call
Interface to communicate with non-Progress applications and extend Progress
functionality.
A guide to developing Progress applications for markets worldwide. The guide covers
both internationalization—writing an application so that it adapts readily to different
locales (languages, cultures, or regions)—and localization—adapting an application to
different locales.
A three-volume reference set that contains extensive descriptions and examples for each
statement, phrase, function, operator, widget, attribute, method, and event in the Progress
language.
xxix
Progress/400 Product Guide
Database
Progress Database Design Guide
A guide that uses a sample database and the Progress Data Dictionary to illustrate the
fundamental principles of relational database design. Topics include relationships,
normalization, indexing, and database triggers.
This guide describes Progress database administration concepts and procedures. The
procedures allow you to create and maintain your Progress databases and manage their
performance.
DataServers
Progress DataServer Guides
These guides describe how to use the DataServers to access non-Progress databases. They
provide instructions for building the DataServer modules, a discussion of programming
considerations, and a tutorial. Each DataServer has its own guide, for example, the
Progress DataServer for ODBC Guide and the Progress DataServer for ORACLE Guide.
The Enterprise DataServer for ODBC includes MERANT ODBC drivers for all the
supported data sources. For configuration information, see the MERANT documentation,
which is available as a PDF file in installation-path\odbc. To read this file you must
have the Adobe Acrobat Reader Version 3.1 or higher installed on your system. If you do
not have the Adobe Acrobat Reader, you can download it from the Adobe Web site at:
http://www.adobe.com/prodindex/acrobat/readstep.html.
SQL-89/Open Access
Progress Embedded SQL-89 Guide and Reference
A guide that describes how to write and deploy Java and ActiveX applications that run as
clients of the Progress AppServer. The guide includes information about how to expose
the AppServer as a set of Java classes or as an ActiveX server.
xxx
Preface
A user guide and reference for programmers who use interactive Progress/SQL-89. It
includes information on all supported SQL-89 statements, SQL-89 Data Manipulation
Language components, SQL-89 Data Definition Language components, and supported
Progress functions.
SQL-92
Progress Embedded SQL-92 Guide and Reference
A guide to the Java Database Connectivity (JDBC) interface and the Progress SQL-92
JDBC driver. It describes how to set up and use the driver and details the driver’s support
for the JDBC interface.
A guide to the ODBC interface and the Progress SQL-92 ODBC driver. It describes how
to set up and use the driver and details the driver’s support for the ODBC interface.
A user guide and reference for programmers who use Progress SQL-92. It includes
information on all supported SQL-92 statements, SQL-92 Data Manipulation Language
components, SQL-92 Data Definition Language components, and Progress functions. The
guide describes how to use the Progress SQL-92 Java classes and how to create and use
Java stored procedures and triggers.
Deployment
Progress Client Deployment Guide
A guide that describes the client deployment process and application administration
concepts and procedures.
A guide to using the Developer’s Toolkit. This guide describes the advantages and
disadvantages of different strategies for deploying Progress applications and explains how
you can use the Toolkit to deploy applications with your selected strategy.
xxxi
Progress/400 Product Guide
A guide that explains how to use the Progress toolset to build applications that are portable
across all supported operating systems, user interfaces, and databases, following the
Progress programming model.
WebSpeed
Getting Started with WebSpeed
Provides an introduction to the WebSpeed Workshop tools for creating Web applications.
It introduces you to all the components of the WebSpeed Workshop and takes you through
the process of creating your own Intranet application.
Provides instructions for installing WebSpeed on Windows and UNIX systems. It also
discusses designing WebSpeed environments, configuring WebSpeed Brokers,
WebSpeed Agents, and the NameServer, and connecting to a variety of data sources.
Provides a complete overview of WebSpeed and the guidance necessary to develop and
deploy WebSpeed applications on the Web.
A booklet that provides a brief description of each new feature of the release. The booklet
also explains where to find more detailed information in the documentation set about each
new feature.
A booklet that explains how WebSpeed software and media are packaged. Welcome to
WebSpeed also provides descriptions of the various services Progress Software
Corporation offers.
Reference
Pocket Progress (Hard copy only)
A reference that lets you quickly look up information about the Progress language or
programming environment.
A reference that lets you quickly look up information about the SpeedScript language or
the WebSpeed programming environment.
xxxii
1
Introduction
The Progress/400 product allows you to access information stored in DB2/400 database files by
applications written in the Progress Fourth Generation Language (4GL). You can develop your
applications within the Progress Application Development Environment (ADE). The ADE
includes a set of graphical tools that helps you maintain databases and develop applications. In
addition to providing you with the Progress Application Development Environment (ADE)
tools, the product allows you to implement Progress database features and 4GL extensions in
applications that run with the DB2/400 database. Some of these tools and features are:
• AppBuilder — Use the AppBuilder to design and generate code for your graphical user
interfaces. For example, you can use the AppBuilder to create a browse widget for viewing
DB2/400 data.
• Native 4GL Client — Use the Native 4GL Client to run batch and report applications on
the AS/400.
This chapter presents an overview of the Progress/400 product. It describes how Progress
applications and databases work together with the DB2/400 DBMS through the DataServer.
Specifically, this chapter discusses product architecture and guidelines for using the product.
Progress/400 Product Guide
DB2/400
Database
Server 1 Server 2
Progress Progress
Client 1 Client 2
1–2
Introduction
• A connection can also be made from the middle-tier platform of a WebSpeed Transaction
Server or an AppServer instead of a Progress client.
• You can connect through TCP or SNA network protocols. The SNA connection requires
the use of specific routers. See the “SNA Communications Protocol” section in Chapter 4,
“Remote Access to Progress/400 DataServer,” for details.
Progress
Native
4GL Client
DB2/400 DB2/400
Progress
/400
AppServer
1–3
Progress/400 Product Guide
With the host-based Progress/400 architecture, the Progress Native 4GL Client as well as the
Progress/400 AppServer can run the Progress 4GL application on the AS/400. This takes
advantage of the AS/400 server performance and reduces the network load. These clients can
connect to multiple databases as long as they reside on the same AS/400. They are also
compatible with all of the supported client/server configurations for accessing data. However,
they do not have interactive capabilities.
1–4
Introduction
In the native architecture, you still migrate the data definitions into the Progress/400
environment on the AS/400, but instead of creating a schema holder remotely, you create a
schema image. You can use the Windows client to synchronize your schema image.
You can manage all of your data definitions through your Windows client. However, you still
have the option of maintaining the DB2/400 data definitions by means of DDS (including
SQL/400 and IDDU) on the AS/400.
1–5
Progress/400 Product Guide
P__SCHEMA1 Data definitions used by the native clients. These three files
P__SCHEMA2 comprise the schema image.
P__SCHEMA3
For example, the sever schema represents the DB2/400 physical file AS4CUST with four fields
defined-cust-num, name, address, zip-by an entry for AS4CUST in P__FILE and by four entries
in P__FIELD for cust-num, name, address, and zip.
The schema image contains the data definitions for the DB2/400 database like the schema
definitions stored in a schema holder for a remote client. The Native 4GL Client and the
Progress/400 AppServer use the schema image to map the data definitions in the server schema
to a format Progress can understand. See Chapter 5, “Preparing to Use AS/400-based Clients,”
for more information on creating the schema image.
1–6
Introduction
• Schema files
• User spaces
• User indexes
1–7
Progress/400 Product Guide
1. Use the Duplicate Progress/400 Database (DUPPRODB) server utility to copy the
demonstration database. The utility creates a server schema with the data definition
information and data from the specified database files.
See Chapter 3, “Creating the Progress/400 Environment,” for specific instructions on how to
run DUPPRODB and how to create a client schema holder.
1–8
Introduction
See Chapter 9, “Remote Client DB2/400 Utilities,” and Chapter 10, “AS/400 Utilities,” for
detailed descriptions of these utilities.
• Progress/400 AppServer
How you use the product depends on whether you plan to access information in existing
DB2/400 database files through a Progress application, or whether you plan to migrate a
Progress database to the AS/400. It also depends on whether you have used an earlier version
of the product and want to upgrade your applications. Additionally, you might want to run
Progress applications locally on the AS/400. The following sections briefly outline these
possibilities and point you to the information you need.
3. Create a Progress/400 server schema on the AS/400 that contains data definition
information from the DB2/400 database files that you want to access.
1. Determine whether you must modify any application code to handle differences between
accessing Progress and DB2/400 databases.
1–9
Progress/400 Product Guide
4. Dump the data definitions and, optionally, data from the Progress database.
7. Load data definitions to the server schema on the AS/400 with the Progress/400 Data
Dictionary tool.
4. If converting from a version earlier than Version 9.0A, convert the earlier version server
schema to the current version by running the CVTPRODCT server utility.
1–10
Introduction
1.4.5 Security
In the DataServer architecture, there are three levels at which you should consider security
issues:
• Schema-holder security — Implement standard Progress security for the schema holder
on the client as needed. For more information on schema-holder security, see the chapter
on security in the Progress Database Administration Guide and Reference.
• OS/400 security — Implement standard OS/400 security for the DB2/400 database files.
Progress applications accessing DB2/400 files are subject to any security for these files.
See Chapter 8, “System Administration,” for more information on database security.
1–11
Progress/400 Product Guide
1–12
Introduction
Topic Documentation
Using the Progress Data Dictionary Progress Language Tutorial for Windows or
Progress Language Tutorial for Character
Progress Basic Development Tools
(Character only; information for Windows is
in online help)
1–13
Progress/400 Product Guide
Topic Documentation
1–14
2
Common Product Information
The components of the Progress/400 product have common features and attributes. This chapter
discusses these features and attributes in the context of:
• Data types
• Transactions
• Queries
• Field lists
• Language restrictions
• Application security
Table File
Field Field
Record Record
Sequence Sequence
Trigger Trigger
2–2
Common Product Information
Object Names
These are the restrictions for naming Progress and DB2/400 database objects, including files,
tables, fields, and indexes:
• DB2/400 — Names can be up to 10 characters long and must follow OS/400 naming
conventions. Progress/400 supports SQL long names as input to the server schema through
the CHGPRODCT utility. For a description, see Chapter 10, “AS/400 Utilities.”
NOTE: The prefix, P__, is reserved for files in the Progress/400 server schema.
The set of characters that Progress allows includes all of the characters DB2/400 allows, so no
modifications to the DB2/400 file or field names need to be done before a Progress application
can reference them. However, when you move a Progress database to the AS/400, Progress/400
modifies Progress names as necessary according to these rules:
• If the first character is not A-Z, a-z, #, $, or @, Progress/400 replaces it with an “A.”
• If subsequent characters are not A-Z, a-z, 0-9, #, $, @, period (.), or comma (,) they are
replaced with an underscore (_).
2–3
Progress/400 Product Guide
For example, the property sheet for a field named sales-representative shows the AS/400 name
to be SALES_REPR.
Case-insensitive Indexes
By default, Progress is case insensitive, but you can define a field as case sensitive. DB2/400 is
case sensitive, but the Progress/400 product provides support for case insensitivity.
To enable DB2/400 database files to support case insensitivity, you must specify a
case-insensitive Alternate Sequence Collating Table when you run DUPPRODB on the AS/400.
See Chapter 8, “System Administration,” for more information on user-defined collation tables.
If at least one index field is case sensitive, the entire index is case sensitive.
If all index fields are case insensitive and you specified a code-page value for the DUPPRODB
ALTSEQCI keyword, that code-page value is specified as the DDS ALTSEQ parameter when
the logical file is compiled. Otherwise, the ALTSEQCI keyword value of the INSTALL command
is used.
2–4
Common Product Information
2.1.4 Triggers
Database triggers are code that an application associates with a database object and an action.
For example, writing a record can cause code associated with that object or action to execute.
DB2/400 supports insert before and after, update before and after, and delete before and after
triggers. Your database files can contain DB2/400 triggers and Progress triggers that you added
using the Progress/400 Data Dictionary tool.
2.1.5 Views
There is no direct equivalent for Progress views in DB2/400. However, DB2/400 database files
can include a type of logical file that provides the same functionality as a view-the joined logical
file. The Progress/400 Data Dictionary lists joined logical files as tables. You cannot update
data accessed with joined logical files.
2–5
Progress/400 Product Guide
To support these types of logical files, the DataServer places limitations on how and where you
can use them. A logical file is classified as a Progress/400 virtual table if it is a join, if its record
format is different from the physical file on which it is based, or if it contains more than one
record format.
In the case of multiple record logical files, the DataServer treats each record format as a separate
table. For example, the logical file ORDERLIN has two record formats identified as ORDER
and ORDER_LIN. The DataServer represents this file as two tables in the Progress/400 Data
Dictionary-ORDERLIN_ORDERR and ORDERLIN_ORDER_LINR.
You can view virtual tables through the Progress/400 Data Dictionary. You cannot maintain
them because the Progress/400 Data Dictionary has read-only access to virtual tables.
Virtual tables do not support record positioning by relative record number. You cannot use
RECID to access records in a virtual table. Any use of RECID with virtual tables produces
invalid results. The following code example uses RECID with virtual tables and therefore does
not return a valid record:
This command adds the member SAMPLEL, built over all of the members included in the
DTAMBRS parameter, to the logical file SAMPLEL.
2–6
Common Product Information
Progress/400 uses relative record numbers for its internal processing and positioning. The
DataServer cannot position to a record in a structure such as this because ILE/C does not
directly support it. As a work around, simply create matching members in both the logical and
physical files. Use the following OS/400 commands to add the logical file members:
The result is that the logical file SAMPLEL now contains the members M1, M2, M3, and M4.
The following code can successfully retrieve the correct record from member M4:
...
FOR EACH sample USE-INDEX SAMPLEL
...
DDM Files
DDM files are like pointer objects. They point to actual physical or logical files on a remote
AS/400. DDM file access uses SNA over an APPC network. It is possible to use TCP in place
of SNA.
2–7
Progress/400 Product Guide
AS/400 SYSTEMA
APPC Network over AS/400 SYSTEMB
Ethernet or Token Ring
using SNA or TCP/IP
CRTLIB LIB(SPORTS)
After you execute these commands, library SPORTS on SYSTEMA contains 2 DDM files,
named exactly the same as the physical and logical files on SYSTEMB. When the DDM files
are opened on SYSTEMA, the data is retrieved from SYSTEMB. This is the simplest DDM
implementation. You also can add Progress/400 to this design.
2–8
Common Product Information
Assume these files reside in the library SPORTS. In order to allow Progress/400 access to these
files, you must pull their definitions into Progress/400 using the Progress/400 command
CHGPRODCT. This command pulls the definitions of DB2/400 files into an existing Progress/400
Server Schema. To allow Progress/400 to assess the files in the library SPORTS, use the
following commands on SYSTEMB:
Once you have executed these commands and created a schema holder, Progress 4GL programs
can now access the files on SYSTEMB. However, the Progress/400 DataServer must be
executing on SYSTEMB first. In order to gain access to the files in library SPORTS from
SYSTEMA, follow these steps:
1 ♦ On SYSTEMB, save the SPORTSDL library to tape or a save file using the SAVLIB
command.
2 ♦ On SYSTEMA:
CRTLIB SPORTS
c. For each physical and logical file in the library SPORTS on SYSTEMB, execute the
following:
2–9
Progress/400 Product Guide
Once you have successfully created the DDM files, the Progress/400 DataServer can access the
Progress/400 dictionary library SPORTSDL on SYSTEMA. Now that the SPORTSDL library
exists on SYSTEMA, you must create a client schema holder so that the Progress 4GL can
access it. Once this is complete, connect to SPORTSDL using the CONNECT statement with
the -is parameter added to the connection parameters. This parameter prevents Level
Checking, which cannot be used when accessing DDM files. The following commands show a
sample connection with the additional -is parameter:
Progress
DB2/400 Type DDS Type Label
Equivalent
2–10
Common Product Information
Progress
DB2/400 Type DDS Type Label
Equivalent
1 Using the case-insensitive character string data type prevents the DataServer from performing selection by
server.
2
The packed decimal data type is labeled packed decimal (odd) or packed decimal (even digits) depending on
whether the field contains an odd or even number of digits, respectively.
3
The size of a signed 2-byte field cannot exceed 4 digits.
4
Progress supports two display formats for DATE: mm/dd/yy and mm/dd/yyyy. Use the Progress/400 Data
Dictionary to specify a display format. If you want to display dates in other formats, you can use the Progress
Date Format (-d) startup parameter or you can manipulate the data through your application code.
5 Progress does not have comparable data types. When you access a DB2/400 database, the Progress client ensures
that only valid values can be inserted in fields of this type. However, if you dump the definitions from a DB2/400
database and load the definition to a standard Progress database (non-schema holder), these data types are
implemented as character fields and lose the error checking.
CHARACTER
Progress CHARACTER fields map to DB2/400 single-byte character set (SBCS) fields, which
correspond to the DDS A data type. The display format specified in the Progress Data
Dictionary determines the DB2/400 field size. For example, the Customer.Name field has a
display format of 20 characters. The equivalent DB2/400 field length is 20 bytes.
2–11
Progress/400 Product Guide
The DB2/400 database can store character data in variable-length character strings. To enable
this function when creating character fields in the Progress/400 Data Dictionary, follow these
steps:
1 ♦ Choose the Field mode button in the Progress/400 Data Dictionary main window.
3 ♦ Select the table that will contain new fields from the Tables list.
4 ♦ Choose the Create Field button. The following dialog box appears:
6 ♦ Select the Variable Allocated toggle box and enter the allocated amount.
If you enter a Format of x(500) and allocate 50, DB2/400 will store the first 50 characters
in the allocated area of the field with a pointer to any remaining characters. Additionally,
the amount you allocate must be less than the maximum length of the Format. Choose the
Help button to access detailed information on all of the elements in the dialog box.
7 ♦ Choose OK.
2–12
Common Product Information
DATE
Progress DATE fields map to DB2/400 date fields, which correspond to the DDS L data type.
The DataServer creates a DB2/400 date field whose internal storage format is *ISO, which
stores dates as yyyy-mm-dd. Table 2–3 lists the date formats supported by DB2/400.
When a Progress application accesses dates in a DB2/400 database, it displays them in one of
these formats, regardless of the internal storage format:
• mm/dd/yy
• mm/dd/yyyy
Use the Field Properties sheet in the Progress/400 Data Dictionary tool to switch between
formats. To display dates in other formats, use the Date Format (-d) startup parameter or
manipulate the data through your application code.
DECIMAL
Progress DECIMAL fields map to DB2/400 packed decimal numbers, which correspond to the
DDS P data type. Depending on the number of digits in the DECIMAL field, the data type maps
to packed decimal (odd digits) or to packed decimal (even digits).
2–13
Progress/400 Product Guide
DB2/400 requires that you define precision (number of digits) and scale (number of digits to the
right of the decimal point). The DataServer uses the value of the Decimals field in the definition
as the value for the scale. It uses the number of digits in the format field as the value for
precision. If no format information is available, the DataServer uses the Progress default format
(->>,>>9.99) as the value for precision.
INTEGER
Progress INTEGER fields map to DB2/400 integers, which correspond to the DDS B data type.
Whether an INTEGER field maps to a four-byte or a two-byte integers depends on the size of
the display format:
• If the display format has four digits or less, the field becomes a two-byte integer.
• If the display format has more than four digits, the field becomes a four-byte integer.
LOGICAL
Progress LOGICAL fields map to single-character fields in DB2/400. A 0 represents false, a 1
represents true, and a question mark (?) represents the unknown value. The Progress/400 Data
Dictionary labels these fields as Logical.
1 ♦ Choose the Field mode button in the Progress/400 Data Dictionary main window.
3 ♦ Select the table that will contain the new field from the Tables list.
2–14
Common Product Information
4 ♦ Choose the Create Field button. The following dialog box appears:
You can select the Mandatory or the Null Capable option setting. Table 2–4 displays
possible settings for these two values. This table also describes which assignments are
allowed based on these option settings.
Table 2–4: Progress/400 Data Dictionary Options for SQL NULL and
Unknown Value Assignments
NOTE: If you currently have data files that do not support SQL NULLs and have the legacy
unknown value, see Appendix B, “Legacy Support and the Progress Unknown
Value.”
2–15
Progress/400 Product Guide
2.3 Transactions
The Progress RDBMS and the Progress/400 DataServer process records differently before a
transaction completes or is committed. The differences are as follows:
• In the Progress 4GL, transactions end at the end of the outermost block where an update
takes place. When a transaction that updates a DB2/400 database ends successfully, the
Progress/400 DataServer sends a COMMIT message to the DB2/400 data manager. If the
transaction is interrupted, Progress sends a ROLLBACK message to the DB2/400
RDBMS.
• If the transaction deletes records, the Progress RDBMS views the records as locked until
the transaction is complete except when another user attempts to read the record with
NO-LOCK, in which case Progress views the record as deleted.
• If the transaction deletes records, Progress/400 views the records as deleted except when
another user attempts to insert the record, in which case Progress/400 views them as
locked.
This difference is illustrated in Table 2–5, where a Progress transaction deletes RECORD A
before the transaction is committed. In this example, RECORD A means a record with a specific
key, such as CUSTOMER WHERE CUST-NUM = 300.
2–16
Common Product Information
2–17
Progress/400 Product Guide
In this example:
• The Progress/400 DataServer fails to find customer 111 because it has not yet written
customer 111 to the database.
Using the RELEASE statement might not be appropriate for all applications. When you release
the record, you lose your lock on it and run the risk of another user locking the record before
you are done with it. Also, if a release statement is issued in a subtransaction, the lock is not
released until the end of the main transaction.
2–18
Common Product Information
See the “Additional Locking Considerations” section for information about factors that affect
record locks in DB2/400. See the chapter on transactions in the Progress Programming
Handbook for more information on Progress locks.
You can also create a lock table when you run the DUPPRODB utility. Enter *YES for the
Create Progress Lock Table parameter. To delete the lock table, delete the OS/400 *USRSPC
object.
2–19
Progress/400 Product Guide
SHARE-LOCK Implications
When you implement standard DB2/400 locks instead of standard Progress locks, you might
encounter problems with applications that depend on Progress SHARE-LOCKs. For example,
if the program PGM-A has a record under EXCLUSIVE-LOCK, and the program PGM-B
requests the same record (SHARE-LOCK), the Progress/400 DataServer allows PGM-B access
to the record. You will have a problem if PGM-A updates the record and releases the lock, and
PGM-B then updates the record based on the old data. To resolve this problem, explicitly
specify EXCLUSIVE-LOCK when you read records for update.
• When you implement Progress locks in the OS/400 environment, the Progress locks apply
only for other Progress applications. The DataServer implements the
EXCLUSIVE-LOCK as an OS/400 LOCK. The standard OS/400 lock rules apply for
non-Progress applications. This is an important factor because OS/400 locks one record
per file, while the DataServer can read and lock more than one record. The following
example illustrates how this can affect your applications:
OS/400 locks one record per file except when multiple records are locked in one file,
commitment control is active, and a transaction is pending.
2–20
Common Product Information
Table 2–7 shows how locks for records accessed by this procedure are implemented.
Progress/400 applications view record 1 as locked throughout the entire procedure, but
OS/400 sees record 1 as locked only until record 2 is read.
• Each physical file (data file) has a WAITRCD parameter that defines the number of
seconds a program waits for a record to be updated or deleted. If the record is not available
in the specified time, you get an error message. For most OS/400 files, the WAITRCD
default is 60 seconds.
You can modify the WAITRCD parameter for physical files using the CHGPF CL command
and for logical files using the CHGLF CL command. See the AS/400 CL Reference for more
information.
• When you use multiple defined buffers in a Progress 4GL procedure, the Progress/400
DataServer opens only one data path to the file, allocates only one cursor, and locks only
one record. The Progress 4GL allows a record to be locked for each defined buffer;
however, Progress/400 allows only one record per open data path.
2–21
Progress/400 Product Guide
• If the AS/400 crashes and records are locked through the Progress lock table, you might
need to delete and re-create the table.
• Another technique for avoiding SHARE-LOCK conflicts is to read all records initially
with NO-LOCK, then reread them with EXCLUSIVE-LOCK just before committing
changes. This technique minimizes the penalty inherent in holding an
EXCLUSIVE-LOCK for a long period of time.
2.4 Queries
The Progress 4GL allows you to write database-independent queries. However, you might want
to create queries that take advantage of certain DB2/400 features or DataServer performance
enhancements.
Progress/400 supports index repositioning.
Because the following query contains a nonkeyed field name, it returns unpredictable results
when used against joined logical files:
Other queries might or might not work properly. Before you include a query against a joined
logical file in an application, make sure to determine whether it works in your environment.
2–22
Common Product Information
• Fields lists allow you to select a short list of fields to retrieve in a query. Only the fields
listed in the FIELDS clause of DEFINE QUERY are retrieved, thus shortening the data
length of the record.
• Field lists are enabled only in a NO-LOCK query. If the query specifies SHARE-LOCK
(the default) or EXCLUSIVE-LOCK, field lists are turned off and the entire record is
retrieved.
• Specifying a field list in conjunction with a NO-LOCK query enables record prefetch. This
allows the Progress/400 DataServer to pack the shortened field list records together, up to
the size of the Message Buffer Size (-Mm) startup parameter.
• Message Buffer Size (-Mm) startup parameter — To control the size of the network
message, use the Message Buffer Size (-Mn) startup parameter when you start the Progress
client. For details, see the “Using the Message Buffer Size (-Mm) Startup Parameter”
section in Chapter 4, “Remote Access to Progress/400 DataServer.”
• Total number of records — If a file contains only a few records (less than 100), using
field lists does not enhance performance. To see the benefit of field lists, the file must
contain enough records (5,000-1,000,000) so that a normal query takes 20 to 30 seconds
to run.
• Record length — Field list improvements are most dramatic when the record length of a
file is close to, or greater than, the Message Buffer Size (-Mm) startup parameter. For
example, assume that the file “FILEA” has a record length of 4200 bytes and a -Mm
parameter setting of 4000. Since the record length is larger than the -Mm setting, each
whole record requires two network packets. The first packet contains the first 4000 bytes
of the record, the second contains the remaining 200 bytes. The record is reassembled on
2–23
Progress/400 Product Guide
the client. Also, if the file has only a 3000-byte record length, you can still send only one
record per network packet. In both of these cases, a field list query can be quite helpful. If,
for example, a query requires only two fields (totaling 20 bytes), the DataServer can pack
200 field list records into the 4000-byte network packet.
• Specifying too many fields in the FIELDS phrase — If your field list query specifies
more than approximately half of the fields in the file, the additional overhead to process
the field list outweighs any benefit, thus potentially degrading performance. Generally,
you should limit the fields in a query (browser) to just a few and reread specific users’
selected records by RECID.
Progress/400 provides the same support for both a DB2/400 database and a Progress database
when using field list queries. The following example returns the same result for both a Progress
database and a DB2/400 database:
Include the SCROLLING option to enable record prefetch. You must include the NO-LOCK
option when you open queries with field lists, as in the following example:
Similarly, you must include the NO-LOCK option in FOR EACH statements that include field
lists, as in the following example:
Alternatively, you can tune the database to have NO-LOCK as the default. This allows you to
use field lists without specifying the NO-LOCK query option.
Use field lists to retrieve only those fields that your application requires. (For performance
reasons, the Progress/400 DataServer retrieves the first index field even when you do not
include it in the field list. In cases when the DataServer can predict that a query requires a
refetch, it retrieves the entire record.) The DataServer allocates memory based on the maximum
size specified for a field in a record. Omitting larger fields from a query enhances performance.
2–24
Common Product Information
When the DataServer processes a query with a field list, it caches the fields that are part of the
field list and any other fields that the query specified, which you can then access without making
another call to the DB2/400 RDBMS. For example, the Progress/400 DataServer fetches the
name and the zip field to process the following query:
See the Record Phrase entry in the Progress Language Reference for more information on the
FIELDS option.
2–25
Progress/400 Product Guide
CREATE customer.
a=ROWID (customer).
The DataServer creates a customer record using default values. After the user assigns values to
the fields in that record, the DataServer updates it. When you UNDO the transaction, the
DataServer deletes the record.
If you have a unique index on that file, two users cannot access the default value of the indexed
field simultaneously.
The value returned by the ROWID function is the DB2/400 relative record number (RRN) of
the database record currently associated with the specified record buffer. Therefore, the value
is not unique across all records in the database, but it is unique across all records of its associated
file. You can use ROWID in Progress/400 as you do in standard Progress with the following
additional restrictions:
• In standard Progress, when you delete a record and then UNDO the delete transaction, the
ROWID value remains the same because Progress reserves the ROWID value in the
database until it commits the transaction.
• In Progress/400, the ROWID value can change during a delete transaction because the
record is deleted from the database before the transaction is committed, and without
holding a place in the database. When the rollback (UNDO) occurs, the record is added
back into the file.
• For virtual table ROWID considerations, see the “Virtual Tables” section.
• ROWID provides the same functionality as RECID, but ROWID is more consistent across
data sources.
2–26
Common Product Information
2–27
Progress/400 Product Guide
UPDATE SPACE (2) hostid SKIP SPACE (2) id LABEL "UserID" SKIP password
BLANK WITH CENTERED ROW 8 SIDE-LABELS ATTR-SPACE
TITLE " Login to Database ".
args = " -H " + hostid + " -U " + usrid + " -P " + password + -N TCP.
HIDE ALL.
2–28
Common Product Information
• You cannot build a Progress/400 word index over a multi-member physical file.
• If you build a Progress/400 word index over a physical file that uses DB2/400 triggers, the
DB2/400 triggers are replaced with Progress/400 triggers.
The following section explains how to set up and use Progress/400 word indexing. Subsequent
sections provide a technical discussion of word indexing and discuss coding considerations.
These tasks use a number of server utilities. For details, see Chapter 10, “AS/400 Utilities.”
Once you have built a word index, you use the Progress/400 Data Dictionary to maintain it. For
details, see Chapter 9, “Remote Client DB2/400 Utilities.”
1 ♦ If the default word-break table (named DFTWISWST) is not adequate for your needs:
b) After the table has been created, replace the Dictionary’s word-break table using the
RPLDCTWBT utility.
2 ♦ Use the Progress/400 Data Dictionary to create one or more word indexes over one or
more tables.
NOTE: If you create word indexes over journaled tables, you must start the Progress/400
Word Index Support Processor using the STRWISPRC utility before you can
perform any file update operations.
You can now use your word indexes.
2–29
Progress/400 Product Guide
1 ♦ If the default word-break table (named DFTWISWST) is not adequate for your needs,
create a new word-break table using the UPDPROWBT utility.
2 ♦ Use the DUPPRODB to create a new Progress/400 Dictionary Library. If you created a
new word-break table in Step 1, be sure to specify it on the DUPPRODB command line.
3 ♦ Use the Progress/400 Data Dictionary to either add tables, indexes, and so forth, or load
your definition (.df) file.
Loading a definition file that contains word indexes creates an index with a default word
size of 30. You can change this size prior to committing by using the Index Property screen
in the Progress/400 Data Dictionary. See the “Modifying an Index” section in Chapter 9,
“Remote Client DB2/400 Utilities,” for details.
NOTE: If you create word indexes over tables that will be journaled, you must start the
Progress/400 Word Index Support Processor using the STRWISPRC utility
before you can perform any file update operations.
You can now use your word indexes.
2 ♦ Use the UPDWISTRG command to update the library of the trigger program for each physical
file that has word indexes.
2 ♦ After the table has been created, use the RPLDCTWBT utility to update the word index
definitions in the Progress/400 Dictionary Library.
Running this utility rebuilds each word index using the new table’s rules from that
Dictionary Library.
2–30
Common Product Information
• If commitment control is not in effect, the word index update is performed in the trigger
program before control is returned to the application program. This operation is
synchronous. Therefore, control is not returned to your program until the trigger program
completes its work.
NOTE: If the trigger program detects that commitment control is active but the Word Index
Support Processor is not running, the trigger program sends an escape message to the
application program indicating that the trigger program failed. If your application
does not handle this escape message properly, your application might fail. If your
application uses commitment control, files that are opened under commitment
control cannot be updated if the Word Index Support Processor is not running.
2–31
Progress/400 Product Guide
• The PROWISDTAQ job handles the actual update of Progress/400 word indexes.
These jobs use a Progress/400 library called the Word Index Work Library.
NOTE: If the AS/400 crashes, you might not be able to restart the word index processor. If
this occurs, call Progress Technical Support.
These objects are static and are always in the Work Library. In addition, some dynamic objects
are placed in this library while the Word Index Support Processor is running.
Multiple installations of Progress/400 can share the Word Index Work Library.
2–32
Common Product Information
If you run these commands, you must follow specific recovery procedures to fix the problems
that they cause. Table 2–8 documents the commands, the resulting problems, and the recovery
procedures.
2–33
Progress/400 Product Guide
RSTLIB to restore the Because the original library Add the new Progress/400
Progress/400 Product no longer exists, the trigger Product Library to your
Library into a different program is not found when a library list, then run the
library. file with word indexes built UPDWISTRG utility to
over it is opened. change trigger programs for
any files in that library that
have word indexes built over
them.
For descriptions of the utilities noted in the recovery procedures, see Chapter 10, “AS/400
Utilities.”
Note that this program uses the AND keyword between the CONTAINS clauses. Remote
Progress clients, Version 9.0A or earlier, cannot handle a query of this type. However, you can
2–34
Common Product Information
work around this problem by substituting the following code, which omits the AND keyword
and uses normal CONTAINS syntax:
Extent Fields
The Progress/400 DataServer supports extent fields just as the Progress database does; however,
DB2/400 does not support extents or arrays in DB2/400 physical files. Extent support is
provided by placing each element of an extent field contiguously in the physical file’s record
format. For example, suppose that you use the Progress/400 Data Dictionary to create a table
named TBL1 that contains the following fields:
Cust-Num Integer 0
Name Character 0
Comment Character 6
CUST-NUM Binary 4
NAME Character 20
Comment01 Character 25
Comment02 Character 25
Comment03 Character 25
Comment04 Character 25
Comment05 Character 25
Comment06 Character 25
2–35
Progress/400 Product Guide
Observe that the single six-extent Comment field of TBL1 has been converted to a set of six
Commentxx fields in the DDS. These Commentxx fields are unknown to the Progress client.
Each Commentxx field represents one element of the Progress extent field, and the fields exist
in the record format contiguously. When you build a word index using the Comment field, all
of the Commentxx fields are considered to be a single large character file or buffer, and words
are pulled from the entire buffer to generate the index.
This conversion of extent fields for AS/400 might cause some unexpected results when
querying the file. Since the entire buffer consisting of all of the fields is considered to be the
extent field, word separation might be an issue. When the Comment field is updated using the
Progress UPDATE statement, each extent of the field is a distinct field; however, when the data
entered is sent to the AS/400, it is stored in a single large buffer, and the individual elements of
the EXTENT field are not known. This is not true in a Progress database, where each element
of the EXTENT field is considered to be a separate field.
Suppose, for example, that:
The query does not find THIS because the text in the Comment buffer is as follows:
TEST OF EXTENT WORD BREAKTHIS IS A WORD BREAK TEST
Record Locking
Normal record-locking rules apply when performing query-by-word queries.
2–36
3
Creating the Progress/400 Environment
This chapter describes how to create the components that allow you to access databases.
Specifically, it discusses:
• Programming considerations
3.1 Overview
Progress/400 allows you to use Progress applications to access data stored in a DB2/400
database on the AS/400. To do this, you must create a Progress environment on the AS/400. The
Progress environment is where the data definitions for the DB2/400 database files will be stored
in a format that Progress can read. These data definitions will be contained in a series of files
whose names begin with P__. These files reside in the server schema contained in a single
library, although your DB2/400 database files might be distributed across many libraries.
Other components that make up the Progress/400 environment are the client and its schema
holder. Accessing DB2/400 database files through the DataServer involves migrating the data
definitions into the Progress/400 environment on the AS/400 and creating a schema holder on
the client with those same data definitions so that they can be read by Progress applications. The
client component also includes the Progress/400 Data Dictionary tool that allows you to
maintain DB2/400 data definitions from the Progress client. All of your development can be
done in a single environment. However, you still have the option of maintaining the DB2/400
data definitions by means of DDS on the AS/400. Figure 3–1 shows the client and server
components of the Progress/400 environment.
3–2
Creating the Progress/400 Environment
• If the DB2/400 database files use a code page other than IBM037, make sure that you have
the appropriate ALTSEQ tables to handle case issues. See the “User-defined Collation
Tables” section in Chapter 8, “System Administration,” for a discussion of issues to
consider.
• Run DUPPRODB to create the empty server schema on the AS/400 machine.
• Run CHGPRODCT to populate the schema files with data definitions for the DB2/400
database files.
• Adjust your code to account for differences in behavior between the Progress RDBMS and
DB2/400.
• Decide how you will maintain the DB2/400 data definitions: either through DDS on the
AS/400 machine or through the Progress/400 Data Dictionary on the client PC. Do not mix
the two methods.
• If you use DDS to maintain data definitions, update the server schema with CHGPRODCT
to reflect any modifications that you make to the DB2/400 definitions.
1 ♦ Make sure that you have basic connectivity between the AS/400 and your PC client.
3 ♦ Type DUPPRODB at the OS/400 command line, then press F4 to display the utility’s
parameters.
3–3
Progress/400 Product Guide
4 ♦ Press F10 to view more parameters. For a complete description of all of the parameters, see
the “Duplicate Progress/400 Database (DUPPRODB)” section in Chapter 10, “AS/400
Utilities.”
The DUPPRODB utility creates the Progress/400 environment on the AS/400 machine
and builds the structure for the server schema. After you run the DUPPRODB utility, run
the CHGPRODCT utility as described in the “Changing Data Definitions
(CHGPRODCT)” section to re-create the data definitions for your DB2/400 database files.
The utility stores those data definitions in the server schema in the Progress/400
environment that you created with the DUPPRODB utility.
1 ♦ Type CHGPRODCT at the OS/400 command line, then press F4 to display the utility’s
parameters.
2 ♦ Complete the parameters. For a complete description of all of the parameters, see the
“Change Progress/400 Dictionary Utility (CHGPRODCT)” section in Chapter 10,
“AS/400 Utilities.”
The CHGPRODCT utility translates DB2/400 definitions into Progress definitions on the
AS/400 and stores these in files with a P__ prefix. The Progress/400 server schema now
contains the data definitions for the DB2/400 database files that you want to access
through a DataServer application.
3 ♦ Since the next task requires accessing the AS/400 from the client machine, make sure that
you set up the appropriate network connections and start any supporting processes on the
AS/400. Table 3–1 briefly lists what you must do for each protocol. See Chapter 4,
“Remote Access to Progress/400 DataServer,” for more details.
3–4
Creating the Progress/400 Environment
Protocol Startup
Next, you must set up the client component of the Progress/400 environment.
• Run the Create DataServer Schema utility on the client, which copies the data definitions
of the DB2/400 database files.
The schema holder need not reside on the client machine. For example, for ease of maintenance,
you can locate the schema holder on a file server that multiple clients can access.
NOTE: A single schema holder can hold schemas for several non-Progress databases. In
addition, it can hold the schema for one Progress database.
3–5
Progress/400 Product Guide
See the Progress Database Administration Guide and Reference for information on these
techniques.
This section describes how to create a database with the Data Administration tool. Follow these
steps to create and connect an empty Progress database on your client machine:
1 ♦ Start the Progress desktop with no database connected and access the Data Administration
tool.
2 ♦ From the main menu, choose Database→ Create. The Create Database dialog box appears:
3 ♦ Type the schema-holder name (for example, as4sh) in the New Physical Database Name
field. This name must be different from the server schema library on the AS/400.
5 ♦ Choose OK. The Connect Database dialog box appears. By default, the name of the newly
created database appears in the Physical Name field.
You do not need to provide any additional connection information. You can add
connection parameters when you create the database or edit connection information later.
See the online help for a complete description of the Connect Database
dialog box.
3–6
Creating the Progress/400 Environment
If you choose to add a logical database name in the Logical Name field, use the logical
database name to refer to the database in your programming applications. For more
information on database names, see the database access chapter in the Progress
Programming Handbook.
6 ♦ Choose OK to connect the empty Progress database and return to the Data Administration
main window.
• Add the data definitions for your DB2/400 database files to the server schema.
2 ♦ From the Data Administration main menu, select DataServer→ DB2/400 Utilities→ Create
DB2/400 DataServer Schema.
3–7
Progress/400 Product Guide
3 ♦ Type the name of the library that contains the server schema in the Dictionary Library
Name field.
4 ♦ Add logical database name information. A logical database name is a database reference
that represents the name of a connected physical database. Progress uses the logical
database name to resolve database references. When a procedure is compiled against a
database, Progress stores the logical database name in the procedure’s r-code. When a
procedure executes, its database references must match the logical name of a connected
database.
5 ♦ In the Code-Page field, type the name of the code page that the DB2/400 database files use
(for example, IBM500). By default, the code page is IBM037.
If your DB2/400 database files use a code page that Progress does not support, you must
supply a conversion table in the CONVMAP.DAT file on the client. This file translates between
the Progress client code page and the code page that the DB2/400 database files use.
6 ♦ Enter the information that your network protocol requires, as Table 3–2 describes.
3–8
Creating the Progress/400 Environment
This connection information is stored with the schema holder. Progress uses the
parameters that you provide here whenever you connect to the schema holder though the
Data Dictionary or Data Administration tool, or reference a file within the DB2/400
database.
7 ♦ Choose OK. After the utility loads the data definitions of the P__ files, you can choose to
synchronize the client schema holder with the server schema.
9 ♦ Choose OK.
The Progress Data Administration tool provides a set of DB2/400 utilities that you can use to
maintain a client schema holder. See Chapter 9, “Remote Client DB2/400 Utilities,” for
descriptions of these utilities.
• Supply a new schema holder with the P__files and incorporate the as4sync.p procedure
into your application. See Chapter 9, “Remote Client DB2/400 Utilities,” for information
on this procedure.
• From the client using the Progress/400 Data Dictionary. Use this technique only from
Progress clients running in MS-Windows. UNIX clients do not support the Progress/400
Data Dictionary. See Chapter 9, “Remote Client DB2/400 Utilities,” for information on
using the Progress/400 Data Dictionary.
CAUTION: Do not use the Progress/400 Data Dictionary if your DB2/400 database files
contain DDS definition attributes that are not supported by the Progress/400
DataServer. Any attributes that are not supported will be lost.
3–9
Progress/400 Product Guide
• On the AS/400 using DDS or SQL. Use this technique if your DB2/400 database files
contain data that both Progress and AS/400 high-level languages (HLL) applications
access.
When you make changes with DDS or SQL, do the following to make sure that the changes are
reflected throughout the Progress/400 environment:
1. Run the CHGPRODCT utility to update the Progress/400 environment with those
changes. You must run this utility even if the only change you make is to move a DB2/400
file to another library.
2. On the client machine, run the Synchronize Progress/400 Client utility to synchronize the
client schema holder so that it reflects the changes that you made on the AS/400, or
incorporate the as4sync.p procedure into your application. You must do this for each
client.
• Database objects
• Data types
• Locking behavior
• Establish basic connectivity between the client machine and the AS/400.
• Run DUPPRODB to create the empty server schema on the AS/400 machine.
3–10
Creating the Progress/400 Environment
• Load the data definitions from your Progress database into the Progress/400 environment.
• Adjust your code to account for differences in behavior between Progress and DB2/400.
• Decide how you will maintain the DB2/400 data definitions: either through DDS on the
AS/400 machine or through the Progress/400 Data Dictionary on the client machine. Do
not mix the two methods.
• If you use DDS to maintain data definitions, update the server schema with CHGPRODCT
to reflect any modifications that you make to the DB2/400 definitions.
1 ♦ Make sure that you have basic connectivity between the AS/400 and your client.
2 ♦ Type DUPPRODB at the OS/400 command line, then press F4 to display the utility’s
parameters.
3 ♦ Press F10 to view more parameters. Complete the parameters. For a complete description
of all of the parameters, see the “Duplicate Progress/400 Database (DUPPRODB)” section
in Chapter 10, “AS/400 Utilities.”
The DUPPRODB utility creates the Progress/400 environment on the AS/400 machine
and builds the structure for the server schema.
4 ♦ Since subsequent tasks require accessing the AS/400 from the client machine, make sure
that you have set up the appropriate network connections and started any supporting
processes. Table 3–3 briefly lists what you need to do for each protocol. See Chapter 4,
“Remote Access to Progress/400 DataServer,” for more details.
3–11
Progress/400 Product Guide
Protocol Startup
Next, you will run client utilities to dump and load Progress data definitions and data into the
Progress/400 environment.
1 ♦ Start Progress, connect to your database, and access the Data Administration tool.
2 ♦ From the Data Administration main menu, choose Admin→ Dump Data and Definitions→
Data Definitions (.df file) to dump the data definitions from your database or from specific
tables in your database.
3 ♦ If you are also moving data to the AS/400, choose Admin→ Dump Data and Definitions→
Table Contents (.d file) to dump the data from your database or from specific tables in your
database.
Next, you must create a client schema holder so that you can access your data definitions on the
AS/400 with Progress client applications through the DataServer.
3–12
Creating the Progress/400 Environment
• Run the Create DataServer Schema utility on the client, which loads the data definitions
of the P__ files into the client schema holder.
The schema holder need not reside on the client machine. For example, for ease of maintenance,
you can locate the schema holder on a file server that multiple clients can access.
See the Progress Database Administration Guide and Reference for information on these
techniques.
3–13
Progress/400 Product Guide
This section describes how to create an empty database with the Data Administration tool.
Follow these steps to create and connect an empty Progress database on your client machine:
1 ♦ Start Progress with no database connected and access the Data Administration tool.
2 ♦ From the main menu, choose Database→ Create. The Create Database dialog box appears:
3 ♦ Type the schema-holder name (for example, as4sh) in the New Physical Database Name
field.
5 ♦ Choose OK. The Connect Database dialog box appears. By default, the name of the newly
created database appears in the Physical Name field:
You do not need to provide any additional connection information. You can add
connection parameters when you create the database or edit connection information later.
See the online help for a complete description of the Connect Database dialog box.
If you choose to add a logical database name in the Logical Name field, use the logical
database name to refer to the database in your programming applications. For more
information on database names, see the database access chapter in the Progress
Programming Handbook.
6 ♦ Choose OK to connect the empty Progress database and return to the Data Administration
main window.
3–14
Creating the Progress/400 Environment
Next, run the Create DataServer Schema utility, as the “Creating the Client Schema Holder”
section describes.
2 ♦ From the Data Administration main menu, select DataServer→ DB2/400 Utilities→ Create
DB2/400 DataServer Schema. The following dialog box appears:
3 ♦ Type the name of the library that contains the empty server schema in the Dictionary
Library Name field.
5 ♦ In the Code-Page field, type the name of the code page that the DB2/400 database files that
contain your Progress definitions use. By default, the code page is IBM037.
If your DB2/400 database files will use a code page that Progress does not support, you
must supply conversion tables that translate between the Progress client code page and the
3–15
Progress/400 Product Guide
code page that the DB2/400 database files use. Entries for these tables must be placed in
the CONVMAP.DAT file for the client.
6 ♦ Enter the information that your network protocol requires, as Table 3–4 describes.
This connection information is stored with the schema holder. Progress uses the
parameters that you provide here whenever you connect to the schema holder though the
Data Dictionary or Data Administration tool.
7 ♦ Choose OK. The utility loads the definitions of the P__ files.
The Progress Data Administration tool provides a set of DB2/400 utilities that you can use to
maintain a client schema holder. Chapter 9, “Remote Client DB2/400 Utilities,” describes these
utilities.
3–16
Creating the Progress/400 Environment
1 ♦ Connect to the client schema holder and your Progress/400 server schema.
2 ♦ From the Data Admin main menu, choose DataServer→ DB2/400 Utilities→ Progress/400
Data Dictionary.
5 ♦ Enter the name of the .df file that you want to load and choose OK.
The utility loads the data definitions into the P__ files in the server schema. In addition,
for each table, it creates a physical file on the AS/400. For each index, it creates a logical
file.
The Progress length of the combined fields that make up an index must be less than 200
bytes. The Progress/400 length is some number less than 200, depending on the number
of key fields used.
10 ♦ Enter the name of the data (.d) file that you want to load.
11 ♦ Repeat until you have loaded all the data files you require.
The utility uses the definitions in the client schema holder to load the data from the .d files
into the appropriate data files on the AS/400.
3–17
Progress/400 Product Guide
• From the client using the Progress/400 Data Dictionary. Use this technique only from
Progress clients running in MS-Windows. UNIX clients do not support the Progress/400
Data Dictionary. See Chapter 9, “Remote Client DB2/400 Utilities,” for information on
using the Progress/400 Data Dictionary.
• On the AS/400 using DDS or SQL. Use this technique if your DB2/400 database files
contain data that both Progress and AS/400 high-level languages (HLL) applications
access.
When you make changes with DDS or SQL, do the following to make sure that the changes are
reflected throughout the Progress/400 environment:
1. Run the CHGPRODCT utility to update the Progress/400 environment with those
changes. See Chapter 10, “AS/400 Utilities,” for information on using CHGPRODCT.
2. On the client machine, run the Synchronize Progress/400 Client utility to synchronize the
client schema holder so that it reflects the changes that you made on the AS/400, or
incorporate the as4sync.p procedure into your application. You must do this for each
client.
3–18
Creating the Progress/400 Environment
• Data types
• Locking behavior
• Record creation
3–19
Progress/400 Product Guide
3–20
4
Remote Access to Progress/400 DataServer
This chapter describes how the Progress/400 DataServer works. Topics covered in this chapter
include:
Progress/400 DataServer
Progress translates the
2 request to an AS/400 DB2/400 DBMS
FIND subroutine.
4–2
Remote Access to Progress/400 DataServer
• TCP/IP broker
• Database server
• Progress client
The TCP/IP broker is a job on the AS/400 that has the capability of starting database servers. It
starts one database server per client connection.
Figure 4–2 illustrates how the client and server components interact in a TCP/IP configuration.
Broker
6 notifies 1 Start Broker.
Client. Broker
2 Break connect
8
with Server.
Progress TCP/IP
Client AS/400
Server
3 Broker starts
CONNECT to Server. 7 server.
5 Server
acknowledges
Broker.
DB2/400 DB
4–3
Progress/400 Product Guide
You must be able to ping the host machine before Progress connects. If you cannot ping the host
machine, Progress will not connect.
These notes help to explain Figure 4–2:
1. Start a TCP/IP broker on the AS/400 manually with the STRPRONET command. The broker
must be started by a user with all object authority (*ALLOBJ).
2. The Progress client issues a CONNECT statement to the server. The CONNECT
statement includes information about the network protocol (-N TCP), the host
machine (-H), and the service name (-S). The connection is made to the broker that is
waiting on the port identified by the service name.
3. When the broker receives the connect information, it starts the DataServer.
4. The broker determines the port that the server will use and notifies the server.
5. The server acknowledges that it received the information about the port.
6. The broker notifies the client of the port that the server will use.
7. The client directly connects to the server using the port number provided by the broker.
8. The broker continues to run as a job on the AS/400 until you manually end it with the
ENDPRONET utility.
Because TCP/IP is single threaded, the broker must successfully start one database server job
before it can service another. The broker services client requests one at a time only.
Running TCP/IP
You must start the TCP/IP broker with an OS/400 user containing all object authority. However,
the actual server jobs run with the level of authority of the client. You specify the client’s user
profile with the User ID (-U) and Password (-P) connection parameters. A client that uses a
profile supplied by IBM (QDOC, QDFTOWN, QPMGR, QPRGOWN, QSECOFR, and so
forth) cannot start a server with TCP/IP networking.
Follow these steps to run the TCP/IP broker on the AS/400:
1 ♦ Type STRPRONET on the command line, then press F4 to display the utility’s
parameters.
4–4
Remote Access to Progress/400 DataServer
• Run the OS/400 CL command Work with Active Jobs (WRKACTJOB). This command
displays the status of the TCP/IP broker job.
10:14:26 08/08/95
CPU %: .0 Elapsed Time: 00:00:00 Active jobs: 12
In this example output, the SELW status for the PROTCPBRK job indicates that the
broker is waiting for a client connection request. Note that other states, such as DEQW and
TIMW, are normal as long as the job does not remain in those states for extended periods
of time.
• Client Access/400
• Netsoft
• RUMBA
4–5
Progress/400 Product Guide
Figure 4–3 illustrates how the client and server components interact in an SNA configuration.
Progress AS/400
SNA DataServer 3
Client Server
Client evokes
1 the DataServer
CONNECT to Server
DB2/400 DB
1. The Progress client issues a CONNECT statement to the server. The CONNECT
statement does not include information about the network protocol, host machine, or user.
The SNA routing software provides this connection information.
3. The client evokes the DataServer job with the authority of the client.
You must be able to establish a 5250 emulation session between the PC client and the AS/400
before connecting Progress. If you cannot establish the emulation, Progress will not connect.
4–6
Remote Access to Progress/400 DataServer
The descriptions of these parameters are specific to connections between Progress clients and
the Progress/400 DataServer and the network protocol that your configuration uses.
NOTE: The -ld parameter is not supported. To change the logical database name, see Chapter
9, “Remote Client DB2/400 Utilities.”
This section and the“DATALIB Argument Usage Notes” section describe the parameters and
their usage with the Progress/400 DataServer in detail.
4–7
Progress/400 Product Guide
SYNTAX
-db physical-dbname
DataServer (-Dsrv)
Use this parameter to pass connection information directly to the Progress/400 DataServer:
SYNTAX
The syntax for specifying the arguments and their values has a second form:
SYNTAX
Table 4–2 describes the arguments and values that the -Dsrv parameter accepts. The
“DATALIB Argument Usage Notes” section provides some special usage notes on the
DATALIB argument.
4–8
Remote Access to Progress/400 DataServer
Keyword Description
COMPRESS Specifies that the client and the DataServer use compression when
transferring database records back and forth. Compression also
allows the DataServer to transfer more records to the client in each
message when using pre-fetch. The allowed values are:
0 = off (the default)
1 = on
DATALIB Specifies the library in which the DataServer opens DB2/400 files.
If you specify a library name, you must enter it in capital letters.
To open files using the DataServer’s library list, specify the value
*LIBL instead of a library name. The default is to open files in the
library whose name is stored in the P__FILE server schema file.
See the “DATALIB Argument Usage Notes” section for more
information.
4–9
Progress/400 Product Guide
Keyword Description
LFLVLCHK Enables the CRC method of logical file level checking. In this
method, the CRC is created from the file’s name, record format, key
field names, types, and lengths to ensure that its CRC does not
change if the file is moved or copied.
CRC = on.
The default is off.
CANCELQRY For TCP/IP connections, allows the client to use CTRL-C (on UNIX
machines) or CTRL-BREAK (on Windows machines) to cancel a
query request. By default, control does not return to the client until
the query completes. The allowed values are:
0 = off (the default)
1 = on
This argument is not available for SNA connections.
SYNTAX
You must enter VALUE in capital letters. You can specify either an explicit library name or the
value *LIBL. Do not insert spaces before or after the equal sign (=).
4–10
Remote Access to Progress/400 DataServer
Suppose, for example, that you connect without specifying an explicit library name, and the
library defined in the P__FILE is named TEST. You now execute the following CHGPRODCT
command, which executes for the Dictionary Library named DCTLIB:
This CHGPRODCT command places all valid file definitions from the library TEST into the server
schema of the Dictionary Library DCTLIB. Now suppose that you instead connect as shown in
the program PGM1.P:
PGM1.P
RUN PGM2.P
The DataServer now opens all files during this connection in the library PROD rather than in
the library TEST.
The following example illustrates the use of the DATALIB value *LIBL. Suppose that you
connect as shown in the program PGMA1.P:
PGMA1.P
CREATE QCMD.
ASSIGN CMD = "* CHGLIBL (QTEMP QGPL PROGRESS CUSTLIB TEST PROD)".
VALIDATE QCMD.
RUN PGM2.P
Because you specified *LIBL as the DATALIB value, the DataServer opens files during the
current connection based on the DataServer’s library list. Now suppose that you execute the
following query:
4–11
Progress/400 Product Guide
Assuming that the CUSTOMER file exists in library CUSTLIB, it is opened for this library.
Notice how the library list was set up in PGMA1.P before any files are opened. This is
important: if a file opens before the library list is established, the DataServer might not open the
desired file. By specifying *LIBL as the DATALIB, the DataServer performs file opens based
on library list, just as RPG does.
CAUTION: Do not use the Ignore Stamp (-is) switch when using -Dsrv DATALIB=VALUE.
Progress does not perform file-level checking when the DataServer connects
using the -is switch, and if you specify DATALIB in conjunction with the -is
switch, it might open an incorrect file. For example, in the example program
PGM1.P (shown earlier in this section), suppose that the library TEST contains a
CUSTOMER file for the AP application and the library PROD contains a
CUSTOMER file for the distribution application, and that each of these files has
a different record format. Because Progress does not perform file-level checking,
the DataServer might open a file in a different library than the one you specified
with CHGPRODCT, resulting in data corruption.
Note that the DATALIB argument does not work with virtual tables. If you specify this
argument, logical files that Progress/400 treats as a virtual file cannot be found if they were not
in the Dictionary Library, specified when you created the server schema. In this case, the
following error messages appear:
• In the server job log: “PRO9024-There is a server schema/object mismatch for file.”
SYNTAX
-dt type
4–12
Remote Access to Progress/400 DataServer
For Windows clients using Rumba, use the -H parameter to specify the LU Alias, the PLU, and
the Mode name. If you are connecting to multiple AS/400s, you must supply this parameter for
each AS/400. The default is:
PLU=5250PLU/LU=5250LU/MODE=QPCSUPP
SYNTAX - Windows
-H PLU=plu-name/LU=lu-name/MODE=mode-name
For clients using TCP/IP, the Host Name (-H) parameter specifies either the name of the AS/400
in the host file or that you should use the IP address of the host.
SYNTAX
-is
NOTE: The OS/400 data dictionary time stamp changes whenever you make any change to
the DB2/400 database structure, regardless of whether or not you save the change.
SYNTAX
-N network-type
4–13
Progress/400 Product Guide
Table 4–3 lists the network types that the Progress/400 DataServer supports and the values that
you specify with -N.
SNA as400sna
TCP/IP TCP
User ID (-U)
Use this parameter to specify the user ID. The userid value varies depending on the client type.
This parameter is required for connection by all remote clients. These connections also require
the Password (-P) parameter:
SYNTAX
-U userid
Password (-P)
The Password (-P) parameter specifies the AS/400 password of the user starting the
Progress/400 session. You must capitalize the password, and you must use this parameter with
the User ID (-U) parameter.
The password that you specify is checked against AS/400 user profiles. If it is valid for an
AS/400 user, OS/400 starts the Progress/400 DataServer job on the AS/400. The job runs under
the attributes of the associated user profile. If the password is not valid for the AS/400, or if the
user profile does not have authority to the dictionary library specified in the connect, the
connection fails:
SYNTAX
-P Password
4–14
Remote Access to Progress/400 DataServer
SYNTAX
-Sn server-name.prolibraryname
prosna.prolibraryname Starts a Progress server on the AS/400. It saves a job log only
when the server process ends abnormally with an AS/400
severity level of 20 or higher. The value prosna is the default
for server-name and *LIBL is the default for prolibraryname.
prosnal.prolibraryname Starts the Progress server on the AS/400. This option creates
and saves a job log each time you successfully connect to the
AS/400. *LIBL is the default for prolibraryname.
Note that you can substitute the consna and consnal programs for the prosna and prosnal
programs. However, using prosna and prosnal allows you to customize how the Progress/400
DataServer is started.
• Using the Progress/400 Data Dictionary tool or the Data Administration tool
The following sections provide examples for connecting to DB2/400 databases in the supported
configurations. Regardless of the connection technique that you choose, you must first connect
4–15
Progress/400 Product Guide
to the schema holder, then connect to the DB2/400 database. For example, if you choose to
connect at startup, specify the schema holder and associated connection parameters before you
specify the DB2/400 database and its associated connection parameters.
See the database access chapter of the Progress Programming Handbook for more information
about connecting to a database and for details on choosing a connection technique.
Connecting at Startup
You can connect to both a schema holder and DB2/400 database files when you start a Progress
client session. The following examples illustrate how to connect a Progress server for a schema
holder for multiple users. If you want to connect to a schema holder in single-user mode, use
the Single-user (-1) parameter.
NOTE: If you prefer to prompt the user for a user ID and password, see the “Application
Security” section in Chapter 2, “Common Product Information.”
Windows Clients
This Windows example connects to a Progress server for a schema holder called abc in the TEST
subdirectory and a DB2/400 database called xyz:
You can also include this line in a Windows program item definition to connect to your schema
holder automatically.
UNIX Clients
This example shows a connection to a Progress server for a schema holder called abc and a
DB2/400 database called xyz. The logical connection profile name is profile, the AS/400 user
ID is username, and the password is password:
4–16
Remote Access to Progress/400 DataServer
• Connection modes
4–17
Progress/400 Product Guide
You can change a database’s logical name from a Progress procedure either with the CREATE
ALIAS statement or by using the Edit Connection Information utility in the Data
Administration tool. See Chapter 9, “Remote Client DB2/400 Utilities,” for more information.
Connection Modes
You can make the connection to the schema holder in single-user or multi-user mode. You are
always connected to DB2/400 databases in multi-user mode. Single-user mode does not prevent
others from accessing the DB2/400 database:
• Other Progress users and other AS/400 users might be accessing the DB2/400 database
using a non-Progress language (for example, COBOL or RPG).
• Other Progress users might be accessing the Progress/400 database using a different (but
similar) schema holder.
Server has -Mm parm -200 and client has 1024. They must match. (1150)
Check your connect parameters to make sure that they are not the cause of this message.
4–18
Remote Access to Progress/400 DataServer
During an attempt to connect using The Progress Data Dictionary displays an error
the Progress Data Dictionary message.
During an attempt to connect to a Progress responds with a warning. You can continue.
connected database with the same (Use NO-ERROR to suppress the warning.)
logical name
During an attempt to connect to an Progress responds with a run-time error. You cannot
unconnected database when the connect to the second database.
logical name is in use by a
connected database
NOTE: Use the CONNECTED function to see if you are already connected. For more
information, see the Progress Language Reference.
4–19
Progress/400 Product Guide
There are several reasons that a connection attempt to a Progress/400 database can fail:
• The user is not authorized to access the OS/400 library (the database).
When the server terminates unexpectedly, the Progress client is sometimes left in a
semiconnected state. When the client-server connection is lost unexpectedly, make sure to issue
a DISCONNECT statement before you attempt to reconnect.
NOTE: If the server terminates unexpectedly without producing a job log, do the following
to ensure that the system generates a job log:
• For TCP/IP connections, set the STRPRONET server logging parameter when you
start the TCP/IP broker.
Use the resulting job log to help diagnose the connection problem.
Table 4–6 describes common error messages that you might encounter during connection and
suggests responses.
You cannot use AS/400 1. Verify that the database name is spelled
communications for the dbname correctly.
database.
2. Verify that the schema holder is connected
and describes the specified database.
Partner LU alias or mode name Check the PLU alias name and the mode name.
unknown.
User ID/Password combination not Check the case-sensitive user ID and password
accepted by AS/400. passed by the -U and -P connection parameters.
The name of the server program was Verify that Progress was correctly installed.
not recognized.
4–20
Remote Access to Progress/400 DataServer
The server program appended on the Check the OS/400 job log for information about
AS/400. the server program.1
The -H parameter LU, PLU, and Check the case-sensitive -H connection parameter.
MODE values cannot exceed 8
characters.
Could not establish initial Check the client job log, the OS/400 job log, or the
conversation correctly. operator’s message queue.
Unspecified error during initial send to Check the client schema job log or the OS/400 job
AS/400. log.
Unspecified error during initial receive Check the client schema job log or the OS/400 job
from AS/400. log.
Unspecified allocation error (AS/400 Check the client schema job log or the OS/400 job
side). log.
Unspecified error trying to initialize Verify basic connectivity between the client and
the session. the AS/400.
If you are connecting through SNA, check that you
can establish a 5250 session.
If you are connecting through TCP/IP, use the
ping command to check the connection.
Unspecified parameter error trying to Verify basic connectivity between the client and
allocate the session. the AS/400.
If you are connecting through SNA, check that you
can establish a 5250 session.
If you are connecting through TCP/IP, use the
ping command to check the connection.
4–21
Progress/400 Product Guide
4–22
5
Preparing to Use AS/400-based Clients
This chapter explains how to set up and use the Native 4GL Client and the Progress/400
AppServer. This chapter provides the following information:
• A task list
5.1 Overview
There are two AS/400-based clients that are discussed in this chapter, the Native 4GL Client and
the Progress/400 AppServer. In relation to the Progress/400 DataServer, they are both
considered clients. The phrase native client is used to refer to both clients on the AS/400.
Under directory1 is another directory called directory2 that contains an object. In Progress/400,
this object might be p-code or r-code.
5–2
Preparing to Use AS/400-based Clients
Your home directory resides under the top level of the ROOT file system. In the ROOT file
system, your home directory would be /home. You can use directories underneath the home
directory as one place to store stream files.
In this case, the ROOT file system searches from the following top level:
/directory1/directory2/object
However, if you do not specify the first slash (/), you have a relative path. When you use a
relative path, Progress/400 starts with your current working directory. For example, suppose
that your path looks like the following:
directory1/directory2/object
In this case, the ROOT file system searches from the following:
current-working-directory/directory1/directory2/object
QSYS.LIB Path
IFS Path Resolution
Resolution
*LIBL/REPORT(REPORT) /QSYS.LIB/*LIBL.LIB/REPORT.FILE/REPORT.MBR
*CURLIB/MKTG(REPORT) /QSYS.LIB/*CURLIB.LIB/MKTG.FILE/REPORT.MBR
DEMO/MKTG(REPORT) /QSYS.LIB/DEMO.LIB/MKTG.FILE/REPORT.MBR
Progress/400 native clients search for p-code and r-code in the ROOT file system within IFS
similarly to the Progress 4GL. However, if you store the p-code and r-code in the QSYS.LIB
directory structure, you must fully qualify where the p-code or r-code resides when you use this
5–3
Progress/400 Product Guide
directory structure in your Progress code. If you do not fully qualify the path, the native clients
perform no search of any kind.
For example, if the abc procedure is in the ROOT file system (IFS), the native clients look for
abc.r and then abc.p. However, if the procedure is in the QSYS.LIB file system, your RUN
statement must be fully qualified; for example:
RUN /QSYS.LIB/*LIBL.LIB/P.FILE/ABC.MBR
RUN /QSYS.LIB/*LIBL.LIB/R.FILE/ABC.MBR
For more information on how Progress/400 uses paths, see the “Executing Progress Code from
the Native Clients” section in this chapter.
1 ♦ Create a dictionary library containing the schema image on the AS/400. You create the
dictionary library and the schema image with the DUPPRODB utility if you do not have
an existing server schema, or with CRTSCHIMG if you have a server schema.
2 ♦ Prepare your Progress 4GL code for the AS/400. This might involve removing user
interface statements and redirecting input and output.
3 ♦ Transfer your p-code to the AS/400 from a remote client, or locate local AS/400 p-code or
r-code. If you are transferring p-code from a remote client to the AS/400, use the Progress
4GL to check the syntax before you execute the transfer.
4 ♦ Compile your p-code using the Native 4GL Compiler on the AS/400. Any compilation
errors show up in your job log. You can fix these compilation errors on the remote client
where you can use the Procedure Editor.
5–4
Preparing to Use AS/400-based Clients
Table 5–2 details the Create Schema Image (CRTSCHIMG) parameter for the DUPPRODB
utility. For a complete list of the DUPPRODB parameters, see Chapter 10, “AS/400 Utilities.”
Create Schema Image CRTSCHIMG Creates a schema image for the native
clients. CRTSCHIMG populates the
server schema with P__SCHEMA*
and automatically synchronizes. The
default value for this parameter is
*NO.
CRTSCHIMG DCTLIB(library-name)
5–5
Progress/400 Product Guide
Using Aliases
When using DEFINE ALIAS so that r-code can be run against multiple databases, you must
define two aliases, as follows:
5–6
Preparing to Use AS/400-based Clients
Table 5–3 gives examples of the syntax for INPUT FROM in the QSYS.LIB file system or the
ROOT file system under IFS.
5–7
Progress/400 Product Guide
Table 5–4 gives examples of the syntax for OUTPUT TO in the QSYS.LIB and ROOT file
system under the IFS.
OUTPUT TO Rules
The following list describes the behavior of the OUTPUT TO command:
• Library explicitly stated — With the OUTPUT TO statement, where a library, file, or
member is explicitly stated but does not exist, Progress/400 creates a library and file as a
source physical file with a record length of 144, and a member within the source file.
• End of record — The OUTPUT TO statement uses stream input and output to write data
for both ROOT and QSYS.LIB file systems. Since stream files do not use end-of-record,
QSYS.LIB files are not truncated at the end of a record. Instead, the output wraps into the
next record.
• Stream file format — If you specify a physical file member in the QSYS.LIB library file
system as the destination of an OUTPUT TO statement, the formatting can be confusing.
Data written to this file is output in stream file format. You must convert your data to a
record format if you want to view it with the QSYS.LIB file system.
5–8
Preparing to Use AS/400-based Clients
• Record file format —To convert stream data to the record-oriented format of the
QSYS.LIB file system, follow these steps:
a) Execute the CPYFRMSTMF command. The file you specified on the OUTPUT TO
statement in your 4GL maps to the FROMSTMF parameter of the command.
b) Select your desired record file member name in the TOMBR parameter. You must
also select the *LF value for the ENDLINFMT parameter {ENDLINFMT(*LF)}.
NOTE: Using command defaults for the ENDLINFMT parameter can result in extra
carriage returns and line feeds that fragment the data. This is the default behavior
in IFS when the FROMSTMF parameter specifies a file from the QSYS.LIB file
structure. The ENDLINFMT selection is not necessary when FROMSTMF
parameter is from the IFS file structure instead.
Output to Printer
When you direct output to a printer, OS/400 writes the output to a spooled file and places it in
an output queue. The characteristics of the spooled file are controlled by the AS/400 printer file.
The AS/400 printer file determines such things as the page size and the number of lines per page
for printed output. Progress/400 supports a printer file called PROPRTF, which resides in the
Progress/400 executables library. The PROPRTF printer file uses most of the OS/400 command
defaults for print files including the default page size, font, page rotation, and number of copies.
It also uses the default printer device and output queue associated with the job that executes the
Progress procedure. The PROPRTF printer file differs from the AS/400 printer file defaults for
the following attributes:
You can override the default characteristics of the PROPRTF print file, or direct the output to a
different printer by using the OVRPRTF command. If you do override the printer default, you
must make sure the PRTF attributes are set for the new printer.
Additionally, you can direct output to a specific printer file by providing the printer name as an
argument to the OUTPUT TO statement. Any printer file you specify must contain the attributes
assigned in the PRTF printer file.
Note that if you output to a printer using PUT UNFORMATTED, unpredictable results can
occur. The Progress 4GL does not have any knowledge of the AS/400 print control. The 4GL
programmer must manage print control.
5–9
Progress/400 Product Guide
Another option for specifying your own printer file is using the -o parameter. The Progress
statement OUTPUT TO PRINTER automatically uses the correct attributes for you when you
use the Printer (-o) parameter.
NOTE: Blank lines from your print file are not visible when viewed from an output queue.
Printed output contains the proper spacing.
• Remove all references to terminal input or output. Use the INPUT FROM and
OUTPUT TO statements.
• Select a method to transfer code to the AS/400. Options for transfer might be using FTP,
Client Access, or Rumba. If you do not have any of these applications, Progress provides
a sample procedure that might help. Refer to your Progress/400 Release Notes for more
information.
• Transfer the code. Once transferred, the code resides in the IFS file system.
Command Description
5–10
Preparing to Use AS/400-based Clients
1 ♦ Develop your code on your remote client. Make sure to remove user-interface syntax.
2 ♦ Perform a syntax check on the remote client to make sure the p-code is valid.
/home/mydir,/dlc
Note that the single comma acts as a path delimiter and does not itself represent the working
directory. To insert the working directory into the middle of the PROPATH, specify the
following for PROPATH:
/home/mydir,
/home/mydir,,/dlc
In this case, the second comma indicates to Progress where to insert the working directory.
5–11
Progress/400 Product Guide
When compiling p-code, Progress/400 lists any compilation errors in the job log with the word
“note” and an error number.
Follow these steps to compile code on the AS/400:
2 ♦ Check the job log on the AS/400 for any errors beginning with the word “note.”
3 ♦ Fix any Progress code errors on the remote client, check syntax, and repeat the code
transfer.
See Chapter 6, “Using the Progress/400 Native 4GL Client,” or Chapter 7, “Using the
Progress/400 AppServer,” for specific client details.
Default for
Parameter Windows/UNIX Default for AS/400
5–12
Preparing to Use AS/400-based Clients
Default for
Parameter Windows/UNIX Default for AS/400
The main -cp* parameters are -cpinternal and -cpstream. Some guidelines on these and the
other parameters follow:
• Do not change the value of -cpinternal. Progress/400 is built on an AS/400 using code
page IBM037, and the product uses this internal code page value.
• The -cpstream parameter tells Progress the code page of the source code (.p) and the
output (to printer or file). Because both the source code and the output involve operating
system objects, it is expected that -cpstream matches the operating system code page used
by the AS/400. If your program uses a different code page, you must specify it when you
start up the native clients. See Chapter 6, “Using the Progress/400 Native 4GL Client,” for
the syntax to start up the Native 4GL Client. See Chapter 7, “Using the Progress/400
AppServer,” for instructions on how to start up the AppServer.
If you do not specify -cpstream and the source program contains characters that are not
in the IBM037 code page, the compiler might not understand the source code, or some
characters might be converted incorrectly in the output.
• As noted, the -cplog, -cpprint, and -cpterm parameters obtain their values from the
main -cp* parameters.
Observe that the native clients use IBM037 as the default code page value for the -cpinternal
and -cpstream parameters rather than the Progress default code page values of ISO8859-1 and
IBM850, respectively.
5–13
Progress/400 Product Guide
If you store procedures in the IFS in ASCII format (IBM850) directly from a Windows machine
to a mapped drive, you must set -cpstream parameter appropriately. In this case, you must set
it to either IBM850 or ISO8859-1. For example, the following command writes files into the
IFS that can then be read by an ASCII client:
For more information about the -cpstream and -cpprint parameters, see the Progress Startup
Command and Parameter Reference.
5–14
6
Using the Progress/400 Native 4GL Client
This chapter documents Progress/400 product information that is specific to the Native 4GL
Client. Topics covered in this chapter include:
• Executing triggers
6.1 Overview
The Native 4GL Client allows you to run Progress applications on the AS/400. Like other
Progress/400 utilities on the AS/400, it has a standard OS/400 command interface. You execute
the Native 4GL Client as you would any OS/400 command. What makes the Native 4GL Client
different from other Progress clients is that it has no interactive capabilities. With this client,
applications creating reports or doing large updates to the DB2/400 database can run locally on
the AS/400, thus taking advantage of the AS/400 server performance and reducing the load on
network resources.
1 ♦ Install Progress/400 on the AS/400 and install Progress on the client machine.
4 ♦ Invoke the Native 4GL client to execute your Progress 4GL code (p-code or r-code) using
the STRPROCLI utility.
To start the Native 4GL Client, execute the STRPROCLI utility and provide the procedure name
you want to execute. Progress requires the following minimum syntax:
STRPROCLI STPROC(Progress-procedure-name)
For more detailed information on the STRPROCLI utility, see Chapter 10, “AS/400 Utilities.”
DO TRANSACTION:
CREATE QCMD:
ASSIGN QCMD.cmd = "STRPROCLI SCHDB(DB-NAME) STRPROC(CODE)".
VALIDATE QCMD.
END.
6–2
Using the Progress/400 Native 4GL Client
• Use QCMD to activate a Native 4GL Client by running the STRPROCLI utility. You can
also call a CL program that runs this utility. For a description of this utility, see the “Start
Native 4GL Client (STRPROCLI)” section in Chapter 10, “AS/400 Utilities.”
– Data queues. See the “Data Queue Support” section in Chapter 11, “Progress 4GL
Interfaces to OS/400 Languages and Objects,” for more details.
– Data areas. See the “Data Area Support” section in Chapter 11, “Progress 4GL
Interfaces to OS/400 Languages and Objects,” for more details.
– PROCALL and the EPI interface. See the “External Programming Interface (EPI)”
section in Chapter 11, “Progress 4GL Interfaces to OS/400 Languages and Objects,”
for more details.
6–3
Progress/400 Product Guide
then the PROPATH value on the STRPROCLI command line should be ’/home/mydir,’
resulting in a PROPATH of ’/home/mydir,,/(install-directory)/’. In this case, the
second comma indicates the working directory.
• The EPI ENTRY and EPI EXIT commands allow parameters to be input to the 4GL
program and output to the HLL caller.
For more information on EPI, see Chapter 11, “Progress 4GL Interfaces to OS/400
Languages and Objects.”
PGM
DCL VAR(&DOTP) TYPE(*CHAR) LEN(128)
DCL VAR(&PARM1) TYPE(*CHAR) LEN(50)
DCL VAR(&PARM2) TYPE(*DEC) LEN(15 5)
CHGVAR VAR(&DOTP) VALUE(‘/anydir/sample.p’)
CHGVAR VAR(&PARM1) VALUE(’OLD VALUE’)
CHGVAR VAR(&PARM2) VALUE(12.345678)
CALL PGM(PROCALL) PARM(&DOTP &PARM1 &PARM2)
ENDPGM
6–4
Using the Progress/400 Native 4GL Client
I ’/anydir/sample.p’ C DOTP
C*
C CALL ’PROCALL’
C PARM DOTP PROC 128
C PARM ’HELLO’ PARM1 50
C PARM 16.654 PARM2 150
C*
PROCALL Parameters
PROCALL can accept up to 32 parameters. The first parameter must be the name of the
Progress 4GL program name that you want to call. You must pass a name that conforms to IFS
naming conventions. If the stream file does not exist, Progress/400 displays an error and the call
to PROCALL does not complete normally. PROCALL is designed primarily for RPG and CL,
hence the first parameter must be defined as a 128-byte character field and must be space
padded on the right. It cannot be NULL terminated.
Progress/400 considers any other parameters passed to the PROCALL program to be
parameters to the 4GL program. These parameters must also be passed using the RPG or CL
standards. The following rules apply:
• All parameters passed to a 4GL program must be declared in the calling program exactly
as they are declared in the called Progress 4GL program. You use the EPI ENTRY
command to declare the parameters input to the 4GL program. See the “EPI ENTRY
Command” section for details.
6–5
Progress/400 Product Guide
• Character strings passed to the 4GL program must be declared as a fixed length; they
cannot be NULL terminated. In the previous examples, &PARM1 is defined as a 50-byte
character string in the RPG and CL programs, and it is declared as a 50-byte character
string in the EPI ENTRY command in the Progress program.
• Just as in a CL or RPG program, a Progress 4GL program can accept numeric parameters.
The numeric types supported are packed, zoned, and integer.
• A USE of INPUT indicates that the parameter is input to the 4GL program.
• A USE of OUTPUT indicates that the parameter is output from the 4GL program to the
caller.
• A USE of INPUT-OUTPUT indicates that the parameter is either input to or output from
the 4GL program as needed.
6–6
7
Using the Progress/400 AppServer
This chapter documents how to use the Progress/400 AppServer product on the AS/400. For
complete documentation on AppServer concepts, configurations, and programming
considerations, see the Progress Installation and Configuration Guide Version 9 for UNIX and
Building Distributed Applications Using the Progress AppServer before reading this chapter.
This chapter covers the following Progress/400 topics:
• Overview
• Task List
7.1 Overview
The Progress/400 AppServer product is comprised of three components: the Progress/400
AdminServer, the Progress/400 NameServer, and the Progress/400 AppServer instance. The
Progress/400 AdminServer manages the Progress/400 NameServer, the Progress/400
AppServer instances, and licensing. The Progress/400 NameServer mediates client connections
for a Progress/400 AppServer instance. Each Progress/400 AppServer instance runs the 4GL on
the AS/400 for a remote AppServer client. A Progress/400 AppServer instance cannot talk to
any other AppServer instance. The following sections explain the framework for these three
components on the AS/400.
Progress Software Corporation recommends using the Progress Explorer tool to manage the
Progress/400 AppServer product.
7–2
Using the Progress/400 AppServer
Figure 7–1 diagrams the Progress/400 AdminServer with its required jobs.
AdminServer
ADMINSERV
QJVACMDSRV
AS/400 JOBS
7–3
Progress/400 Product Guide
Figure 7–2 diagrams the Application Broker and a single Application Server with their required
jobs.
BrokerName QZSHSH
QJVACMDSRV QP0ZSPWT
7–4
Using the Progress/400 AppServer
Figure 7–3 diagrams the Progress/400 NameServer with its required jobs.
NameServer
NameServer
Name
QP0ZSPWT
AS/400 JOBS
4 ♦ Start the AdminServer using the Progress/400 command STRADMSVR. Any Auto-start
servers (Name or AppServer) will also start at this time.
Use the WRKACTJOB command to make sure the ADMINSERV starts under the user
you specified. Look at other jobs in the subsystem and wait for their status to stabilize.
New jobs will appear and disappear for a few minutes.
7–5
Progress/400 Product Guide
Follow these steps on an NT client machine once you have started the AdminServer on the
AS/400:
1 ♦ Ensure that you have the Progress Explorer installed and running on your NT machine.
2 ♦ Choose start→ Programs→ Progress→ Progress Explorer from your Windows Taskbar.
The Progress Explorer main window appears. When you expand the tree view under
Progress MMC Explorer, you see a list of machines where you can start a Progress server.
In this example, only the local host machine is listed:
c) Enter the server name (the name of a remote machine), your user name, and your
password in the Server Properties dialog box.
d) Select Save username and password if you want to automatically log into this
machine every time you connect to it.
e) Select the Advanced tab and make sure that the Server Port Number matches the
Default AdminServer Port Number specified during the Installation or when using
the CHGPRODFT command.
f) Select Reconnect at startup only if you want to automatically connect to this machine
every time you start Progress Explorer.
g) Choose OK.
7–6
Using the Progress/400 AppServer
You will see a login dialog box, unless you configured the Progress Explorer tool to
automatically log in to a particular machine.
5 ♦ Expand the tree view of the connected server machine. The expanded tree view will look
similar to the following:
You can now manage the Progress/400 AppServer as you would any other AppServer. You can
end all AppServers and Name Servers from your client using the Progress Explorer tool or using
the respective command-line utilities ASBMAN and NSMAN.
You can shut down an AdminServer process at any time from the AS/400. If you do shut down
an AdminServer process, all other jobs managed by this AdminServer end as well. To shut down
the AdminServer, use the Progress/400 ENDADMSVR command with the appropriate user
profile and password.
7–7
Progress/400 Product Guide
STRADMSVR
• EDTF (Edit File) — Edit the file on the AS/400 using the command EDTF. The EDTF
command ships with the OS/400 Version V4R4. Progress/400 also provides this command
for use on earlier versions of the OS/400.
NOTE: If you use EDTF to edit your file, you must also verify your changes with the
configuration validation utilities on either NT or UNIX. If your AdminServer is
running and you choose the Progress Explorer to verify your changes, you no
longer can use EDTF, as the Progress Explorer makes changes to the end-of-line
(EOL) characters.
• Progress Explorer tool — If your AdminServer is running, you can edit the file on the
AS/400 from an NT interface using the Progress Explorer. The Progress Explorer also
verifies any changes you make to the Progress/400 ubroker.properties file. If you
choose this method, you can no longer use EDTF, as the Progress Explorer changes EOL
characters. This is the recommended editing method.
7–8
Using the Progress/400 AppServer
• UNIX editor — Edit the file on UNIX, verify your changes with the UNIX configuration
validation utilities, and then move the file back to the AS/400. You can use this method if
the AdminServer is not running.
• Windows editor — Edit the file on NT with Client Access. This requires that you map a
drive to the root directory on the AS/400. Verify your changes with the NT configuration
validation utilities, and then move the file back to the AS/400. You can use this method if
the AdminServer is not running.
7–9
Progress/400 Product Guide
*ADMSVR
If you select *ADMSVR in the AppServer Instance Environment field, each Progress/400
AppServer instance will start its jobs in the Progress/400 AdminServer subsystem. For
example, if you specify APPSVR in the Administration Jobs Subsystem Name field, then when
an Application broker starts, its jobs (for example, ASBROKER1 and QJVACMDSRV) will
start in the APPSVR subsystem. Any Progress/400 Application Server jobs started by this
Application Broker will also start in the APPSVR subsystem.
*BROKER
If you select *BROKER in the AppServer Instance Environment field, each Progress/400
AppServer instance will start its jobs in its own subsystem with the same name as the
Application Broker. For example, if the Application Broker, ASBROKER1, starts and the
install subsystem is *BROKER, Progress/400 creates a subsystem with the name
ASBROKER1, and the broker jobs ASBROKER1 and QJVACMDSRV start within this
subsystem. Any Application Server jobs for ASBROKER1 will also start in this same
subsystem. Any additional Application Brokers started will have their own subsystem and their
jobs will run within the subsystem created with their name. If Progress/400 finds an existing
subsystem of the same name as the broker, it will use this existing subsystem. Otherwise,
Progress/400 creates a new subsystem using the broker name as the subsystem.
*USER
If you select *USER in the AppServer Instance Environment field, each AppServer instance
will start its jobs in an existing subsystem specified by the job queue and job description
parameters.
7–10
Using the Progress/400 AppServer
7–11
Progress/400 Product Guide
7–12
8
System Administration
• Database security
• Transaction control
• DataServer performance
• Progress/400 attributes
• Reserved Words
Progress/400 Product Guide
2 ♦ Type 4 next to each user space in the object list that is displayed.
For a complete description of WRKPROJOB, see the “Work with Progress Jobs
(WRKPROJOB)” section in Chapter 10, “AS/400 Utilities.”
8.2 Security
The following sections discuss Progress/400 Database and AppServer security on the AS/400.
8–2
System Administration
• The -U and -P parameters correspond to an OS/400 user profile and password, not a
Progress user ID and password.
• For host-based (5250 nonprogrammable workstation) users, Progress uses the user profile
assigned to the active 5250 session.
After the client passes user-profile information and attempts to connect, the following occurs:
1. The AS/400 verifies that the Progress user’s OS/400 user profile is valid.
If the user profile is not valid, the client cannot connect and receives an error message
stating that the server rejected the login attempt.
2. If the user profile is valid and has appropriate program-object authorities to the evoke
program for the Progress/400 DataServer programs as specified in the program start
request, the AS/400 verifies the user’s object authority for the database object being
accessed:
• If the database-object authority is valid for the operation that the client wants to
perform, the database server performs the operation.
• If the authority is invalid, the client is denied permission to perform the attempted
operation and Progress generates an error message.
In addition to the OS/400 security, you might also want to consider the following techniques to
ensure security:
• Application security
For more information, see the “Application Security” section in Chapter 2, “Common Product
Information.”
8–3
Progress/400 Product Guide
8–4
System Administration
If the file is opened with commitment control on, the DataServer ends commitment control
when the Progress session ends. Opening files with commitment control on assures that
standard Progress transaction scoping rules apply. (See the “Transactions” section in Chapter 2,
“Common Product Information,” for information about how the standard Progress RDBMS and
OS/400 might view some transactions differently.)
When you use Progress to write to DB2/400 database files that are not journaled, the DataServer
writes a message to the OS/400 job log when it opens the nonjournaled file. This is the default
behavior for the DataServer, which you can control with the DataServer (-Dsrv TRANSCTL)
startup parameter as discussed in the next section.
SYNTAX
-Dsrv TRANSCTL=value
In remote client-based transaction control, the remote client uses a Progress local before-image
file (LBI). Table 8–1 describes how to use -Dsrv TRANSCTL to implement transaction control.
Keyword Description
COMMIT Specifies that commitment control extends to all of the files in the
Progress/400 database. A journal receiver must exist for the file to
enable transaction management. If you are not journaling a DB2/400
file, the application does not open the file and returns an error.
LBI Specifies that the remote clients use a local before-image file to manage
main transactions and nested subtransactions. If you use local
before-imaging, you cannot use OS/400 journaling; the two are not
interchangeable. LBI works for single-user mode only.
8–5
Progress/400 Product Guide
Keyword Description
For example, the following CONNECT statement makes sure that a DataServer application
does not open any file for which commitment control is not active:
8.3.3 Recovery
The same mechanisms that support transaction control assist in recovering a database after a
system or medium failure. The Progress database handles crash recovery by using the
before-image (BI) file, and additionally, if you specify it, by using the after-image (AI) file.
DB2/400 recovery relies on the journaling mechanism to support commitment control.
Journaling is not automatic. You must manually start, maintain, and stop it. When journaling is
started, DB2/400 writes database I/O and changes, or journal entries, to a DB2/400 object called
a journal receiver (*JRNRCV). Journal entries are records that DB2/400 writes when database
access occurs. Journal entries can be before images or after images. When you start journaling,
roll-forward recovery (after images) is the OS/400 default. You can provide crash recovery to
a database only when each of the database’s physical files is journaled.
8.3.4 Journaling
Journaling, the logging of database I/O and changes into a journal receiver to provide crash
recovery, is an AS/400 concept. Before you start journaling, you create a journal receiver
(*JRNRCV), then a journal (*JRN). You then start journaling explicitly with the OS/400
STRJRNPF CL command for each physical database file that you want to recover. Once you
start journaling for a physical file, the system writes journal entries until you explicitly end
journaling with the OS/400 ENDJRNPF CL command.
8–6
System Administration
Command Description
The following sections explain how to implement AS/400 journaling. For a basic description of
AS/400 journaling, see your OS/400 documentation.
SYNTAX
CRTJRNRCV JRNRCV(library/journal-receiver-name)
SYNTAX
8–7
Progress/400 Product Guide
3 ♦ Now that the journal and journal receiver objects exist, you can start journaling each
physical file in your database. This is the STRJRNPF syntax:
SYNTAX
SYNTAX
You might want to set up a regular backup schedule for your journals. As journal receivers fill
up, you might want to back them up to tape or other media, then delete them from the system.
See the AS/400 Backup and Recovery Guide for more information about creating a system
maintenance and backup schedule for journal receivers.
• The AS/400 encodes characters using EBCDIC, while most other Progress environments
use ASCII character encoding.
The Progress/400 product provides special code page and data translation support that allows
you to make database record sorting on a Progress/400 database operate in the same way as on
a Progress database.
8–8
System Administration
If you have experienced sorting problems when running your application, this section provides
information that is important to you:
• A FOR EACH or OPEN QUERY statement retrieves records in a different order when
executed on the AS/400 server than on the Windows or UNIX client.
NOTE: The discussion in this section assumes that your client is running on Windows;
however, the information generally is the same for a client running on UNIX.
• A code page contains the numeric codes assigned to the various characters when they are
stored in databases.
• Collation specifies the order in which characters are sorted for indexes, queries, and so
forth; that is, the collation sequence. A collation table contains this sort-order information.
In the AS/400 environment, collation tables are called alternate collating sequence tables,
represented by the ALTSEQ keyword in the DDS specification for database files.
If you have written Progress code based on the ASCII collation sequence, you might need to
modify it when you move it to the AS/400. For example, in EBCDIC collation, letters are sorted
before numbers, while in ASCII, numbers are sorted before letters. Also, the encoding of the
letters is not consecutive in EBCDIC, as it is in ASCII. A common technique when using ASCII
collation is to code a range from ’a’ to ’z’ in order to include all letters. This technique might
not function as expected with EBCDIC, because EBCDIC includes additional records in the
specified range. The remote client can do EBCDIC collation by using the convmap file. The
EBCDIC collation table must be added to the convmap.cp file. For information, see the
Progress Internationalization Guide.
Progress/400 resolves these differences by converting automatically between code pages. To
enable code-page conversion, do the following:
8–9
Progress/400 Product Guide
This ensures that all characters look the same everywhere-database, screen, printer-and that all
characters are sorted in the correct order. You must do this task before any data is entered into
the database. If you make changes after data is entered, the data might become corrupted, and
correcting the resulting problem could be very labor intensive.
AS/400 Windows
(IBM284) (ISO8859-1)
• AS/400 operating-system code page — This code page is defined when the operating
system is installed on the server machine. To determine which code page the AS/400 is
using, execute the following command:
DSPSYSVAL QCHRID.
8–10
System Administration
• Progress/400 native clients’ internal code page — Progress/400 uses IBM037 as its
internal code page. Do not change this code page; Progress/400 was built on an AS/400
using this code page and requires it.
• Progress/400 database code page (PF and LF files) — This code page is defined when
the *PROEMPTY database (server schema) is created on the AS/400 with the
DUPPRODB utility. By default it uses *SYSVAL, which specifies the code page used by
the AS/400. To determine which code page a Progress/400 database is using, execute the
following commands from the Procedure Editor with the schema holder and AS/400
database connected:
• AS/400 stream file code page — When the Progress/400 native clients create a stream
file, the data that it contains is written to the stream file in the code page specified by the
-cpstream startup parameter.
For more information on AS/400 stream files, see IBM’s Integrated File System
Introduction.
• Windows operating-system code page — This is the default Windows code page
(normally 1252, which is very similar to ISO8859-1). Note that the default code page for
an MS-DOS session is IBM850, so you get different results when you edit a file depending
on whether you use the MS-DOS EDIT command or the Windows Notepad editor. This is
important only if you are importing or exporting data from or to flat operating system files
(for example, dumping data contents):
– If you want Windows format, use the startup parameter -cpstream ISO8859-1.
• Progress client internal code page — This is the code page used internally by Progress
clients on Windows; the default is ISO8859-1. You can change this using the -cpinternal
startup parameter. To determine which code page a Progress session is using, execute the
following command from the Procedure editor:
DISPLAY session:cpinternal.
8–11
Progress/400 Product Guide
• Schema holder code page — Since a schema holder is created from an empty database,
this code page is the same as for the standard Progress empty database (ISO8859-1). To
determine which code page a schema holder is using, execute the following commands
from the Procedure Editor with the schema holder connected:
• Windows stream file code page — For information, see the Progress
Internationalization Guide.
Given the number of code pages required, data can be converted between code pages as many
as four times before it arrives at its destination. In the Figure 8–1 example, the following
conversions occur:
• For remote Progress clients, you define collation in the -cpcoll startup parameter, which
points to the appropriate table in the CONVMAP.DAT file. For details, see the description
of the -cpcoll parameter in the Progress Startup Command and Parameter Reference.
• On the AS/400, you define collation by specifying the ALTSEQ keyword when creating
the physical file from the DDS file.
8–12
System Administration
When you create the *PROEMPTY server schema with the DUPPRODB command, specify the
ALTSEQ tables so that Progress/400 knows which tables to use when creating the AS/400
database files through the Progress/400 Data Dictionary.
NOTE: Using the wrong ALTSEQ table results in incorrect data sorting.
• When working with existing database files that are to be included in the Progress/400
server schema
1 ♦ Create a new file using the same record format and the desired ALTSEQ table.
2 ♦ Use the CPYF command to copy the records from the old file to the new file. The
command handles the collation conversion. For details on the CPYF command, see your
IBM documentation.
4 ♦ Rename the new file with the name of the old file.
8–13
Progress/400 Product Guide
Note that if you cannot convert all of the physical files, you can convert just the logical files.
This avoids the need to copy all of the records, but it leaves the physical files with the original
definition relative to the ALTSEQ table. To resolve this problem, simply use the CHGPRODCT
utility to notify Progress/400 about the logical files.
Follow these steps to convert a logical file:
2 ♦ Re-create the logical file, changing the definition to the appropriate ALTSEQ table.
8–14
System Administration
The example in Figure 8–2 illustrates using the DUPPRODB utility on an AS/400 machine
whose system code page is IBM037.
8–15
Progress/400 Product Guide
Table 8–3 provides a list of commonly used code pages that correspond to IBM ALTSEQ
tables.
Uppercase
Country or Case-sensitive Case-insensitive
ALTSEQ
Code Page Alphabet ALTSEQ Table ALTSEQ Table
Table
8–16
System Administration
Uppercase
Country or Case-sensitive Case-insensitive
ALTSEQ
Code Page Alphabet ALTSEQ Table ALTSEQ Table
Table
Note that Table 8–3 does not include a list of lowercase tables. IBM does not provide lowercase
tables, so you must build them yourself. You use lowercase tables only when the DataServer
must evaluate the Progress 4GL function LC within a query. For information on building these
tables, see the “Creating the Tables” section.
For more information about collation on the AS/400, or for a complete list of IBM ALTSEQ
tables, see the IBM AS/400 National Language Support Planning Guide.
Collation sequences determine the order in which an application sorts data. A user-defined
collation table lets you define and control how character data is collated (sorted). Because
Progress/400 products use the native DB2/400 database, they are restricted to the collation
capabilities provided by OS/400. The advantage of creating your own collation table is that you
can define the collation sequence based on the national and cultural requirements specific to
your application deployment environment. You can then use your custom collation table to
control sorting, which allows you to collate character fields, whether indexed or not, in a
user-defined order.
8–17
Progress/400 Product Guide
To take advantage of user-defined collation, you create a table and populate it with the
hexadecimal value for each character, assigning the values in the order in which you want
character data to sort. You can also sort with tables provided by the OS/400, located in the
QUSRSYS library. A second table, called the uppercase table, controls lowercase-to-uppercase
character conversion. You use a table to look up a character and its corresponding numeric
value.
ALTSEQ must be a DB2/400 table whose source is a source member that contains eight
records, each of which contains 64 hexadecimal digits. (The 8 x 64 format is required by
DB2/400.) The 64 digits represent 32 values, from 0-225 (xFF). The total of 8 records
provide collation values for all 256 EBCDIC characters. Characters are sorted in the order
of their collation values.
ALTSEQCI is a DB2/400 table whose source is a source member that contains eight
records, each of which contains 64 hexadecimal digits. (The 8 x 64 format is required by
DB2/400.) The 64 digits represent 32 uppercase characters that correspond to the 32
characters represented by that record. This table ensures Progress-like behavior for
case-insensitive indexes.
UPCASE is a DB2/400 table. The source for the table must be a source member that
contains eight records, each of which contains 64 hexadecimal digits. (The 8 x 64 format
is required by DB2/400.) The 64 digits represent 32 uppercase characters that correspond
to the 32 characters represented by that record.
8–18
System Administration
LOCASE is a DB2/400 table. The source for the table must be a source member that
contains eight records, each of which contains 64 hexadecimal digits. (The 8 x 64 format
is required by DB2/400.) The 64 digits represent 32 lowercase characters that correspond
to the 32 characters represented by that record.
To use an alternate collation sequence, you must first build the collation-sequence and
uppercase/lowercase tables.
When you install the Progress/400 DataServer, Progress allows you to select a case-insensitive
table as the default. When you create a dictionary library, the DUPPRODB utility allows you to
override this default table. Each time you connect to your DB2/400 database, Progress looks for
the collating and uppercase tables you specified when you created the Progress/400 Dictionary
and server schema with the DUPPRODB utility. If the tables exist, Progress reads and writes
data based on that information. If they do not exist, Progress uses the default collation sequence.
Creating the Tables. You use the OS/400 Create Table (CRTTBL) command. This is its
syntax:
SYNTAX
The CRTTBL command expects the source member (SRCMBR) to contain eight records of 64
hexadecimal characters each. An example of a collation table is shown in Figure 8–3.
000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F
20212223242526... ...3E3F
C16362C2...
60...
80...
A0...
C0...
E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
8–19
Progress/400 Product Guide
Figure 8–4 illustrates two points. Each point is highlighted by a number to the left; the notes that
follow Figure 8–4 describe their collation functions.
000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F
1 20212223242526... ...3E3F
2 C16362C2...
60...
80...
A0...
C0...
E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF
1. The first two lines of EBCDIC collation tables provide the collation sequence for the
unprintable characters (the characters between 00 and hex3F).
2. This line illustrates how to use the hexadecimal values from code page IBM500 to sort the
following characters in the order shown: A Ä, Â, B.
You create an uppercase table in the same way you create a collation table, except that in the
places that contain lowercase characters, you substitute the hexadecimal value of the equivalent
uppercase. For example, in the table shown in Figure 8–4, instead of x81 you place an xC1 so
that the fifth line starts with 80C1C2.
• If you do not specify a specific collation sequence, the default is the standard collation
sequence for your AS/400.
• When you create an alternate collation sequence, the OS/400 *TBL object requires that
you define a collation sequence for all 256 characters in a code page regardless of whether
you use them all.
• If your user-defined collation table is not set up correctly, you might receive unpredictable
results.
8–20
System Administration
DataServer Considerations
This section explains two important issues for defining alternate collation sequences for use
with the Progress/400 DataServer:
• You can build queries that take advantage of the strengths of client/server or n-tier
processing.
• You can consider optimizing how database results are transmitted through network
connections
The following sections provide some guidelines for making both types of adjustments.
8–21
Progress/400 Product Guide
To take advantage of the server’s query processing, use FOR EACH statements combined with
GET NEXT instead of FIND and REPEAT combinations when programming in the Progress
4GL.
If selection by server is not optimal for your configuration, you can use the DataServer (-Dsrv
SBS=0) startup parameter to prevent it and allow the client to evaluate database results.
You can set the -Mm parameter to take full advantage of the DataServer’s default prefetch
behavior, which packs as many records as possible in one message. For example, if you have
500 byte records, the DataServer packs two records into one message. (The default Progress
message buffer size is 1 Kb.)
Prefetch and -Mm combined with the -Dsrv COMPRESS=1 parameter can enhance
performance even more. The COMPRESS option can compress records up to 50%. In the
example, the DataServer can compress the 500 byte records by 50% so that it can pack four
records into one message.
8–22
System Administration
Table 8–4 shows the settings for PROSET and the effects of assigning different values to those
settings.
Program/Utility: General
8–23
Progress/400 Product Guide
Program/Utility: CHGPRODCT
Program/Utility: CHGPRODCT
Program/Utility: CHGPRODCT
8–24
System Administration
Program/Utility: APYPRODCT
Program/Utility: CHGPRODCT
8–25
Progress/400 Product Guide
Program/Utility: APYPRODCT
Program/Utility: APYPRODCT
8–26
System Administration
Program/Utility: CHGPRODCT
Program/Utility: CHGPRODCT
NOTE: If variant characters are not mapped, it is possible to create a file or field name that
is invalid to Progress/400. For example, the pound sign (#) is a valid character for
OS/400 but invalid to Progress/400.
See your Progress/400 Release Notes for additional settings that you can add to your PROSET
file.
• On new files created with the Progress/400 Data Dictionary, the setting has no effect.
• When you use the Progress/400 Data Dictionary to maintain an existing file that was added
with the Progress/400 Data Dictionary and the file contains data, then when the data is
copied back into the file and decimals are added, the data is shifted to the left by the
number of decimals.
8–27
Progress/400 Product Guide
For example, suppose that the Balance field of a record in the customer file in the
Progress-supplied PRODEMO sample database contains the value 93545, then you
perform maintenance on the file (not necessarily to this field). After performing
maintenance, the value in the Balance field is 9354500.
This change happens whenever you perform an action in the Progress/400 Data Dictionary
that results in the regeneration of the DDS. This means that if a user adds or deletes a field
and does not touch the zoned field, the value in the zoned field still changes.
If you want to set ALLOW-ZONE-DECIMAL to Y but ensure that data values remain
correct when you use the Progress/400 Data Dictionary, you must do the following:
• When you either use the Progress/400 Data Dictionary to maintain an existing file that was
originally added with CHGPRODCT or perform maintenance using CHGPRODCT, the
file maintains the proper decimals and the data values are correct.
• On new files created with the Progress/400 Data Dictionary, the DDS does not have
decimals.
• When you use the Progress/400 Data Dictionary to maintain an existing file that was
originally added with the Progress/400 Data Dictionary, there are no behavioral changes
and the data values remain the same.
• When you use the Progress/400 Data Dictionary to maintain an existing file that was added
with CHGPRODCT, the DDS loses the decimals and any data is truncated.
8–28
System Administration
• A file has changed; for example, from a logical file to a physical file.
• A Progress/400 field data type has changed (character, integer, and so forth).
• It is possible that the index designated as primary might not be retained. It is affected by
the value of the PROATR option. If *CMPSAVE is selected, Progress issues a message if
the value has changed.
• An initial value was specified for a field on the AS/400. CHGPRODCT always overwrites
the initial value set from the Progress/400 Data Dictionary.
Table 8–5 shows the affect of PROATR on fields given the three possible keyword selections.
FILE RELATED:
FIELD RELATED:
8–29
Progress/400 Product Guide
INDEX RELATED:
8–30
System Administration
1. DUPPRODB creates a new object library and a new server schema. The object library is
the destination for all the files that you want to duplicate.
2. DUPPRODB copies the physical and logical files from the existing server schema that you
specify into the new server schema and object library.
There are several options for how DUPPRODB duplicates the server schema. You determine
the way the DB2/400 database files are duplicated by your entry at the Duplicate Files
(CPYOPT) parameter:
• The *FULLCPY option allows you to duplicate all of the files (including data) that are part
of the server schema, regardless of the library where the files reside. This option creates
an exact duplicate of the existing server schema, except that each duplicate file resides in
the new library. Previously, the files might have resided in several libraries.
Use this option when you want to make an exact duplicate of a database so you can use
one database for testing and one for production.
CAUTION: This command does not duplicate all objects in a library. It duplicates only
the objects in a library that are defined in a server schema.
• The *EMPTYCPY option operates identically to the *FULLCPY option except that it
does not copy the data that the objects contain; that is, the new objects are empty.
• The *DCTONLY option allows you to duplicate only the server schema.
8–31
Progress/400 Product Guide
Figure 8–5 and Figure 8–6 illustrate the use of the *FULLCPY and *DCTONLY options.
• Figure 8–5 shows the results you get when you use DUPPRODB with the *FULLCPY
option, as in the following command:
Figure 8–5 also applies to using DUPPRODB with the *EMPTYCPY option except that
the data files contain no data.
• Figure 8–6 shows the results you get when you use DUPPRODB with the *DCTONLY
option, as in the following command:
See Appendix A, “Tutorials for Managing Your Dictionary Library,” for more examples on
duplicating a Progress database.
8–32
System Administration
Server Schema
CUSTOMER PROSPECT
P__FILE
CUSTOMER
ORDER
ORDER PROSPECT
DUPPRODB *FULLCPY
MYSPORTS Library
Server Schema
CUSTOMER
P__FILE
CUSTOMER
ORDER
ORDER PROSPECT
PROSPECT
8–33
Progress/400 Product Guide
Server Schema
CUSTOMER PROSPECT
P__FILE
CUSTOMER
ORDER
ORDER PROSPECT
DUPPRODB *DCTONLY
MYSPORTS Library
Server Schema
P__FILE
CUSTOMER
ORDER
PROSPECT
8–34
9
Remote Client DB2/400 Utilities
This chapter describes the client utilities and the tasks associated with them. It covers the
following tasks:
Progress/400 Data Use this tool to maintain data definitions on the AS/400. It is
Dictionary available on MS-Windows only.
Synchronize Use this utility to update the schema holder to reflect any changes
Progress/400 Client... made to DB2/400 data definitions and run the verify option.
Edit DB2/400 Use this utility to change connection information for a DB2/400
Connection database.
Information...
Create DB2/400 Use this utility to create a client schema holder for a DB2/400
DataServer database.
Schema...
9–2
Remote Client DB2/400 Utilities
3 ♦ Choose the Selective or Full radio button to perform a selective or a full synchronization.
This window displays the files that you can select for synchronization.
• To select an object, use the up and down arrow keys in the “Select Objects to
process:” pane to highlight a name, then press the RETURN key or the Add >> button
to select it. The name moves to the Objects to be processed: pane. Repeat this process
for each object to be synchronized.
9–3
Progress/400 Product Guide
• To remove a selected object, use the up and down arrow keys in the “Objects to be
processed:” pane to highlight the object name, then press the RETURN key or the
<< Remove button to remove it. The object name moves to the Select Object to
process: pane. Repeat the selection process for each object to be removed.
5 ♦ Choose Verify Server Schema to verify the physical file objects against the information in
the server schema. If the utility finds any differences, it displays a report.
6 ♦ Choose OK.
You can also access this utility from the Admin menu in the Progress/400 Data Dictionary. In
addition, the installation media includes the as4sync.p procedure that you can run in an
application to synchronize deployed schema holders.
2 ♦ Modify the Connection Parameters. When you are done, choose OK to return to the main
window.
The changes do not take effect until you disconnect and reconnect the client schema holder.
When you reconnect, Progress uses the new connection parameters.
9–4
Remote Client DB2/400 Utilities
1 ♦ From the Data Administration main window, choose DataServer→ DB2/400 Utilities→
Delete DB2/400 DataServer Schema. The following dialog box appears:
2 ♦ Choose Yes to verify your selection. The utility deletes the schema from the client schema
holder.
This utility deletes the schema information from the client schema holder. It does not delete the
database that serves as the schema holder or any user data in the DB2/400 database. For
example, if you have the schema for three non-Progress databases stored in a schema holder
such as DB2/400, ORACLE, or ODBC, you can delete the DB2/400 schema information and
leave the other schema information intact.
9–5
Progress/400 Product Guide
• Modify schema — This mode requires that the client session connect to the AS/400 server
as Database Administrator (DBA) and that the current user have authority to execute the
Change Journal (CHGJRN) CL command. When you access DB2/400 database files in
DBA mode, the OS/400 locks the objects and prevents other users or jobs from accessing
them. Use this mode only when you plan to make changes to DB2/400 data definitions.
9–6
Remote Client DB2/400 Utilities
• Read only — This mode allows you to view DB2/400 data definitions; load data; and
generate table, field, index, and sequence reports. It does not lock the server schema.
You must synchronize the client schema holder with the server schema before performing any
tasks with the Progress /400 Data Dictionary that involve dumping or loading data. You do not
have to synchronize before modifying, dumping, or loading data definitions.
Alternate between modify-schema mode and read-only mode by activating the appropriate
radio button in the Progress/400 Data Dictionary main window.
Be sure to commit changes that you make when you move from modify-schema mode to
read-only mode in the Progress/400 Data Dictionary. If you select not to commit changes, the
DataServer rolls back any uncommitted changes.
1 ♦ Choose the Table mode button in the Progress/400 Data Dictionary main window.
3 ♦ Choose the Create Table button. The following dialog box appears:
9–7
Progress/400 Product Guide
4 ♦ Enter a name in the Table Name field. This is the name by which Progress recognizes this
object, so it should follow Progress naming conventions. Specify a unique name.
5 ♦ Press TAB and the physical file, library, and dump filenames are supplied for you based on
the table name. For example, for a table named newcust, the AS/400 physical file name is
NEWCUST, the library name is the object library.
If you do not want default values, enter the information in each field.
6 ♦ Enter other information that you want to add to the definition for the new table. Choose
the Help button to access detailed information on all of the elements in the dialog box.
7 ♦ Choose OK.
You modified the data definitions in the server schema on the AS/400. Your server schema
now contains an object that is not reflected in the client schema holder until you
synchronize it.
Attribute Exception
9–8
Remote Client DB2/400 Utilities
1 ♦ Choose the Table mode button in the Progress/400 Data Dictionary main window.
4 ♦ Choose the Table Properties button. The following dialog box appears:
5 ♦ Modify the fields to change the definitions for the DB2/400 file. Choose the Help button
to access detailed information on all of the elements in the dialog box.
You modified the data definitions in the server schema on the AS/400. Your server schema
now contains definitions that are not reflected in the client schema holder until you
synchronize it.
9–9
Progress/400 Product Guide
logical file refers to the Customer and Order tables, and you delete the Order table and do not
preserve the DB2/400 physical file, the join logical file is deleted also.
Virtual files are an exception. The Progress/400 Data Dictionary allows you to delete these from
the server schema. However, it does not allow you to delete the associated DB2/400 logical
files.
Follow these steps to delete a table:
1 ♦ Choose the Table mode button in the Progress/400 Data Dictionary main window.
5 ♦ Choose Yes.
6 ♦ A message appears asking you whether you want to delete the DB2/400 physical file.
7 ♦ Choose Yes to delete the physical file, or choose No to delete the definition from the server
schema only and preserve the DB2/400 physical file.
You modified the data definitions in the server schema on the AS/400. Your server schema
now has changes that are not reflected in the client schema holder until you synchronize it.
9–10
Remote Client DB2/400 Utilities
1 ♦ Choose the Field mode button in the Progress/400 Data Dictionary main window.
3 ♦ Select the table from the Tables list that will contain the new field.
4 ♦ Choose the Create Field button. The following dialog box appears:
5 ♦ Enter a name in the Field Name field. This is the name by which Progress recognizes this
object, so it should follow Progress naming conventions. See the “Naming Conventions”
section in Chapter 2, “Common Product Information.”
6 ♦ Press TAB and the AS/400 name is supplied for you based on the field name. For example,
for a field named ncust-num, the AS/400 physical field name is NCUST_NUM.
If you do not want a default AS/400 field name, enter the information.
7 ♦ Choose a data type. A default format is supplied based on the data type. You can change
the default format. The format determines the size of character fields created in the
physical file.
9–11
Progress/400 Product Guide
8 ♦ Enter other information that you want to add to the definitions for the new field. Choose
the Help button to access detailed information on all of the elements in the dialog box.
You modified the data definitions in the server schema on the AS/400. Your server schema
now contains definitions that are not reflected in the client schema holder until you
synchronize it.
9–12
Remote Client DB2/400 Utilities
1 ♦ From the Progress/400 Data Dictionary main window, choose the Fields mode button. The
Fields list appears.
4 ♦ Choose the Field Properties button. The following dialog box appears:
5 ♦ Modify the fields to change the definitions for the DB2/400 file. Choose the Help button
to access detailed information on all of the elements in the dialog box.
9–13
Progress/400 Product Guide
6 ♦ Choose OK or Save. If you choose Save, use the navigation buttons to view more fields in
the Field property panel.
You modified the data definitions in the server schema on the AS/400. Your server schema
now contains definitions that are not reflected in the client schema holder until you
synchronize it.
1 ♦ Choose the Field mode button in the Progress/400 Data Dictionary main window.
4 ♦ Choose the Delete Field button. A message appears asking you to verify the deletion.
5 ♦ Choose Yes.
CAUTION: Whenever you delete a field, the data in the field is lost.
1 ♦ Choose the Index mode button in the Progress/400 Data Dictionary main window.
9–14
Remote Client DB2/400 Utilities
3 ♦ Select the table from the Tables list that will contain the new index.
4 ♦ Choose the Create Index button. The following dialog box appears:
6 ♦ Press TAB and a name for the AS/400 logical file is supplied for you based on the index
name. For example, for an index named ncust-num, the AS/400 logical file name is
NCUST_NUM.
7 ♦ Activate the Primary, Unique, Abbreviated, or Word Index check box as required.
8 ♦ If you selected the Word Index check box, enter the word size in the Word Size field. You
must specify a value from 10 to 128. This value specifies the length of the longest word
that is entered into the text field on which the index is built. A larger value results in a
larger index.
NOTE: You can change the word size in the Index Properties dialog box but only before
you commit the word index. Once you commit it, you can change the word size
only by deleting and re-creating the word index.
9 ♦ Select one or more fields to include in the index, then choose Add.
9–15
Progress/400 Product Guide
1 ♦ Choose the Index mode button in the Progress/400 Data Dictionary main window.
4 ♦ Choose the Index Properties button. The following dialog box appears:
5 ♦ You can change the names, move to a different library, or change the descriptions. Choose
the Help button to access detailed information on all of the elements in the dialog box. If
your font is too large to fit all the characters in a field, scroll the field with the arrow key.
If you flag the index as inactive, a message box appears giving you the option of deleting
the logical file on the AS/400.
NOTE: You can change the word size in the Index Properties dialog box only before you
commit the word index. Once you commit it, you can change the word size only
by deleting and re-creating the word index.
6 ♦ Choose OK or choose Save. Choose one of the navigation buttons to view more Index
property sheets.
9–16
Remote Client DB2/400 Utilities
1 ♦ Choose the Index mode button in the Progress/400 Data Dictionary main window.
4 ♦ Choose the Delete Index button. A message appears asking you to verify the deletion.
5 ♦ Choose Yes. A message appears asking whether you want to delete the DB2/400 logical
file.
6 ♦ Choose Yes to delete the logical file, or choose No to delete the index from the server
schema only and preserve the logical file.
1 ♦ Choose the Sequence mode button in the Progress/400 Data Dictionary main window.
3 ♦ Choose the Create Sequence button. The following dialog box appears:
9–17
Progress/400 Product Guide
1 ♦ Choose the Sequence mode button in the Progress/400 Data Dictionary main window.
4 ♦ Choose the Sequence Properties button. The following dialog box appears:
5 ♦ Modify the fields to change the definitions for the sequence. Choose the Help button to
access detailed information on all of the elements in the dialog box.
6 ♦ Choose OK or choose Save. Then choose one of the navigation buttons to view more
Sequence Property sheets.
1 ♦ Choose the Sequence mode button in the Progress/400 Data Dictionary main window.
9–18
Remote Client DB2/400 Utilities
4 ♦ Choose the Delete Sequence button. A message appears asking you to verify the deletion.
5 ♦ Choose Yes.
1 ♦ Choose the Procedure mode button in the Progress/400 Data Dictionary main window.
4 ♦ Enter a unique name in the Procedure Name field. This is the name by which Progress
recognizes this object, so it should follow Progress naming conventions.
5 ♦ Enter both the Program Name of the object on the AS/400 and the Library Name where
the program resides. The Program Name name must be unique within the server schema
and the name must differ from any existing physical file in the library.
6 ♦ Enter a description in the Description field. Choose the Help button to access detailed
information on all of the elements in the dialog box.
7 ♦ Choose OK to advance to the Define Parameter screen or choose Create to create the
record and begin defining another stored procedure.
If you want to create parameters for this stored procedure, see the “Adding a Parameter”
section.
9–19
Progress/400 Product Guide
You modified the data definitions in the server schema on the AS/400. Your server schema
now contains an object that is not reflected in the client schema holder until you
synchronize it.
1 ♦ Choose the Procedure mode button in the Progress/400 Data Dictionary main window.
4 ♦ Choose the Procedure Properties button. The following dialog box appears:
5 ♦ Modify the fields to change the definition for the DB2/400 program. Choose the Help
button to access detailed information on all of the elements in the dialog box.
You modified the data definitions in the server schema on the AS/400. Your server schema
now contains an object that is not reflected in the client schema holder until you
synchronize it.
9–20
Remote Client DB2/400 Utilities
1 ♦ Choose the Procedure mode button in the Progress/400 Data Dictionary main window.
5 ♦ Choose Yes.
You have modified the data definitions in the server schema on the AS/400. Your server
schema now has changes that are not reflected in the client schema holder until you
synchronize it.
1 ♦ Choose the Parameter mode button in the Progress/400 Data Dictionary main window.
3 ♦ Select the stored procedure from the procedure list that will contain the new parameter.
9–21
Progress/400 Product Guide
4 ♦ Choose the Create Parameter button. The following dialog box appears:
5 ♦ Enter a unique name in the Parameter Name field. This is the name by which Progress
recognizes this object, so it should follow Progress naming conventions.
Table 9–3 lists the supported data types and their Progress equivalents.
DB2/400 Progress
Character Logical
A default format is supplied based on the data type. You can change the default format.
The format or datatype determines the size of the parameter.
9–22
Remote Client DB2/400 Utilities
7 ♦ Select the type of parameter being defined. There are three types: input to the stored
procedure, output from the stored procedure, or input-output from the stored procedure.
8 ♦ Enter any other information that you want to add to the new parameter definition. Choose
the Help button to access detailed information on all of the elements in the dialog box.
9 ♦ Choose OK to return to the Progress/400 Data Dictionary main window or choose Create
to create the record and define another one. Up to 32 parameters can be defined for each
stored procedure.
You modified the data definitions in the server schema on the AS/400. Your server schema
now contains definitions that are not reflected in the schema holder until you synchronize
it.
1 ♦ From the Progress/400 Data Dictionary main window choose the Parameter mode button.
4 ♦ Choose the Parameter Properties button. The following dialog box appears:
5 ♦ Modify the parameter to change the definitions. Choose the Help button to access detailed
information on all of the elements in the dialog box.
9–23
Progress/400 Product Guide
6 ♦ Choose OK or Save. If you choose Save, use the navigation buttons to view more
parameters in the Parameter property panel.
You modified the data definitions in the server schema on the AS/400. Your server schema
now contains definitions that are not reflected in the client schema holder until you
synchronize it.
1 ♦ Choose the Parameter mode button in the Progress/400 Data Dictionary main window.
5 ♦ Choose Yes.
You have modified the data definitions in the server schema on the AS/400. Your server
schema now has changes that are not reflected in the client schema holder until you
synchronize it.
9–24
Remote Client DB2/400 Utilities
All other utilities require that you use the Progress/400 Data Dictionary in modify-schema
mode.
To alternate between modify-schema mode and read-only mode, activate the appropriate radio
button in the Progress/400 Data Dictionary main window. Be sure to commit changes that you
make when you move from modify-schema mode to read-only mode in the Progress/400 Data
Dictionary.
2 ♦ Choose Admin→ Dump Data & Definitions→ Data Definitions (.df). The following dialog
box appears:
3 ♦ Select the tables from which you want to dump data definitions.
9–25
Progress/400 Product Guide
4 ♦ Activate the Progress or AS400 radio button to select a Progress or AS/400 format for the
.df file:
• Progress format - Choose this format if you want to preserve only Progress
information. This creates a standard .df file that you can then load into a Progress
database or a DB2/400 database.
CAUTION: If dumping in AS/400 format, you can only load the file with the
Progress/400 Data Dictionary.
5 ♦ Choose OK.
6 ♦ Enter a name for the data definitions (.df) file or accept the default name.
7 ♦ Choose OK.
When virtual files are dumped and reloaded into another server schema, they become physical
files, not virtual files.
The server schema might contain only a subset of the DDS data definitions for your original
DB2/400 files. The resulting .df file does not contain information regarding unsupported DDS
definitions.
9–26
Remote Client DB2/400 Utilities
4 ♦ Select the table or tables from which you want to dump data.
5 ♦ Enter a name for the data (.d) file. By default the filename is the database name with the
.d extension. The following dialog box appears:
6 ♦ Choose OK.
You can load the resulting data file into DB2/400 database files using the load utility in the
Progress/400 Data Dictionary. Additionally, you can load data into the DB2/400 files through
the standard Progress load utilities. Make sure that the client schema holder has been
synchronized.
2 ♦ Choose Admin→ Dump Data & Definitions→ Sequences Definitions (.df). The following
dialog box appears:
3 ♦ Enter a name for the definition (.df) file. The filename is _seqdefs.df by default.
4 ♦ Choose OK.
9–27
Progress/400 Product Guide
You can load the resulting data definitions file into DB2/400 database files using the load utility
in the Progress/400 Data Dictionary.
3 ♦ Choose Admin→ Dump Data & Definitions→ Sequences Current Values (.d). The
following dialog box appears:
4 ♦ Enter a name for the data (.d) file. By default the filename is _seqvals.d
5 ♦ Choose OK.
You can load the resulting data file into DB2/400 database files using the load utility in the
Progress/400 Data Dictionary.
9–28
Remote Client DB2/400 Utilities
2 ♦ Choose Admin→ Dump Data & Definitions→ Create Incremental .df File. The following
window appears:
The Progress/400 Data Dictionary lists all connected DB2/400 databases except the
working database.
3 ♦ If you have more than two DB2/400 databases connected, select the database that you want
to update to be a duplicate of your working database.
4 ♦ When prompted, enter the name of the file to which the utility will write the differences.
The default is DELTA.DF.
5 ♦ Choose OK to perform the comparison. The file, field, and index names are displayed
during the comparison.
Once the comparison is complete and the incremental .df file has been created, you can load the
file using the Progress/400 Data Dictionary to apply the schema changes to an existing database.
After you load the file, you must synchronize the schema holder. See the“Loading Data
Definitions” and “Synchronizing the Client” sections, respectively, for details.
9–29
Progress/400 Product Guide
3 ♦ Enter the name of the data definitions (.df) file that you want to load.
You cannot load a .df file of a type other than AS/400 or Progress (for example,
ORACLE).
You can load a standard Progress .df file (including an incremental .df file) or an
AS/400-formatted .df file. If you load a standard Progress .df file, the utility adds the
information required by the AS/400, such as field storage length and DDS data type.
CAUTION: Use the Progress/400 Data Dictionary to load a .df file. Additionally, if you
load an AS/400-formatted .df file that you have modified by hand,
unpredictable results can occur.
9–30
Remote Client DB2/400 Utilities
Table 9–4 describes how the utility maps Progress data types to DDS and DB2/400 data
types. See the “Data Types” section in Chapter 2, “Common Product Information,” for
more information.
CHARACTER String A
LOGICAL Character A
4 ♦ Activate a toggle box to select how the load utility handles errors and warnings. Even if
you do not choose to display errors on screen, the utility displays serious errors; that is,
errors that prevent the load from continuing or backing everything out.
5 ♦ If you want all file and field names to be RPG compliant, activate the Create RPG/400
Length Names toggle box.
6 ♦ If you want all fields to be SQL Null Capable, accept the default value, otherwise
deactivate the Allow SQL Null toggle box.
7 ♦ Choose OK.
If the .df file contains an index the length of whose combined fields is greater than or equal to
200, the load utility does not create the index. However, the load utility continues to load the
valid definitions and displays messages about definitions that it could not load.
Loading a definition file that contains word indexes creates an index with a default word size
of 30.
NOTE: You can change the word size in the Index Properties dialog box, but only before
you commit the word index. Once you commit it, you can change the word size
only by deleting and re-creating the word index. Similarly, you can change the
attributes of a field in the Field Properties dialog box, but only before you commit
the file. Once you commit it, the Progress/400 Data Dictionary restricts what
attributes you can change.
9–31
Progress/400 Product Guide
If the .df file contains virtual file definitions, the load utility creates physical files. For example,
when you dump definitions for a logical join named CUSTJ1 and load it, the DataServer creates
a physical file CUSTJ1 and a logical file CUSTJ1__1 for the primary index. See the “Virtual
Tables” section in Chapter 2, “Common Product Information,” for more information.
5 ♦ Enter the name of the data (.d) file that you want to load and choose OK.
You can also use the standard Progress load utilities in the Data Administration tool to load data
into DB2/400 database files.
9–32
Remote Client DB2/400 Utilities
2 ♦ Choose Admin→ Load Data & Definitions→ Sequences Current Values (.d).
3 ♦ Enter the name of the data (.d) file that you want to load.
4 ♦ Choose OK.
NOTE: When performing a selective synchronization, this utility does not check for or
remove objects from the schema holder that are no longer present in the server
schema. It also does not process changes to sequences. You must perform a full
synchronization to include this activity.
9–33
Progress/400 Product Guide
3 ♦ Choose the Selective or Full radio button to perform a selective or a full synchronization.
This window displays the files that you can select for synchronization.
9–34
Remote Client DB2/400 Utilities
• To select a file, use the up and down arrow keys in the Select Objects to process: pane
to highlight a filename, then press the RETURN key or the Add >> button to select it.
The file name moves to the Objects to be processed: pane. Repeat this process for
each object to be synchronized.
• To remove a selected object, use the up and down arrow keys in the Objects to be
processed: pane to highlight the object name, then press the RETURN key or the
<< Remove button to remove it. The object name moves to the Select Objects to
process: pane. Repeat the selection process for each object to be removed.
5 ♦ Choose to synchronize your client schema holder and/or your Native 4GL schema image.
6 ♦ Choose Verify Server Schema to verify the physical file objects against the information in
the server schema. If the utility finds any differences, it displays a report.
7 ♦ Choose OK.
9–35
Progress/400 Product Guide
9–36
10
AS/400 Utilities
This chapter describes the utilities that you use to create and maintain your Progress/400
environment on the AS/400. This chapter groups the utilities according to the subject areas in
the following list:
10–2
AS/400 Utilities
10–3
Progress/400 Product Guide
1 ♦ Type the following command on the command line, then press F4:
GO PROGRESS
Note that this menu is divided into five sections by utility type: AppServer, Dictionary,
Word Index, TCP/IP Network, and Native 4GL Client. If a Progress/400 command is not
listed within one of the groups in this menu, you must run it from the command line.
2 ♦ Type the number of the utility to run after the arrow, then press RETURN.
10–4
AS/400 Utilities
You can also run the utility by entering the command, the keywords for parameters, and the
appropriate values at the command line.
• Enter the Progress/400 utility name on the command line and press the F1 key.
• Position the cursor on the parameter for which you need the help description and press F1.
Type the number of the utility to run after the arrow, then press RETURN.
10–5
Progress/400 Product Guide
Parameter Value
Parameter Value
10–6
AS/400 Utilities
The SETPROENV command affects the environment variables shown in Table 10–3.
Parameter Value
10–7
Progress/400 Product Guide
Type the number of the utility to run after the arrow, then press RETURN.
Note that you cannot use CHGPRODCT to delete files from the Progress/400 server schema.
You must use the RMVSCHE utility instead. See the “Remove Server Schema Entry
(RMVSCHE)” section for details.
10–8
AS/400 Utilities
Progress/400 PRODCT Enter the name of the library that contains your
Dictionary Name server schema, or *CURLIB to specify the current
library. If you are creating a Progress/400
environment for the first time, enter here the same
name that you entered for the New Progress/400
Database Name in the DUPPRODB utility.
From File(s) FRMFILLST Specify the files that you want to access through the
DataServer. Accept the default, *ALL, if you do not
want to specify files. Press + to enter additional
files, or specify other values as follows:
- If you enter *YES at the include Database
Relations parameter, you need to enter only the
physical filenames in the From File list and not
the names of the database relations.
- If you enter *NO or *NONE, do not include any
database relations over the physical file in the
server schema.
- If you enter *PFLIB, only the database relations
residing in the library within the physical file
from which they are based are included in the
server schema.
From Library(s) Enter the name of the library where the DB2/400
database files reside. If the objects reside in more
than one library, enter *LIBL to specify the library
list.
10–9
Progress/400 Product Guide
Error Tolerance ERRLIMIT Enter *NOMAX to specify that the utility continue
Threshold when an error occurs.
Enter a value (0-32,000) to indicate an acceptable
level of error.
10–10
AS/400 Utilities
10–11
Progress/400 Product Guide
You modify values in the Progress/400 Product Configuration screen to change values
originally set during installation for the Progress/400 product:
You modify values in the Progress/400 Native-Client Configuration screen to change the
temporary objects directory originally set during installation for the Native 4GL Client and the
Progress/400 AppServer:
You modify values in the Progress/400 AppServer Configuration and Defaults screen to change
the defaults originally set during installation for the Progress/400 AppServer.
10–12
AS/400 Utilities
Number of Lock NUMLCK Enter an integer value from 100 to 99,999 that
Table Entries specifies the number of entries in the relevant
Progress/400 lock table. A new lock table is created
with this number of entries and an existing lock
table is modified to contain this number of entries.
The default is 500. You might have to adjust the
value you set initially, depending on your number
of users, to obtain maximum performance.
Dictionary Library DCTLIB Enter the Progress/400 server schema library name.
This utility automatically synchronizes the schema
image with the server schema.
10–13
Progress/400 Product Guide
Source Dictionary SRCDCTLIB Enter the name of the library that contains the
Library Progress/400 Dictionary that you want to convert.
Destination DSTDCTLIB Enter the name of the library that contains the
Dictionary Library Progress/400 Dictionary that is the destination for
the conversion. Progress Software recommends
that you use a separate library for your server
schema.
Overlay Source CVTSRCDCT This additional parameter, which you access using
Dict. Schema the F10 control key, specifies whether the Source
Dictionary Library is converted in place. In a
conversion in place, the Source Dictionary Library
server schema is overlaid with new information.
NOTE: Use this option at your own risk. You will
be able to use the converted dictionary only with
the current version of Progress/400.
- Enter *YES to perform the conversion in place
and overlay the Source Dictionary Library server
schema with the current Progress/400 version
server schema information. Note that if you enter
*YES, you must specify identical names for the
Source Dictionary Library and Destination
Dictionary Library parameters.
- Enter *NO (the default) to convert the Source
Dictionary Library to a different Destination
Dictionary Library; that is, to not perform the
conversion in place.
10–14
AS/400 Utilities
Destination DCTLIB Enter the name of the library that contains the server
Dictionary Library schema that you want to convert. Press + to enter
additional Dictionary Libraries.
• Duplicate an existing Progress/400 server schema and DB2/400 database files, with or
without data. See the “Creating Test and Production Environments” section in Chapter 8,
“System Administration,” for a detailed description of using the DUPPRODB utility to
duplicate dictionaries.
NOTE: All of the files in the dictionary that you want to copy should have *OBJEXIST,
*OBJMGT, *OBJOPR, and *READ authority to the user performing DUPPRODB
operations.
10–15
Progress/400 Product Guide
New Progress/400 DB NEWDB Enter the name for the new library that the
Name utility creates or *CURLIB to specify the
current library.
10–16
AS/400 Utilities
Dictionary Copy Option CPYOPT This option appears only if you do not enter
*PROEMPTY in the FRMDB option. If it
appears, enter one of the following options:
- Enter *FULLCPY to create the server
schema in NEWDB and duplicate the
objects defined in the server schema in
the library specified at the Database
Object Library parameter. The new
objects contain the data stored in the
existing objects.
- Enter *EMPTYCPY to copy only the
objects contained in a Progress/400
Data Dictionary and no data. It creates
the server schema in the NEWDB from
the FRMDB and the objects defined in
the server schema. The new objects do
not contain data. If you want the objects
to be created in a library other than the
library that contains the server schema,
specify that library at the Database
Object Library option. The utility creates
the empty object in the OBJLIB and
updates the references to that library in
the server schema.
- Enter *DCTONLY to copy only the
server schema from the FRMDB to the
NEWDB and no objects or data. If your
NEWDB already has a server schema
defined, enter *YES at the Overwrite
Existing Dictionary option.
If the utility encounters a failure, it backs
out any duplications and restores the
NEWDB library to its prior state.
Create Schema Image CRTSCHIMG Enter *YES to create a schema image. The
schema image automatically synchronizes
with the server schema. The default value
for this parameter is *NO.
10–17
Progress/400 Product Guide
Upper Case Table UPCASE Enter the name and library for the
uppercase table that your DB2/400
database files use.
Lower Case Table LOCASE Enter the name and library for the
lowercase table that your DB2/400
database files use.
Word Break Table SEPTABLE Enter the name and library of the word
break table for your Progress/400 word
indexes.
10–18
AS/400 Utilities
DataServer Database DBCODPAG Enter the name of the code page that your
Code Page DB2/400 database files use.
By default, this parameter is set to
*SYSVAL, the code page that your system
uses. Your DB2/400 database files might
use a different code page; enter its name
here. The name must correspond to the
name of the Case Sensitive Altseq Table on
the AS/400 and to the name of a code page
listed in the CONVMAP.DAT file on the client.
If the code-page name is not listed, you can
add an entry for it. The client handles all
code-page conversions; it converts only
those fields that an application requests.
See the character-processing chapter in the
Progress Internationalization Guide for
instructions. See the AS/400 National
Language Support Planning Guide for
more information on code pages.
10–19
Progress/400 Product Guide
Database Object Library OBJLIB Enter *NEWDB to use the same library to
contain both the Dictionary and the
database files.
Enter a library name or enter *CURLIB to
specify the current library. If the library
exists, the utility uses it to contain the
database files. If the library does not exist,
the utility creates it and places the database
files in it.
Create Progress Lock CRTLKT Enter *NO if you want OS/400 locking
Table behavior. See Chapter 2, “Common
Product Information,” for a comparison of
Progress and OS/400 locking.
Enter *YES if you want locking behavior
that is compatible with Progress locking.
The default is 500 locks. If more locks are
needed, use CRTPROLKT.
The utility creates the server schema in the Progress/400 Dictionary Library. It contains the
OS/400 files listed in Table 10–10.
10–20
AS/400 Utilities
The utility also creates the OS/400 objects listed in Table 10–11.
10–21
Progress/400 Product Guide
Progress Table PROTBL Enter the name of the Progress table to dump or
Name(s) *ALL (the default) to dump all tables in the
Progress/400 dictionary library.
From Directory FROMDIR Enter the name of the directory containing the input
load file, or enter *CURDIR (the default) to
indicate the current directory.
Progress Table PROTBL Enter the name of the Progress table to load or
Name(s) *ALL (the default) to load all tables in the
Progress/400 dictionary library.
10–22
AS/400 Utilities
Dictionary DCTLIB Enter the name of the library containing the server
Library schema to be synchronized.
10–23
Progress/400 Product Guide
• You can specify *ALL values only when the entry type is *TABLE.
• The Automatically Reassign Primary Index parameter works in conjunction with the
*INDEX option.
• You cannot remove the physical file key either by explicitly naming the file or by selecting
the *RELATIONS option.
• Setting the Automatically Reassign Primary Index parameter to *NO and entering the
primary index name in the file name parameter does not remove the primary index.
• The *RELATIONS option does not use the Automatically Reassign Primary Index
parameter.
10–24
AS/400 Utilities
• If you specify *ALL for both the filename and the library name and use *TABLE,
the server schema is cleared.
• If you specify *YES for the Automatically Reassign Primary Index parameter, the first
index found in the P__INDEX file becomes the new primary index.
• The utility lists the files removed from the server schema in the job log.
• If an error occurs, a rollback is performed. This means that either all changes or no changes
are processed.
• The validity checker provides the normal checking to verify access and, in addition,
validates the following:
– If the *ALL option is used for the file name and/or the library name, the entry-type
is *TABLE.
NOTE: If the *ALL option is used with any entry other than *TABLE, an error message
is returned.
Dictionary Library DCTLIB Enter the name of the dictionary library that contains
the schema image.
10–25
Progress/400 Product Guide
Type the number of the utility to run after the arrow, then press RETURN.
10–26
AS/400 Utilities
Physical File FILE Enter the name of the physical file and library on
which Progress/400 word indexes are built.
Word Index WRDIDX Enter the name and library of the word index to
generate or *ALL to specify that all Progress/400
word indexes for the specified physical file are
rebuilt.
Word Break Table WBT Enter the name and library of the Progress/400
Name word break table.
10–27
Progress/400 Product Guide
to change its Run Priority (RUNPTY) to 20 and its Time Slice (TIMESLICE) to 2000. This
forces both jobs to run at interactive priority, which ensures that they run very quickly.
If the PROWISDTAQ job ends abnormally because of an error or because an ENDJOB
command is run against it, the PROWISRCV job starts it again. This ensures that the
PROWISRCV job can perform its task. However, if the PROWISRCV job ends, you must
restart this job with the STRWISPRC utility.
There is exactly one PROWISRCV job per Word Index Work Library, and each PROWISRCV
job starts exactly one PROWISDTAQ job. If the Word Index Support Processor jobs are already
running when you execute the STRWISPRC utility, the utility returns a message noting that
only one set of Processor jobs can be active at one time.
When the STRWISPRC utility executes, it deletes old journal receivers and reorganizes the
PROTRGTXN file. You should shut down and restart the Word Index Support Processor
regularly to minimize the number of old receivers and the size of the PROTRGTXN file.
For a description of word indexing, including the Word Index Support Processor and the
Word Index Work Library, see the “Progress/400 Word Index Support” section in Chapter 2,
“Common Product Information.”
Table 10–18 describes the STRWISPRC parameters.
Submit to Job JOBQ Enter the name of the job queue where you submit
Queue the Word Index Support Processor’s PROWISRCV
job.
In Library N/A Enter the name of the library where the job queue
exists.
10–28
AS/400 Utilities
Word Break Table WBT Enter the name of the word break table to create or
Name maintain. If the table does not exist, the utility
creates it. If it does exist, the utility maintains it.
Library Name N/A Enter the name of the library where the word break
table exists or where it is to be created or *LIBL to
specify the library list. If you enter *LIBL and the
table is not found in the job’s library list, it is
created in the job’s *CURLIB (current library).
UPDPROWBT Screen
The screen that appears when you run the UPDPROWBT utility looks like this:
10–29
Progress/400 Product Guide
You modify values in this screen to define the actual contents of the word index table. The
columns contain the following:
• The Hex Byte column contains a character for which a meaning is being defined.
• The associated Meaning column contains a value that indicates the meaning.
For example, Progress/400 word index support treats the hexadecimal character X’00’as a
terminator.
10–30
AS/400 Utilities
Type the number of the utility to run after the arrow, then press RETURN.
TCP Information TCPINF Enter the name of the TCP/IP Broker Service or
port number to end. Specify the same value that
you specified for the STRPRONET utility.
10–31
Progress/400 Product Guide
Broker/Manager SBMQUE Enter the name of the job queue that you want to
Job Queue assign to the TCP/IP broker. If other jobs are
required to execute concurrently through the same
job queue, the job queue should be multi-threaded.
See the AS/400 Work Management Guide for
information on working with job queues.
Service Name N/A Enter the name of the service or port number on the
AS/400 that the TCP/IP broker uses. Use the
CFGTCP CL command (option 21) to look up the
name in TCP Services Name.
10–32
AS/400 Utilities
Server Job Queue N/A Enter the name of the job queue that you want to
assign to the database server. If other jobs are
required to execute concurrently through the same
job queue, the job queue should be multi-threaded.
See the AS/400 Work Management Guide for
information on working with job queues.
Library N/A Enter the name of the library that contains the job
queue, the value *LIBL to specify your library list,
or the value *CURLIB to specify the current library.
Server Timeout N/A Specify the number of seconds that the server waits
before retrying to connect after a failed response.
Enter a value from 30 and 180. The default is 60.
Start Server w/ N/A Specify whether to start the server with message
Message Logging logging. Enter one of the following:
- Enter *NO (the default) to not log messages.
- Enter *YES to log messages.
First Server Port to N/A Specify the number of the first server port to assign.
Assign The default is 1025.
Last Server Port to N/A Specify the number of the last server port to assign.
Assign You must specify a value that is greater than the
value of the First Server Port to Assign parameter.
The default is 2000.
10–33
Progress/400 Product Guide
Progress/400 Job TYPE Specify the types of processes to list. Enter one of
Type the following:
- Enter *BROKER to list all TCP/IP broker
processes.
- Enter *SERVER to list all SNA and TCP/IP
server processes.
- Enter *CLIENT to list all native client
processes.
Type the number of the utility to run after the arrow, then press RETURN.
10–34
AS/400 Utilities
Startup Procedure (-p) STRPROC Specify Progress 4GL code that the Native
4GL Client will execute. This parameter is
required.
Database Name (-db) SCHDB Enter the name of the library that contains
your server schema.
Print File (-o) PRTF Enter the printer to use when processing the
OUTPUT TO PRINTER statement in
procedures.
Parameter File Name (-pf) PRMFMBR Enter the name of a parameter file that
contains Progress startup parameters.
10–35
Progress/400 Product Guide
You can provide additional parameters to the Native 4GL Client with the STRPROCLI utility.
There are two ways to do this:
Table 10–26 lists an effective and useful subset of parameters that the Native 4GL Client
supports.
Parameter Description
Case Code Page (-cpcase) Name of a case table within the CONVMAP.CP file.
Print Code Page (-cpprint) Name of code page for printer output.
R-code in Code Page (-cprcodein) Name of code page for reading r-code segments.
10–36
AS/400 Utilities
Parameter Description
Stream Code Page (-cpstream) Name of code page for stream I/O.
Physical Database Name (-db) Name of the database to connect to when a Progress
session starts.
Startup Procedure (-p) The name of the procedure to run when starting
Progress.
Parameter File (-pf) The name of a parameter file that contains startup
parameters to run Progress.
For detailed descriptions of these parameters, see the Progress Startup Command and
Parameter Reference.
10–37
Progress/400 Product Guide
10–38
11
Progress 4GL Interfaces to OS/400
Languages and Objects
The Progress/400 client can access OS/400 commands and programs. It can submit OS/400
jobs, execute OS/400 commands, and execute special Progress/400 commands. Additionally,
the Progress/400 product allows you to call OS/400 programs from within a Progress/400
procedure. The Progress/400 product also supports Progress 4GL access to data areas, user
spaces, and data queues. This chapter covers these features within the following topics:
Though OS400 is a Progress 4GL statement, all additional characters are treated as the EPI
command. Progress processes the EPI command at run time. The STATUS(sts) and
MESSAGES(msg) parameters allow the Progress 4GL to examine error messages returned
from the EPI command.
The Progress 4GL uses the STATUS(sts) parameter as a status indicator (where sts is a Progress
shared variable of type INTEGER). The Progress 4GL uses the MESSAGES(msg) parameter to
store the error messages encountered during parsing or execution of the EPI command (where
msg is a Progress shared variable of type CHARACTER with at least one extent). If the EPI
command is successfully parsed and executed, the value in the sts variable is zero (0). If errors
are encountered during parsing or execution of the EPI command, the value in the sts variable
is greater than zero (0) and indicates how many messages have been placed in the msg array.
Use the OS-ERROR function to determine the status of the EPI command. Progress has
extended this function to support new Progress/400 EPI error numbers. To determine the results
of an EPI command, examine the value returned by the OS-ERROR function.
Table 11–1 describes the error codes that can be returned.
11–2
Progress 4GL Interfaces to OS/400 Languages and Objects
• The called program must expect parameters passed by reference. Specifically, the called
program must accept an address that points to memory that contains the value of the
parameter. For example, CL, RPG, and C programs all expect parameters passed by
reference. MI programs can handle parameters passed by value and by reference. Any
program that expects parameters passed by value cannot be called by the Progress 4GL.
– CHARACTER
– DECIMAL or PACKED
– ZONED
– LOGICAL as CHARACTER
11–3
Progress/400 Product Guide
– DECIMAL
– CHARACTER
– INTEGER
– LOGICAL
For details on data type support, see the “PARM Parameter” section.
Syntax
The syntax for the EPI CALL command is designed for use by both the Progress programmer
and the OS/400 programmer. The EPI CALL syntax mixes both Progress and CL constructs,
making it familiar to both types of programmers:
PGM Parameter
The CALL statement uses the PGM parameter to specify the name of the program the 4GL
program is calling. The value and use of this parameter match those of the PGM parameter on
the CL CALL command. You can explicitly specify the library or use the *LIBL. The PGM
parameter is required. If you do not specify a library, the Progress 4GL assumes *LIBL. If the
program or library is not found, the Progress 4GL places an error message into the MESSAGES
variable.
PARM Parameter
The PARM parameter defines what parameters, if any, Progress passes to the called program
and how Progress passes them. Any Progress variable used as a parameter for an HLL program
must be defined as a SHARED VARIABLE. Defining variables in this fashion allows the value
of the variable to be retrieved and changed efficiently. Progress shared variables are passed to
an HLL program as a particular data type. The value prog-var contains the name of a Progress
variable. The variable must be defined as a shared variable. A single element of a 4GL array
(EXTENT field) can also be used as prog-var.
11–4
Progress 4GL Interfaces to OS/400 Languages and Objects
The Progress variable must be one of the following Progress data types:
• DECIMAL
• CHARACTER
• INTEGER
• LOGICAL
Progress requires the AS keyword. This states that the Progress variable will be passed to the
called program as TYPE, where type indicates an OS/400 data type. The following OS/400 data
types are supported:
• CHARACTER or CHAR
• DECIMAL or PACKED
• ZONED
• LOGICAL as CHARACTER
Each parameter must have an OS/400 data type and a length. When you define the OS/400 data
type, also define its length. To do this, use TYPE(len, decimals), where len indicates the length
of the program parameter; and decimals, when required, specifies the number of decimal digits.
Packed and Zoned parameters must have the number of decimals defined.
Table 11–2 indicates the rules to follow when defining the mapping between Progress and
OS/400 data types.
Progress OS/400
Rules for Mapping
Data Type Data Type
11–5
Progress/400 Product Guide
Progress OS/400
Rules for Mapping
Data Type Data Type
The USE parameter indicates how the Progress 4GL program treats the value of the variable.
Table 11–3 describes the USE values.
OUTPUT The called program is called with a default value. When the
called program returns, the Progress variable reflects what is
passed back from the program. If the OS/400 data type is
CHARACTER, blanks are passed. If the OS/400 data type is
numeric, a value of zero (0) is passed.
The following code shows how to construct the EPI command for a call to a CL program:
11–6
Progress 4GL Interfaces to OS/400 Languages and Objects
CL Program TESTCLP
RETURN
ENDPGM
Example Progress 4GL programs and OS/400 programs are provided with your release. Sample
HLL programs are available in the Examples Source File in the Progress-supplied product
library.
11–7
Progress/400 Product Guide
When you create a client schema holder, the DataServer loads a data definition file called
QCMD, which provides this functionality. QCMD contains a parameter form for the OS/400
Submit Job (SBMJOB) command. When you complete the parameter form and press F2, the
DataServer either performs the SBMJOB function, processes the OS/400 command, or
processes the special Progress/400 command. The entry in the CMD parameter, which is the
first entry on the parameter form, determines how the DataServer handles the request.
The Progress client session is not notified of the job’s command status or of errors or warnings
that the job generates. Use the OS/400 Display Job (DSPJOB) command to view job
information.
Before you can submit a job, you must connect to the client schema holder and the DB2/400
database files.
• If the value for the CMD parameter is an OS/400 command, the Progress/400 DataServer
issues an SBMJOB command using the entries that you provide on the parameter form. (It
uses the SBMJOB command default values if you do not specify an entry is for a
parameter on the form.) See Table 11–4 for a list of SBMJOB parameters and default
values.
• If the first character for the CMD parameter is an exclamation point (!) or an asterisk (*),
and the second character is a space, the Progress/400 DataServer executes the command
immediately. (The command begins on the third character of the entry.)
NOTE: You must use an asterisk instead of an exclamation point for all DataServers
whose code pages do not translate to the exclamation point in the same way as
code page IBM037.
11–8
Progress 4GL Interfaces to OS/400 Languages and Objects
DO TRANSACTION:
CREATE QCMD.
UPDATE cmd VIEW-AS EDITOR.
INNER-CHARS 50 INNER-LINES 5 MAX-CHARS 256
LABEL "Command".
VALIDATE QCMD.
END.
The following p-code will fill the field cmd with all characters in the assign statement:
DO TRANSACTION:
CREATE QCMD.
ASSIGN cmd = "! CRTMOD MODULE(QTEMP/ASNSSTOP) SRCFILE(MYLIB/SR) " +
"SRCMBR(ASNSSTOP) OUTPUT(*PRINT) OPTION(*SYSINCPATH) " +
"DBGVIEW(*ALL)"
VALIDATE QCMD.
END.
The Progress/400 DataServer supports a special command for opening and closing files.
• If the entry for the CMD parameter is !CLOSE *ALL, the DataServer closes all of the open
database files.
• If the entry is !CLOSE xxx (where xxx is the name of an OS/400 file), Progress/400 closes
the named file in the connected database (if the file was open).
NOTE: For the CLOSE commands, there is no space between the exclamation point (!) and
the CLOSE keyword.
If the entry is not one of these cases, Progress/400 writes a message to the job log and does not
perform any processing.
When you use QCMD for the SBMJOB command, Progress/400 submits the command to the
job queue specified for the JOBQ parameter, where it runs under the user profile specified for
the USER parameter. When you use QCMD to process a special Progress/400 command, the
DataServer immediately processes it and ignores the remaining SBMJOB parameters.
11–9
Progress/400 Product Guide
3 ♦ Press GO. Progress displays the parameter form for the OS/400 Submit Job (SBMJOB)
command.
4 ♦ Complete the parameters that are necessary for the job you are submitting, then press GO.
Progress/400 submits the job to the queue that you specify for the JOBQ parameter.
11–10
Progress 4GL Interfaces to OS/400 Languages and Objects
DO TRANSACTION.
CREATE QCMD.
ASSIGN cmd = "QCMD function"
job = "MYJOBNAME"
jobq = "QBATCH".
END.
In this statement, the QCMD function is one of the two special Progress commands, or a
valid OS/400 CL command optionally prefixed by an exclamation point or an asterisk and
followed by a space. MYJOBNAME and QBATCH are the job name and job queue,
respectively, that were selected for submitting the command.
NOTE: If you are connected to multiple databases and the command you want to execute is
specific to a database (for example, you want to close all PRODEMO files), you must
qualify the QCMD file with the database name when you perform the INSERT or
CREATE statement. For example, CREATE PRODEMO.QCMD.
QCMD can be useful when you use the Override Database File (OVRDBF) command for a file
in your Progress/400 database with multiple members. All members must share the same
physical file format. If you override the database member to a file format that is different from
the default file member, the DataServer generates unpredictable results at run time.
Feedback Information
When the DataServer executes a native CL command using the QCMD function, the job number
of the OS/400 job that executes the QCMD command can be returned by the Progress record ID
(RECID). The following example demonstrates how to display the returned job number:
CREATE QCMD.
ASSIGN cmd = "qcmd function"
job = "MYJOBNAME"
jobq = "QBATCH".
crecid = RECID(QCMD).
DISPLAY crecid.
11–11
Progress/400 Product Guide
When you execute the QCMD command with the leading exclamation point or asterisk
followed by the space on the cmd field, the DataServer job executes the command directly. If
the leading special character is a plus (+), the value that is returned to the variable crecid is the
job number of the DataServer. If you do not specify a leading special character on the cmd field,
the DataServer submits a job to the operating system to perform the command. In this case, the
value returned to the variable crecid corresponds to the job number of the submitted job. A
return value of zero in crecid indicates that the DataServer failed to execute or submit the
command request.
Error Handling
If there is an error on the command that you submit and you are using the Native 4GL Client,
the error message is in the user’s job log. If you are on a remote client, the error message is in
the server’s job log.
The output lists all of the U.S. states in the database file STATE, member STATE. To then run
the same procedure but get a list of the European states, follow these steps:
CREATE QCMD.
ASSIGN cmd = "!CLOSE STATE".
RELEASE.
11–12
Progress 4GL Interfaces to OS/400 Languages and Objects
2 ♦ Enter this QCMD command to access the data in the STATE, file EUROPE member:
CREATE QCMD.
ASSIGN cmd = "! OVRDBF FILE(STATE) MBR(EUROPE)".
RELEASE.
The output will be the data from the EUROPE member. Use this technique to access data
from multiple members.
JOB Job name Names the job that you are submitting. The
default is *JOBD.
JOBQ Job queue Names the job queue. The default is *JOBD.
11–13
Progress/400 Product Guide
JOBPTY Job priority on JOBQ Names the priority on the job queue. The
default is *JOBD.
OUTPTY Output priority on Names the priority for output files that the job
OUTQ creates. The default is *JOBD.
OUTQ Output queue Names the output queue for the job’s spooled
output. The default is *CURRENT.
PRTTXT Print text Identifies the text printed at the bottom of this
job’s printed output. The default is
*CURRENT.
RTGDTA Routing data Names the routing data that starts the first
routing step. The default is QCMDB.
RQSDTA Request data or Names the request data used as the last entry in
command the message queue. The default is *CMD.
SYSLIBL System library list Names the system library list that the job
should use. The default is *CURRENT.
CURLIB Current library Names the current library that the job should
use. The default is *CURRENT.
INLLIB Initial library list Names the initial library list that the job should
use. (This is the user portion of the library list.)
The default is *CURRENT.
LOG1 Message logging Names the values that the job uses to write
level messages to the job log. You can specify
severity message level, severity, and text. The default is
text *JOBD.
11–14
Progress 4GL Interfaces to OS/400 Languages and Objects
HOLD Hold on job queue Identifies whether the job is held when put on
the job queue. The default is *JOBD.
DATE Job date Names the date that the job is started. The
default is *JOBD.
SWS Job switches Names the job switches that the job uses. The
default is *JOBD.
MSGQ Message queue Names the message queue where messages are
written when the job completes (either
successfully or with errors). The default is
*USRPRF.
CCISD Coded character set ID Names the coded character set ID to use with
this job. The default is *CURRENT.
1
The field name in the QCMD file is msglog.
11–15
Progress/400 Product Guide
The Progress/400 Data Dictionary allows you to define and maintain procedures and their
parameters. Procedure definitions are stored in the P__FILE file, and parameter definitions are
stored in the P__FIELD file. When Progress synchronizes the schema holder, the schema image
maintains this information in the _file and _field files marked as type AS/400 Procedures. See
Chapter 9, “Remote Client DB2/400 Utilities,” for information about maintaining stored
procedures.
Table 11–5 lists information contained in a stored procedure.
Contents Description
AS/400 Program and Library Name The name of the AS/400 program object to
execute. This is limited to 10 characters.
11–16
Progress 4GL Interfaces to OS/400 Languages and Objects
You run stored procedures from within Progress procedures by using the 4GL RUN
STORED-PROC statement. The OS/400 procedure that you run with this statement can return
two types of values:
• Values of output parameters that you define when you create the procedures
If a stored procedure fails a run time, you will receive the error “Unable to Open File.” Press
ENTER and a dialog box appears with the specific AS/400 message that caused the stored
procedure to stop.
Stored procedures called from within Progress applications cannot return Dates or RECID data
types. Table 11–6 lists the supported data types.
Character Alpha (fixed length) Character data type in the schema holder.
A maximum of 32 parameters can be defined for each procedure. Each procedure must have a
unique name. Therefore, you cannot redefine a procedure with different sets of parameters
without duplicating the program in the listed library.
11–17
Progress/400 Product Guide
The Progress 4GL has statements and functions that allow you to use the return codes and values
of the output parameters. Table 11–7 lists these statements and functions.
The following sections describe how to run Progress/400 stored procedures and retrieve return
codes and output parameter values.
SYNTAX
SYNTAX
11–18
Progress 4GL Interfaces to OS/400 Languages and Objects
For example, the following Progress 4GL code runs a Progress/400 stored procedure pcust:
This code defines an integer variable that serves as a handle for identifying the stored procedure
and a variable to hold the procedure status return value. If you have only one active stored
procedure, you do not have to specify a handle. However, it is good programming practice to
use handles to identify all your stored procedures.
The stored procedure passes the values "SERVE" and 5.5 to the two parameters that have been
defined in the schema as input parameters. The Progress procedures uses the CLOSE
STORED-PROC statement to notify the client that the procedure is ended and that the
PROC-STATUS can be interrogated.
The stored procedure return codes provide information on its status. These codes indicate
whether the stored procedure succeeded. The above code evaluates the sts variable to
determine which block of code to execute.
You can close all stored procedures at once with the following statement:
11–19
Progress/400 Product Guide
Programming Restrictions
Table 11–8 lists restrictions when implementing Progress/400 Stored Procedures.
Data types for procedure parameters The list of data types applicable to stored
procedures is a subset of the database field
types. However, that subset differs based on
the language used to create the stored
procedure program. Therefore, Progress/400
uses the complete list of data types as
defined for database files.
11–20
Progress 4GL Interfaces to OS/400 Languages and Objects
A Progress 4GL program running on a client or natively on the AS/400 can access these objects
through a consistent set of 4GL APIs. A 4GL program that utilizes these APIs can be written
for an n-tier configuration, and it will also run on the AS/400 using the Progress/400 Native 4GL
Client.
• Change data in a data area using the Progress/400 CHANGE DATA AREA (chgdara.p)
API. Note that you can send only character data to a data area.
• Retrieve information from a data area using the Progress/400 RETRIEVE DATA AREA
(rtvdara.p) API. Note that you can retrieve only character data from a data area.
Using these APIs insulates your code from possible changes to the underlying method of
changing and retrieving data from data areas and provides a standard interface that does not
change. You use them in the same way regardless of whether your code is being run from the
remote client or from the native clients.
Progress/400 supports the change and retrieve operations by providing the QDTAARA table
definition in the Progress/400 schema. This table is similar to the QCMD table in that it controls
the function of Progress/400, but different in that data can be sent to and received from data
areas. More than one job can place data onto or receive data from a particular data area.
NOTE: Do not use the QDTAARA name as a physical filename: the SYNC function updates
the file on the client, making the data area APIs unusable.
Before you can place information into a data area, you must create the data area using the
OS/400 Create Data Area (CRTDTAARA) command. To display the data area, use the OS/400
Display Data Area (DSPDTAARA) command. For detailed information about OS/400 data area
access routines, see the IBM OS/400 Control Language Programmer’s Guide.
Progress displays error messages to the remote client session, with more detailed error
information available in the OS/400 job log (assuming that the server is started with logging),
or in the native client’s job log, as appropriate.
NOTE: Progress/400 does not support accessing the following two types of data areas:
*GDA (Group Data Area), *PDA (Pre-start Data Area).
11–21
Progress/400 Product Guide
area-name1 INPUT The name of the data area on the AS/400. This data
area must have been created before using the API.
CHARACTER
library-name INPUT The library name where the data area resides.
CHARACTER
data-value INPUT/OUTPUT The data to be placed into the data area. A data area
can support a character string as long as 2000
CHARACTER
characters, 1024 for *LDA.
11–22
Progress 4GL Interfaces to OS/400 Languages and Objects
The following example illustrates calling the CHANGE DATA AREA API from your code:
To verify that an entry has been changed, check the value of the OUTPUT parameter. Table
11–10 lists possible return values.
0 The entry has been placed in the data area. Remote and
native
-2 The named DB2/400 database does not contain the Remote only
QDTAARA table.
-5 The start position plus the data length minus 1 must be less Remote and
than or equal to 2000. native
11–23
Progress/400 Product Guide
area-name1 INPUT The name of the data area on the AS/400. This data
area must have been created before using the API.
CHARACTER
library-name INPUT The library name where the data area resides
CHARACTER
data-length INPUT The length of the data to be retrieved from the data
area.
INTEGER
data-value INPUT/OUTPUT The data to be retrieved from the data area. A data
area can support a character string as long as 2000
CHARACTER
characters, 1024 for *LDA.
11–24
Progress 4GL Interfaces to OS/400 Languages and Objects
The following example illustrates calling the RETRIEVE DATA AREA API from your code:
To verify that an entry has been retrieved, check the value of the OUTPUT parameter. Table
11–12 lists possible return values.
0 The entry has been retrieved from the data area. Remote and
native
-2 The named DB2/400 database does not contain the Remote only
QDTAARA table.
-5 The start position plus the data length minus 1 must be less Remote and
than or equal to 2000. native
11–25
Progress/400 Product Guide
END
11–26
Progress 4GL Interfaces to OS/400 Languages and Objects
• Change data in a user space, using the Progress/400 CHANGE USER SPACE
(chguspc.p) API.
• Retrieve information from a user space, using the Progress/400 RETRIEVE USER
SPACE (rtvuspc.p) API.
Using these APIs insulates your code from possible changes to the underlying method of
changing and retrieving data from user spaces and provides a standard interface that does not
change. You use them in the same way regardless of whether the code is being run from the
remote client or from the native clients.
Progress/400 supports the change and retrieve operations by providing the QUSRSPC table
definition in the Progress/400 schema. This table is similar to the QCMD table in that it controls
the function of the Progress/400 DataServer, but different in that information can be changed in
and retrieved from QUSRSPC.
NOTE: Do not use the QUSRSPC name as a physical file name: the SYNC function updates
the file on the client, making the user space APIs unusable.
Note that if you retrieve numeric data or pointers stored in the user space, you must use the
SUBSTRING function on the contents of the returned buffer in order to display the data. This
is because if Progress encounters a null within the returned numeric or pointer data, it interprets
this as the end of the buffer and no further information is displayed. For additional information
on using the SUBSTRING function, see the “Using the LOOKUP and SUBSTRING Functions
with Send Data” section.
Before you can place information into a user space, you must create the user space using the
OS/400 Create User Space (QUSCRTUS) command. For detailed information about OS/400
user space access routines, see the IBM OS/400 System API Reference.
Progress displays error messages in the Progress client session, and more detailed information
might be available in the OS/400 job log.
11–27
Progress/400 Product Guide
uspc-name INPUT The name of the user space on the AS/400. This
user space must have been created before using the
CHARACTER API.
library-name INPUT The library name where the user space resides.
CHARACTER
data-value INPUT/OUTPUT The data to be placed into the user space. A user
space can support up to 16 megabytes of
CHARACTER
information; however, this utility allows you to
access only 2048 bytes at one time.
11–28
Progress 4GL Interfaces to OS/400 Languages and Objects
The following example illustrates calling the CHANGE USER SPACE API from your code:
To verify that an entry has been changed, check the value of the OUTPUT parameter. Table
11–14 lists possible return values.
# The length of the data entry. This number is either 0, which Remote and
means the entry was not changed, or the length of the data. native
-2 The named DB2/400 database does not contain the Remote only
QUSRSPC table.
11–29
Progress/400 Product Guide
uspc-name INPUT The name of the user space on the AS/400. This
user space must have been created before using the
CHARACTER API.
library-name INPUT The library name where the user space resides.
CHARACTER
11–30
Progress 4GL Interfaces to OS/400 Languages and Objects
The following example illustrates calling the RETRIEVE USER SPACE API from your code:
To verify that an entry has been retrieved, check the value of the OUTPUT parameter. Table
11–16 lists possible return values.
# The length of the data entry. This number is either 0, which Remote and
means the entry was not changed, or the length of the data. native
-2 The named DB2/400 database does not contain the Remote only
QUSRSPC table.
11–31
Progress/400 Product Guide
• Create a record and send it to a data queue, using the Progress/400 SEND DATA QUEUE
(snddtaqe.p) API.
• Find and receive a record from the data queue, using the Progress/400 RECEIVE DATA
QUEUE (rcvdtaqe.p) API.
11–32
Progress 4GL Interfaces to OS/400 Languages and Objects
Using these APIs insulates your code from possible changes to the underlying method of
sending and receiving data from data queues and provides a standard interface that will not
change. You use them in the same way regardless of whether the code runs from the remote
client or from the native clients.
Progress/400 supports the send (create) and receive (find) operations by providing the
QDTAQ-ENTRY table definition in the Progress/400 schema. This table is similar to the
QCMD table in that it controls the function of the Progress/400 DataServer, but different in that
data can be sent to and received from data queues. More than one job can place data onto or
receive data from a particular data queue.
NOTE: Do not use the QDTAQ-ENTRY name as a physical file name because the SYNC
function updates the file on the client, making the data queue APIs unusable.
Before you can place a record onto a data queue, you must create the data queue using the
OS/400 Create Data Queue (CRTDTAQ) command. For detailed information about OS/400
data queue access routines, see the IBM OS/400 Control Language Programmer’s Guide and
the System API Reference.
The DataServer displays appropriate error messages to the remote client session, with more
detailed error information available in the OS/400 job log (assuming that the server is started
with logging), or to the native client’s job log, as appropriate.
que-name INPUT The name of the data queue on the AS/400. This
data queue must have been created before using the
CHARACTER API.
11–33
Progress/400 Product Guide
library-name INPUT The library name where the data queue resides.
CHARACTER
key-data INPUT If the data queue was created to use a key, the data
for the key.
CHARACTER
If the data queue is not keyed, assign this parameter
to blank.
key-length INPUT If the data queue was created to use a key, the
length of the key specified when the data queue
INTEGER
was created.
If the data queue is not keyed, assign 0 to the
parameter.
The following example illustrates calling the SEND DATA QUEUE API from your code:
The OUTPUT parameter can be checked to verify that the entry has been placed on the queue.
11–34
Progress 4GL Interfaces to OS/400 Languages and Objects
To verify that an entry has been changed, check the value of the OUTPUT parameter. Table
11–18 lists possible return values.
0 The entry has been placed onto the data queue. Remote and
native
-2 The named DB2/400 database does not contain the Remote only
QDTAQ-ENTRY table.
-4 An error occurred and an entry was not placed on the data Remote and
queue. native
The entry-list variable contains a list of values known to be in the first position, but this syntax
fails. If you reassign the send-data variable to another CHARACTER variable within the same
procedure as the LOOKUP function, the syntax works correctly.
If you use the SUBSTRING function without doing a LOOKUP, as shown in the following
syntax, the SUBSTRING function works correctly:
11–35
Progress/400 Product Guide
que-name INPUT The name of the data queue on the AS/400. This
data queue must have been created before using the
CHARACTER API.
library-name INPUT The library name where the data queue resides.
CHARACTER
key-data INPUT If the data queue was created to use a key, the data
for the key.
CHARACTER
If the data queue is not keyed, assign this parameter
to blank.
key-length INPUT If the data queue was created to use a key, the
length of the key specified when the data queue
INTEGER was created.
If the data queue is not keyed, assign 0 to this
parameter.
key-order INPUT The operand for the key data. The parameter can
contain one of the following values: EQ, GE, GT,
CHARACTER LE, LT, NE, =, >=, <, <=, <, <>.
If the data queue is not keyed, assign blanks to this
parameter.
11–36
Progress 4GL Interfaces to OS/400 Languages and Objects
sender-Data INPUT/OUTPUT Notifies the API whether the sender data is wanted
and should be returned. Assign Y to the variable if
CHARACTER
you want data and N or blank if you do not.
The maximum length available is 64 bytes but the
maximum length returned is 56: the first eight bytes
are not valid to
Progress and are removed before being returned.
See the IBM System API Reference for an
explanation of the first eight bytes.
entry-data OUTPUT The entry removed from the data queue. You must
know what the data will contain in order to process
CHARACTER
it with the SUBSTRING function for use in your
procedure. Be careful about having the hex
character zero in the data:
Progress interprets the hex character zero as a
NULL and the end of the data.
For additional information on using the
SUBSTRING function, see the “Using the
LOOKUP and SUBSTRING Functions with Send
Data” section.
The following example illustrates calling the RECEIVE DATA QUEUE API from your code:
11–37
Progress/400 Product Guide
To verify that an entry has been received, check the value of the OUTPUT parameter. Table
11–20 lists possible return values.
-2 The named DB2/400 database does not contain the Remote only
QDTAQ-ENTRY table.
-3 The operand in the key-order parameter did not contain a Remote and
correct value. native
# The length of the data entry. This number can be any value Remote and
from 0, which means that no entry was returned, to the native
length of the data.
11–38
Progress 4GL Interfaces to OS/400 Languages and Objects
The first example sends and receives an entry from an unkeyed data queue:
11–39
Progress/400 Product Guide
This example sends and receives an entry from a keyed data queue. This data queue was created
with a key length of 10 and a request for sender information:
11–40
A
Tutorials for Managing Your Dictionary
Library
This appendix documents how to use the current version of Progress/400 to manage your
Dictionary Library. Specifically, this appendix addresses:
• Creating a database that accesses existing DB2/400 data files; for example, that used by
RPG programs
Each set of instructions also includes creating the required server schema.
Note that you can create a database that contains both new and existing data files. In this case,
follow the steps for creating a database that uses existing data files and then go to the
“Modifying DB2/400 Data Definitions with Progress/400” section.
1 ♦ Create a new, empty server schema on the AS/400 by running the DUPPRODB utility.
Table A–1 notes the required DUPPRODB parameter values; additional parameters are
optional.
Parameter Option
OBJLIB(library name) Enter the library where data files defined with the
Progress/400 Data Dictionary will be located. The
default is *NEWDB, which puts the data files in the same
library as the server schema. To put the data files in a
separate library from the server schema, enter a library
name.
See Chapter 10, “AS/400 Utilities,” for more information on the DUPPRODB utility.
A–2
Tutorials for Managing Your Dictionary Library
2 ♦ Create a client schema holder for the server schema. For more information on client
utilities, see Chapter 9, “Remote Client DB2/400 Utilities.”
3 ♦ Define your database using either the Progress/400 Data Dictionary on the client machine
or an AS/400 tool such as DDS. See the “Modifying DB2/400 Data Definitions with
Progress/400” section for more information.
1 ♦ Create an empty server schema on the AS/400 by running the DUPPRODB utility. Table
A–2 notes the required DUPPRODB parameter values; additional parameters are optional.
Parameter Option
OBJLIB(library name) Enter the library where data files defined with the
Progress/400 Data Dictionary will be located. The
default is *NEWDB, which puts the data files in the same
library as the server schema. To put the data files in a
separate library from the server schema, enter a library
name.
See Chapter 10, “AS/400 Utilities,” for more information on the DUPPRODB utility.
A–3
Progress/400 Product Guide
2 ♦ Add the existing data files to the Progress/400 server schema by running the Progress/400
CHGPRODCT utility. Table A–3 notes CHGPRODCT parameter values to use.
Parameter Option
PRODCT(library name) Enter a library name where the server schema is located
or *CURLIB.
FRMFILLST Enter a list of the data PFs that you want to access, or
enter *ALL to access all files in a specific library. The
utility automatically picks up the related logical files
based on the Include Database Relations in this table.
From Library(s) Enter a specific library name or enter *LIBL if the data
files are in multiple libraries.
Include Database Enter *YES, the default, to preserve the logical file
Relations dependencies.
• If you enter a specific library name for the From Library(s) parameter and want to
add files from other libraries to the server schema, run CHGPRODCT again for each
additional library.
3 ♦ Create a client schema holder for the server schema. See Chapter 9, “Remote Client
DB2/400 Utilities,” for more information on client utilities.
A–4
Tutorials for Managing Your Dictionary Library
Note that the new copy of your database might include data files in one or more libraries,
regardless of the original structure.
The following sections document two options for creating a copy of a schema and data:
• Copying all data files and server schema to a single OS/400 library
• Creating a copy of a database with an ALTLIB structure, where data files reside in one or
more alternate libraries
A–5
Progress/400 Product Guide
1 ♦ Run the DUPPRODB utility to copy the server schema and data files to the new library.
Table A–4 notes DUPPRODB parameter values to use.
Parameter Option
FRMDB(old library name) Enter the library name containing the existing server
schema.
COPYOPT(copy selection) Enter *FULLCOPY to copy data files with data, or enter
*EMPTYCOPY to copy data files with no data. Either
option creates all copies in the server schema library,
regardless of where the original copies are located.
2 ♦ Create a client schema holder for the server schema. See Chapter 9, “Remote Client
DB2/400 Utilities,” for more information on client utilities.
A–6
Tutorials for Managing Your Dictionary Library
1 ♦ Run the appropriate OS/400 commands to copy data files from the original library (where
the data files are) to the library that will contain the copies.
3 ♦ Run the DUPPRODB utility to create an empty server schema. Table A–5 notes
DUPPRODB parameter values to use.
Parameter Option
A–7
Progress/400 Product Guide
4 ♦ Run the CHGPRODCT utility for each library created in Step 1. Table A–6 notes
CHGPRODCT parameter values to use.
Parameter Option
PRODCT(library name) Enter a library name where the server schema is located
or enter *CURLIB.
FRMFILLST Enter a list of the data PFs that you want to access, or
enter *ALL to access all files in a specific library. The
utility automatically picks up the related logical files
based on the Include Database Relations in this table.
From Library(s) Enter a specific library name or enter *LIBL if the data
files are in multiple libraries.
Include Database Relations Enter *YES, the default, to preserve the logical file
dependencies.
NOTE: If you run CHGPRODCT against data files that were created using Progress or
that contain Progress-specific properties, you must specify the RTNPROATR
parameter to retain these properties.
5 ♦ Create a client schema holder for the server schema. See Chapter 9, “Remote Client
DB2/400 Utilities,” for more information on client utilities.
A–8
Tutorials for Managing Your Dictionary Library
Both methods update the server schema and the client schema holder. Generally, the
modifications you make are interchangeable between tools. If you use an AS/400 tool to modify
data definitions and then run CHGPRODCT to change data files that were originally created
with Progress, you can use the RTNPROATR parameter to retain a large set of data file
properties. However, if you use the Progress/400 Data Dictionary to modify data-files originally
created using an AS/400 tool, non-Progress properties (for example, SELECT/OMIT criteria)
are removed.
• When you use the Progress/400 Data Dictionary in Modify Schema mode, journaling on
the server schema objects (P__*) starts automatically using the journal PRODBAJRN.
This allows you to roll back server schema changes before they are committed.
• Do not journal server schema objects to another journal. Also, you cannot move
PRODBAJRN to another library.
• The user profile that you use to connect to the DB2/400 database must have *ALLOBJ
authority to make database modifications using the Progress/400 Data Dictionary. IBM’s
API for Progress/400 requires this authority and cannot be changed by Progress/400.
• Do not change the object authority or location of any objects Progress/400 creates in the
server schema library.
Follow these steps to modify data definitions using the Progress/400 Data Dictionary:
1 ♦ Make sure that all users disconnect from the database. The database locks until changes
are either rolled back or committed.
A–9
Progress/400 Product Guide
3 ♦ From the client machine, connect the client schema holder and its DB2/400 database.
4 ♦ Enter your schema changes using the Progress/400 Data Dictionary’s Modify Schema
mode. For more information on how to modify, add, and delete tables, fields, and indexes,
see Chapter 9, “Remote Client DB2/400 Utilities.”
NOTE: If you add or modify triggers that reference tables, fields, or indexes that are not
committed and synchronized, you get an error message when you attempt to
compile the code. This occurs when you activate the Check Syntax or Check
CRC toggle box. You can save the trigger code, but you must commit
transactions and synchronize the client before the code will compile successfully.
5 ♦ If you want to commit your transaction, run Edit→ Commit Transaction to update the
modifications in the server schema.
NOTE: The commit process does the following on the AS/400: starts a job named
APYPRODCT, creates a DDS for the new or modified table, and saves and
restores data to modified tables. If anything fails during the commit process, the
server schema is automatically restored to its previous state.
If you make a mistake or want to undo your changes, run Edit→ Undo Transaction.
7 ♦ From the Data Administration menu, run Synchronize Progress/400 Client to update the
client schema holder.
A–10
Tutorials for Managing Your Dictionary Library
1 ♦ Run CHGPRODCT to update the server schema. Table A–7 notes CHGPRODCT
parameter values to use.
Parameter Option
PRODCT(library name) Enter the library name where the server schema is
located or enter *CURLIB.
FRMFILLST Enter a list of the data physical files you have added,
modified, or deleted. Enter *ALL to update definitions
for all files in a specific library. This utility
automatically picks up the related logical files if you set
the Include Database Relations parameter to *YES.
From library(s) Enter a specific library name or enter *LIBL if the data
files are in multiple libraries.
Include Database Relations Enter *YES, the default, to preserve the logical file
dependencies.
• If you enter a specific library name for the From Library(s) parameter and want to
update definitions for data files in other libraries, run CHGPRODCT again for each
additional library.
2 ♦ Create a new client schema holder or synchronize an existing one for the server schema.
See Chapter 9, “Remote Client DB2/400 Utilities,” for more information on client utilities.
A–11
Progress/400 Product Guide
A–12
B
Legacy Support and the Progress Unknown
Value
• Converting your data definitions from legacy unknown values to SQL NULL values
• How Progress/400 handles SQL NULL and legacy unknown values in a query
• When the user assigns the question mark (?) to a field, the Progress client assigns a value
to the DB2/400 field based on the data type of the field. Table B–1 describes the
implementation of the unknown value for each data type.
• When a Progress application retrieves a field that contains an unknown value, it returns
the standard Progress unknown value (?).
DATE The AS/400 date data type. See Table B–2 for the unknown values
for the various date formats.
Unlike a standard Progress database, DB2/400 allows only one record with the legacy unknown
value in the index field when the index is defined as a unique index.
B–2
Legacy Support and the Progress Unknown Value
When you load Progress DATE data that contains the unknown value (?) into OS/400 physical
files, the DataServer inserts values based on the DB2/400 date format for the field. Table B–2
lists the values that the DataServer inserts.
Table B–2: Legacy Unknown Value Defaults for DB2/400 Date Formats
*EUR 31.12.9999
*ISO 9999-12-31
*JIS 9999-12-31
*USA 12/31/9999
*DMY 31/12/99
*MDY 12/31/99
*YMD 99/12/31
*JUL 99/365
1 ♦ On your Windows client, dump both your data definitions (.df) and data (.d).
B–3
Progress/400 Product Guide
3 ♦ On your Windows client, reload the data definitions (.df) with the Progress/400 Data
Dictionary, accepting the default to allow fields to be null capable.
NOTE: This operation creates all data files and fields as SQL NULL enabled.
4 ♦ On your Windows client, reload the data (.d) once the data definitions are loaded.
NOTE: Fields that contain the unknown value are stored as SQL NULL fields in the data
files.
B.4 Using the Windows Client to Manage SQL NULL Value Assignments
If you use the Progress/400 Data Dictionary to maintain your DB2/400 files, two options that
affect the outcome of legacy unknown value assignments or SQL NULL assignments are
available to you.
Follow these steps to set these two values with the Progress/400 Data Dictionary:
1 ♦ Choose the Field mode button in the Progress/400 Data Dictionary main window.
3 ♦ Select the table that will contain the new field from the Tables list.
4 ♦ Choose the Create Field button. The following dialog box appears:
B–4
Legacy Support and the Progress Unknown Value
You can select the Mandatory or the Null Capable option setting. Table B–3 displays
possible settings for these two values. Table B–3 also describes which assignments are
allowed based on these option settings.
Table B–3: Progress/400 Data Dictionary Options for SQL NULL and
Unknown Value Assignments
B.5 How Progress/400 Handles SQL NULL and Legacy Unknown Value
Support
Progress queries and SQL queries on the AS/400 can return different values. As a comparison,
Table B–4 shows the return values for queries based on your DUPPRODB and NULL capable
selections.
Table B–4: SQL and 4GL Query Results with NULL Capable and
ALWPROUNK Settings
Progress/400 Data
Dictionary NULL
Capable SQL Query Result 4GL Query Result
B–5
Progress/400 Product Guide
B–6
C
Useful OS/400 Commands
This appendix documents a number of OS/400 CL commands that you might find useful when
working with the Progress/400 DataServer.
Progress/400 Product Guide
Command Usage
WRKSPLF Works with spooled print files associated with the user.
For more information on any of these parameters, see your IBM AS/400 documentation.
C–2
Glossary
Absolute Path
Used with the IFS file system, absolute paths include the complete path to an object.
Absolute paths always begin with a slash (/).
AdminServer
A process that manages the AppServer and DataServer products.
Advanced Program-to-Program Communications (APPC)
The communications support that allows AS/400 applications to communicate with other
programs over a network.
Application Service
An arbitrary designation for the business function that the Unified Broker instance
provides.
AppServer
A client of the Unified Broker product that includes 4GL clients and Open Clients.
Array
A field or variable with multiple elements. Each element in an array has the same data
type. The Progress/400 DataServer supports arrays by using a set of similar fields that all
have the same type and same length.
Authority List
An AS/400 object that lists the users or groups that have access to objects, and the type of
access those users have.
Auto-connect
A Progress feature that uses information stored in a schema holder to connect to the
database it describes when that database is referenced in a compiled application at run
time.
Progress/400 Product Guide
Buffer
A piece of memory used as a temporary storage area for data during input or output
operations. See also Data Buffer.
Code Page
Contains the numeric codes assigned to the various characters when they are stored in
databases.
Collation
Specifies the order in which characters are sorted for indexes, queries, and so forth; that
is, the collation sequence. A collation table contains this sort-order information.
Commitment Control
A method of grouping file operations so that a group of changes is either implemented
(through the COMMIT command) or removed (through the ROLLBACK command) as a
single unit. Commitment control provides journal entries with transaction boundaries.
Connection Parameters
Variables or constants used to control how Progress connects to a database.
Data Buffer
Progress uses two types of data buffers: the record buffer, which is a temporary storage
area for a record, field, or variable; and the screen buffer, which is a display area for a field,
variable, or the result of a calculation.
Data Definitions
The characteristics of the files, fields, and indexes that comprise the schema of a Progress
database. The structure of a given database. See also Data Dictionary.
Data Description Specifications (DDS)
An AS/400 tool used to define files.
Data Dictionary
The Progress/400 Data Dictionary tool that allows you to maintain data definitions on the
AS/400.
Data Type
A property of a field or variable that determines the nature of data that can be stored and
manipulated (integers or characters, for example).
Database Administrator (DBA)
The individual responsible for maintaining a database management system.
Glossary–2
Glossary
Glossary–3
Progress/400 Product Guide
File
A collection of logically related records treated as a unit. A file can contain a program,
data, or text. For example, a payroll file is a collection of employee payroll records.
Host Language Interface (HLI)
A Progress product for embedding SQL statements into host language applications and
retrieving or updating records from Progress and non-Progress databases.
Index
A directory or table that contains the fields identifying the records in a file and the
locations where the records are stored.
Integer Data Type
A property of a field or variable that allows the storage of integers. In Progress, an integer
can be a positive or negative whole number, within the range of -2,147,483,648 through
2,147,483,647.
Integer Field
A field that has an integer data type. In Progress, an integer field can contain positive or
negative whole numbers, ranging in value from -2,147,483,648 through 2,147,483,647.
Integrated File System (IFS)
An umbrella file system on the AS/400 that can access all other file systems. You must use
IFS to access the ROOT file system.
Job
User work on the AS/400. It can be interactive or batch. Each job has its own name and
characteristics.
Job Attributes
Define how jobs execute on the AS/400.
Journal
An AS/400 object (*JRN) made up of journal entries.
Journal Entries
Records the DB2/400 database writes when you change database records.
Journaling
Recording changes made to files. Used to reconstruct a file by applying the journaled
changes to a saved version of the file.
Glossary–4
Glossary
Journal Receiver
An AS/400 object (*JRNRCV) that holds a journal.
Library
An AS/400 object (*LIB). It is the AS/400 unit of organization.
Library List
An AS/400 object (*LIBL). It is used as a search path for objects on the system.
Locks
A restriction on data access so that updates can be performed without compromising data
integrity.
Logical Data Type
One of two values consisting of yes/no, true/false, or logical value pairs.
Logical Database Name
The name used to refer to a database in Progress code. The logical database name is stored
in a procedure’s object code. Usually, this identifies a database with an identical name, but
another name can be specified when connecting to the database. When a procedure
executes, its database name references must match the logical names of connected
databases.
Logical Field
A field that has a logical data type. A logical field can contain one of two values.
Logical File
An AS/400 object type (*FILE(sub-type LF)) that contains an alternate view of data. The
Progress/400 DataServer uses logical files to implement secondary indexes.
Logical Unit (LU)
A logical device for accessing the communications network.
Name Server
A Name Server is a single process that mediates client connections for a set of Unified
Brokers that have registered with it.
Native 4GL Client
A product local to the AS/400 that runs Progress applications. The Native 4GL Client does
not have interactive capabilities. All output must be redirected to a file or printer.
Glossary–5
Progress/400 Product Guide
Network Address
The way each physical and logical unit is identified to the network and other objects on
the network.
N-tier
A computing model that supports a flexible networking structure. You can physically
distribute application logic and processing loads among many machines across a
distributed network. Also, the n-tier model supports the logical separation of user
interface, application logic, and data across three or more machines.
Object
The AS/400 operating system (OS/400) identifies anything that exists and occupies spaces
in storage as an object.
Object Authority
The permission to access an object.
Parameter
A variable or constant passed to or from a subroutine and the main program. Also referred
to as a Progress startup parameter.
Parameter File
A file containing Progress startup parameters. Parameter files store the appropriate startup
(connect) parameters for a particular database, group of users, or system configuration,
rather than supplying startup or CONNECT options explicitly on the Progress command
line or in a CONNECT statement.
Partner Logical Unit (PLU)
The secondary LU you communicate with over the SNA network during an LU-to-LU
communication session. The primary LU is your own LU.
Physical Database Name
The actual name of a database.
Physical File
An AS/400 object type (*FILE(sub-type)) that contains data or source code.
Physical Unit (PU)
The physical devices that connect network users.
Glossary–6
Glossary
Glossary–7
Progress/400 Product Guide
Unknown Value
A special Progress data value (represented by a question mark (?)) that indicates that the
field or variable data is unknown or unavailable.
Glossary–8
Glossary
User ID
User identification.
User Profile
Identifies you to the AS/400 system. It includes such information as what objects you can
access and how the system handles jobs you submit.
Validation Expression
A test to validate data before storing it in a field.
Glossary–9
Progress/400 Product Guide
Glossary–10
Index
Applications
After-image file 8–6
running on the AS/400 1–10
Aliases 5–6 security 1–11, 2–27
Index–2
Index
Index–3
Progress/400 Product Guide
Index–4
Index
Index–5
Progress/400 Product Guide
Index–6
Index
Index–7
Progress/400 Product Guide
Index–8
Index
JOB parameter of SBMJOB command Load Sequences Current Values utility 9–33
11–13 Load Table Contents utility 9–32
Index–9
Progress/400 Product Guide
Index–10
Index
Index–11
Progress/400 Product Guide
Parameters Progress
See also Connection parameters, Startup data types, mapping
parameters to DB2/400 2–11
chgdara.p API 11–22 to OS/400 11–5
chguspc.p API 11–28 database objects 2–2
rcvdtaqe.p API 11–36 locks 2–18
rtvdara.p API 11–24 migrating databases to the AS/400 1–9
rtvuspc.p API 11–30 naming conventions 2–3
SBMJOB command 11–13 retaining attributes 8–28
snddtaqe.p API 11–33 running applications on the AS/400 1–10
setting up collation for databases 8–13
Password (-P) connection parameter 4–14,
8–3 Progress 4GL
ALTER TABLE statement 2–25
Password, defining at startup 2–28 CREATE INDEX statement 2–25
CREATE TABLE statement 2–25
P-code 5–10, 5–11 CREATE VIEW statement 2–25
DBNAME function 2–25
Performance tuning 8–21
DROP INDEX statement 2–25
network traffic 8–22
DROP TABLE statement 2–25
queries 8–21
DROP VIEW statement 2–25
Physical Database Name (-db) connection executing code from clients 5–6
parameter 4–8 GRANT statement 2–25
PROCALL program 6–4
Physical files 2–5 RECID function 2–26
building logical files over multiple restrictions on use 2–25
members 2–6 REVOKE statement 2–27
ROWID function 2–26
Prefetch 8–22 SETUSERID function 2–27
USERID function 2–27
Primary index 2–4 word-index coding issues 2–34
PROCALL program 6–4 Progress client
parameters 6–5 code pages 8–11
internal code page 8–11
PROCESS-DFT-DDS-KEYWORD setting local before-imaging 8–4
8–25 synchronizing 9–33
PRODEMO demonstration database 1–8 Progress database
using as schema holder 3–13
Production environments, creating 8–31
Progress database, using as schema holder
Profile Name (-H) connection parameter 3–5
4–12
Index–12
Index
Index–13
Progress/400 Product Guide
Index–14
Index
Index–15
Progress/400 Product Guide
Startup parameters T
clients 5–12
Message Buffer Size (-Mm) 4–18, 8–22 Table properties 9–7, 9–9, 9–10, 9–11,
Stopping TCP/IP brokers 4–5 9–15, 9–16, 9–17, 9–18
Tables
Stored procedures 11–15
adding 9–7
adding 9–19
deleting 9–9
adding a parameter 9–21
argument data types 11–17 freezing and unfreezing 9–35
modifying 9–8
contents of 11–16
virtual 2–5
deleting 9–21
deleting a parameter 9–24 TCP/IP brokers 4–3
modifying 9–20 managing 4–5
modifying a parameter 9–23
output parameter values 11–19 TCP/IP protocol 4–16, 4–17
programming restrictions 11–20 overview 4–3
return codes 11–18 running 4–4
running 11–18
Test environments
Stream files, defined 5–2 creating 8–31
STRJRNPF command 8–7, 8–8 Time data type 2–11
STRPROCLI utility 5–12, 10–35 Timestamp data type 2–11
parameters 10–35
Transaction control 8–4
STRPRONET utility 10–32 See also Commitment control
parameters 10–32 and word indexes 2–31
client-based 8–5
STRWISPRC utility 10–27
connection parameter 4–9, 8–5
parameters 10–28
Transactions
SWS parameter of SBMJOB command
committing 2–16
11–15 locking records 2–16
Synchronize Progress/400 Client utility 9–3 TRANSCTL argument to -Dsrv parameter
4–9, 8–5
Synchronizing
client 9–33 Transferring p-code to the AS/400 5–10
client schema holder 9–7
schema holder 9–3 Triggers, database 2–5
and word indexes 2–31
SYNSCHIMG utility 10–25
Troubleshooting database connections 4–19
Syntax notation xxi
Tuning DataServer performance 8–21
SYSLIBL parameter of SBMJOB command See also Performance tuning
11–14
Tuning queries 2–22
System administration 8–1
Index–16
Index
Index–17
Progress/400 Product Guide
Index–18