Returns the kth smallest nonmissing value.

Category: | Descriptive Statistics |

This example compares
the values that are returned by the SMALLEST function with values
that are returned by the ORDINAL function.

data comparison; label smallest_num='SMALLEST Function' ordinal_num='ORDINAL Function'; do k = 1 to 4; smallest_num = smallest(k, 456, 789, .Q, 123); ordinal_num = ordinal (k, 456, 789, .Q, 123); output; end; run; proc print data=comparison label noobs; var k smallest_num ordinal_num; title 'Results From the SMALLEST and the ORDINAL Functions'; run;

Copyright © SAS Institute Inc. All rights reserved.