View Full Version : ALTSEQ and upper/lower case
Guest.Visitor
01-01-1995, 02:00 AM
I have a master file with employee number and name (and other fields). It is keyed by employee number. I also have a logical file keyed by employee name to allow a query panel to display employees in alphabetical order. However, I also have names entered in mixed case (ie Casey) and upper case. This means "CASEY" shows up after "Chester". I want them to appear in alphabetical order regardless of upper or lower case. I've been looking into the ALTSEQ option and have created a table that maps the lower-case alphabet to upper-case. My query program is still reading them in the original order. I've also tried the TRNTBL option and that does work except that all the names come out in upper-case. Any ideas?? Thanks in advance!
Guest.Visitor
10-21-1999, 08:56 AM
Richard, You should be able to specify ALTSEQ(QCASE256) in a LF before the record format name and be done with it. QCASE256 is a system supplied table for converting lower case to upper case for sequencing. ALTSEQ only effects key fields, by the way. Chris <hr> <pre> A ALTSEQ(QCASE256) A R EMPREC PFILE(EMPFILE) A K EMPNAME A K EMPNUM </pre>
Guest.Visitor
10-21-1999, 09:10 AM
Thanks Chris! That worked great. Turns out my own table would have worked too. I just had another copy of the logical file (without the ALTSEQ) higher in the library list! Duh!!! Thanks again! Richard
Guest.Visitor
10-21-1999, 10:41 AM
I'm not in a position right now to verify the following, so please forgive me if there are some variations with reality. Within Query/400 there is a screen that allows you to specify the sort sequence. The default is the system value, which is usually HEX. Without looking at the screen in particular I believe there is an "ENGLISH" option. This should treat upper and lower case the same. Dave
J.Pluta
10-23-1999, 12:49 PM
You can do this without an ALTSEQ at all. Use the following keyword on your CRTLF: SRTSEQ(*LANGIDSHR) This sorts lower and upper case letters together. It also takes care of things like Ñ and N. You may want to play with it a little, because certain side effects might be unexpected... if I remember correctly, dashes and blanks sort the same, meaning "Next day" and "NEXT-DAY" will sort together. www.java400.net (//www.java400.net?phpMyAdmin=MzvdqLOMiN7HL4yz2OU82BJ vkG9), where the AS/400 speaks Java with an RPG accent Home of <a > href="//www.zappie.net/java/techniques/pbd.htm">PBD1.2P</a>, the <font > color=red>FREE</font> Java/400 Client/Server Toolkit
Guest.Visitor
10-24-1999, 06:50 PM
Joe, It also takes care of things like Ñ and N. Translation table QCASE256 handles this as well. Chris
J.Pluta
10-24-1999, 11:44 PM
At that point, it's just a matter of whether you want your sequence information in your source or in your compile command. As a matter of documentation, I'd probably go with your method, Chris. As a matter of expedience on an existing system, I like the compile method, but only as a temporary measure.
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.