Q:

Random Permutation of Rows of a Large Dataset

I need to create a random permutation of a data set with over 3 million rows.
I have tried to use PROC PLAN, based off of this example: http://support.sas.com/kb/23/977.html According to this article, having n = (number of rows)! allows the random selection of a permutation. Unfortunately for a set this size, that is 4.3*10^19668676 permutations. Obviously I run into a bit of a memory problem here.
I also found an example using PROC IML, but it looks like my company does not have the necessary licence/software package to use it. 
Can anyone supply me with a good way to shuffle this data set?

A:

It sounds like you want to take the rows and put them in a random order.  If so, the most common method is to create a random value for each row and then sort by the random values:
DATA augmented ;
  SET original ;
  sortval = RAND('UNIFORM') ;
RUN ;

PROC SORT DATA=augmented OUT=permuted(DROP=sortval) ;
  BY sortval ;
RUN ;

You can use the CALL STREAMINIT(seedval) call routine if you want to be able to precisely reproduce the random sequence at a later time.
You could also probably do this with PROC SQL [untested code]:
PROC SQL ;
  CREATE TABLE permuted(DROP=sortval) AS
    SELECT a.*, RAND('UNIFORM') AS sortval
      FROM original a
      ORDER BY sortval
  ;
QUIT ;

