Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!aplcen!uakari.primate.wisc.edu!brutus.cs.uiuc.edu!psuvax1!psuvm!UNC!UEPRCK From: UEPRCK@UNC.BITNET (Bob Kleckner) Newsgroups: bit.listserv.sas-l Subject: Internal collating sequences and character comparisons. Message-ID: Date: 1 Feb 90 15:15:00 GMT Sender: "SAS(r) Discussion" Reply-To: Bob Kleckner Lines: 31 Approved: NETNEWS@PSUVM Gateway This is an expansion on Sally Muller's 01/30/90 comments on PROC SORT and differences between EBCDIC (IBM) and ASCII (everybody else ?) internal collating sequences for 'character variable' comparisons. For those unable to RFTM (p. 1040, V.5 Basics) 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 . As pointed out by Sally, this difference will affect the sort order of character value BY variables in PROC SORT. This difference will also affect character comparisons (p. 224, V.5 Basics) as follows: In EBCDIC NAME= 'a'; If NAME < '1'; /* Is true */ In ASCII NAME= 'a'; If NAME < '1'; /* Is false */ . Warning: Keep this difference in mind if you are moving between operating systems. : This may be especially important for those testing SAS programs on a PC and then doing production runs on an IBM MVS or CMS machine. Because someone will ask: Your IBM PC and PS2 machines use the ASCII internal collating sequence. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Bob Kleckner (UEPRCK@UNC.BITNET) Applications Analyst Programmer Dept. of Epidemiology, UNC Chapel Hill, NC 27599-7400 919-966-2080