Progress/400
Product Guide
Code Page Overview
Before you use the Progress/400 code page and collation functionality, make sure that you understand the difference between code pages and collation tables:
- 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:
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.
Identifying Code Pages
To ensure compatibility of operation between environments, you might need to manage as many as nine code pages. These code pages can reside either on the AS/400 server machine or on the client machine, and can include code pages for the client and server operating systems, Progress products, and data files.
The example in Figure 8–1 illustrates the relationships among the code pages. It is based on an environment in which the AS/400 is configured for Spanish using code page IBM284.
Figure 8–1: Server and Client Code Page Relationships
![]()
The following code pages reside on the AS/400 server machine:
- 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:
- Progress/400 DataServer 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 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 .
The following code pages reside on the Windows client machine:
- 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):
- 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:
- 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:
Alternate Collating Sequence (ALTSEQ) Tables
Alternate collating sequence (ALTSEQ) tables are the AS/400 equivalent of Progress collation tables. ALTSEQ tables define the order used to store indexes and specify how to do data sorting in general. They are important not only because they make it possible to accommodate language differences, but because they handle the two main differences between Progress databases and DB2/400 databases: case sensitivity and EBCDIC/ASCII collation. A common test to confirm whether collation is properly set up is to use a Progress 4GL query to retrieve the same set of records from a Progress database and a DB2/400 database; the test should return the same result for both databases. This is especially important when working with languages other than English, specifically those that include special characters or letters (for example, á).
You define collation differently for Progress clients than you do on the AS/400:
- 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.
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.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |