Dick Duck's SAS tips

This is the nest where I keep my SAS eggs. It's all here... Arrays, control loops, links to online SAS resources, you name it.

Thursday, February 16, 2006

Select from set of elements

Say you want to select a certain set of candidates, for instance, candidates 1, 5, 7, 13 and 20.
Rather than:

if (cand = 1 or cand = 5 or cand = 7 or cand = 13 or cand = 20)
you can use:

if cand in (1, 5, 7, 13, 20)

0 Comments:

Post a Comment

<< Home