Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!psuvax1!psuvm!NIHCU!HIS From: HIS@NIHCU.BITNET (Howard Schreier) Newsgroups: bit.listserv.sas-l Subject: re: Internal collating sequences and character comparisons. Message-ID: Date: 2 Feb 90 15:29:52 GMT Sender: "SAS(r) Discussion" Reply-To: Howard Schreier Lines: 43 Approved: NETNEWS@PSUVM Gateway > From: Philip Gallagher > > > > "... the smallest to largest comparison sequence for > > EBCDIC is a to z < A to Z < 0 to 9 and for > > ASCII is 0 to 9 < A to Z < a to z . " > > Since one of my students correctly pointed out my ignorance last > semester, I would like to tell you that the EBCDIC collating sequence > contains what I choose to consider an oddity that makes me want to say > "That EBCDIC collating sequence is even weirder than I realized!". I > refer to my version 5 Basics manual, p. 1040: > Under CMS, OS, & VSE a portion of the EBCDIC collating sequence is: > abcdefghijklmnopq~stuvwxyz{ABCDEFGHI}J > KLMNOPQR\STUVWXYZ0123456789 Note: the EBCDIC sequence *does* include the lower case "r", following the "q" and preceding the tilde. I see the following implications: Where sorts are done strictly for internal purposes (such as MERGEing data sets), there shouldn't be much of a problem. A data set which has been transported, say from an EBCDIC environment to an ASCII one, may have to be re-sorted. If a sort is done to alphabetize a list for external presentation, and the character variables contain a mixture of upper and lower case, it is a good idea to create one or more new variables using the UPCASE function and to actually sort by these. This is true for both ASCII and EBCDIC environments. It assures correct placement of names with embedded upper case letters (such as VanDyke). If you need an alphabet string in a character expression (for example, to use with the VERIFY function), do not try to generate it with the COLLATE function. It would work with ASCII, but not with EBCDIC. /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \ Howard Schreier, U.S. Dept. of Commerce, Washington / | (Using Version 5 under IBM OS MVS/XA) | / BITNET: HIS@NIHCU INTERNET: HIS@CU.NIH.GOV \ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/