You cannot use a SAS-Variable-List to reference elements of a temporary array, because they are not variables.
But you can sort elements of a temporary array if you reference them properly. array-name[subscript]. I don't know if my example is adequate but seems reasonable.
48 data _null_;
49 array a[5] _temporary_ (1 1 4 3 2);
50 do i = 1 to dim(a); put (a[i])(=); end;
51 put ' ';
52 call sortn(a[3],a[4],a[5]);
53 do i = 1 to dim(a); put (a[i])(=); end;
54 run;
a[1]=1
a[2]=1
a[3]=4
a[4]=3
a[5]=2
a[1]=1
a[2]=1
a[3]=2
a[4]=3
a[5]=4
... View more