-
QCASE256
Hallo Thierry,
hier das komplette Dokument aus meiner Datenbank:
Simple way to retrieve mixed-case data
John Kohan
07 Nov 2001, Rating 4.17 (out of 5)
Last month I spoke on translating text, and one of the examples I used was a lowercase to uppercase translation within your RPG program.
This month I would like to address another way to deal with mixed-case text by retrieving the key field and ignoring the case it is currently in.
Say we have a physical file that contains a name and address and we want to store the name in mixed case. Now, when the user selects the name he wants, the system needs to retrieve the requested record ignoring the case.
An example of this would be storing the last name of a person like "Smith" but retrieving the record by using "SMITH".
This can be accomplished by placing an alternate sequence in the DDS of a logical file or a physical file. This is a file-level keyword. Below is how you would define the DDS.
|...+....1....+....2....+....3....+....4....+....5 ....+....6....+....7....+....8
00010A ALTSEQ(QSYSTRNTBL)
00020A R RCUST PFILE(CUST)
00030A LASTNAME
00040A FIRSTNAME
00050A ADDRESS
00060A CITY
00070A K LASTNAME
00080A K FIRSTNAME
By setting an ALTSEQ, the view of this data will translate the text from lower to upper, so the case is basically ignored. The sort of the sequenced view would place the "SMITH" and "Smith" next to each other. This works very well for report and subfile displays.
When setting up a table, each 2-byte position in the table corresponds to a character. To change the order in which a character is sorted, change its 2-digit value to the same value as the character it should be sorted equal to. IBM has provided QCASE256 table in library QUSRSYS for you. This will do the lowercase to uppercase translation.
This technique is a simple and easy way to translate text without placing additional lines of code within your program. The simpler the code, the easier it is to maintain later.
Gruss TARASIK
Similar Threads
-
By Spoldo in forum NEWSboard Programmierung
Antworten: 4
Letzter Beitrag: 18-07-05, 12:59
-
By olafu in forum NEWSboard Programmierung
Antworten: 2
Letzter Beitrag: 26-04-05, 08:57
-
By Jenne in forum NEWSboard Programmierung
Antworten: 5
Letzter Beitrag: 29-07-04, 08:43
-
By Jenne in forum NEWSboard Programmierung
Antworten: 6
Letzter Beitrag: 07-06-04, 12:19
-
By programmer in forum NEWSboard Programmierung
Antworten: 7
Letzter Beitrag: 01-06-04, 11:55
Berechtigungen
- Neue Themen erstellen: Nein
- Themen beantworten: Nein
- You may not post attachments
- You may not edit your posts
-
Foren-Regeln
|
Erweiterte Foren Suche
Google Foren Suche
Forum & Artikel Update eMail
AS/400 / IBM i
Server Expert Gruppen
Unternehmens IT
|
Kategorien online Artikel
- Big Data, Analytics, BI, MIS
- Cloud, Social Media, Devices
- DMS, Archivierung, Druck
- ERP + Add-ons, Business Software
- Hochverfügbarkeit
- Human Resources, Personal
- IBM Announcements
- IT-Karikaturen
- Leitartikel
- Load`n`go
- Messen, Veranstaltungen
- NEWSolutions Dossiers
- Programmierung
- Security
- Software Development + Change Mgmt.
- Solutions & Provider
- Speicher – Storage
- Strategische Berichte
- Systemmanagement
- Tools, Hot-Tips
Auf dem Laufenden bleiben
|
Bookmarks