CALL SORTC Routine

Sorts the values of character arguments.

Category: Sort
Interaction: When invoked by the %SYSCALL macro statement, CALL SORTC removes the quotation marks from its arguments. For more information, see Using CALL Routines and the %SYSCALL Macro Statement.

Syntax

CALL SORTC(variable-1<, …, variable-n>);

Required Argument

variable

specifies a character variable.

Details

The values of variable are sorted in ascending order by the CALL SORTC routine.

Comparisons

The CALL SORTC routine is used with character variables, and the CALL SORTN routine is used with numeric variables.

Example

The following example sorts the character variables in the array in ascending order.
data _null_;
   array x(8) $10
      ('tweedledum' 'tweedledee' 'baboon' 'baby'
       'humpty' 'dumpty' 'banana' 'babylon');
   call sortc(of x(*));
   put +3 x(*);
run; 
SAS writes the following output to the log:
   baboon baby babylon banana dumpty humpty tweedledee tweedledum

See Also

CALL Routines: