When using the SAS/Access libname engines to assign a libref to a database stored in EBCDIC and then attempt to sort one of the database tables in a data step, you may receive the following error:
ERROR: By variables are not properly sorted on data set xxx.xxx
This is because the "by" clause assumes that the sort order of SAS matches the native sort order of the database, which may not always be correct. For example, if you have data stored in EBCDIC on the database, when this is read into SAS it is converted to ASCII. So if you sort the data in EBCDIC and convert it to ASCII, you get a different order than if you convert it to ASCII and then sort it.
The only circumvention, is to sort only by numeric fields, or by character fields whose data's sort order is the same both on the database and in SAS.