O'Reilly logo

SAS Functions by Example, Second Edition, 2nd Edition by Ron Cody

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3

Sort Functions

 

Introduction

Function That Sorts Numeric Values

CALL SORTN

Function That Sorts Character Values

CALL SORTC

 

Introduction

Two CALL routines, CALL SORTN and CALL SORTC, can sort the values of their arguments. They are frequently used with SAS arrays to place all the values of the array elements in ascending order.

These two CALL routines were included in SAS 9.1.3 but were still considered experimental. With SAS 9.2, they are considered fully supported routines.

This author remembers writing a SAS program, many years ago, that used a bubble sort to perform the actions of the CALL SORTN routine. With the introduction of the ORDINAL function, this process became much easier. Finally, with these CALL routines, sorting ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required