CALL SORTC Routine
Sorts the values of character arguments.
| Categories: | Sort |
|---|---|
| CAS | |
| Interaction: | When invoked by the %SYSCALL macro statement, CALL SORTC removes the quotation marks from its arguments. For more information, see Invoking CALL Routines and the %SYSCALL Macro Statement. |
| Note: | Argument types for arguments that are updated must match in CALL routines. All argument types must be CHAR, VARCHAR, or NUMERIC. If the argument types do not match, a warning is issued to the log. |
Table of Contents
Syntax
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
This 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 results to the log:
baboon baby babylon banana dumpty humpty tweedledee tweedledum
See Also
-
CALL Routines:
Last updated: September 16, 2026