Hi SAS communities, I am trying to find a way to access and check the sort order of datasets, which I believed is stored as "metadata" that contains information on the attributes of datasets (e.g. sort order, number of variables...etc). So far, I have not had much success. The following are two ways that I've come up with so far, but they don't seem to do exactly what I need: 1) 1) There’s an option for Proc Sort called “presorted”, which checks through the dataset to see if any one of the observations are out of the specified sort order in the "By" statement. If it is sorted properly, no sorting will be done. Otherwise sorting will be done. The downside about this is that I don’t think it produces an indicator of some sort, and therefore if I have 60 partitions of one big dataset, every single one has to go through the proc sort presorted process. If one of the partitions is already sorted correctly, and all partitions are generated in the same process, then there's no point putting every partition through the process. Not very efficient. 2) I believe there are “dictionaries” that can only be accessed by proc sql, e.g. dictionary.tables or dictionary.columns, that tells you about the properties of the datasets, including the sort orders. From my research so far, it seems that the dictionary contains info for the active SAS session, and not for particular datasets. I might be wrong about this. It would be great if someone can point me in the right way. Thanks in advance! Shane
... View more