CALL SORTN Routine

Sorts the values of numeric arguments.

Category:Sort
Restriction:This function is not valid on the CAS server.
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.

Syntax

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

Required Argument

variable

specifies a numeric variable.

Details

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

Comparisons

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

Example

The following example sorts the numeric variables in the array in ascending order.
data _null_;
   array x(10) (0, ., .a, 1e-12, -1e-8, .z, -37, 123456789, 1e20, 42);
   call sortn(of x(*));
   put +3 x(*);
run;
SAS writes the following output to the log:
   . A Z -37 -1E-8 0 1E-12 42 123456789 1E20

See Also

CALL Routines:
Last updated: March 16, 2017