CALL RANPERM Routine


CALL RANPERM Routine

Randomly permutes the values of the arguments

Category: Random Number

Syntax

CALL RANPERM ( seed , variable-1 <, variable-2, ... >);

Arguments

seed

  • is a numeric variable that contains the random number seed. For more information about seeds , see 'Seed Values' on page 257.

variable

  • specifies all numeric variables or all character variables that have the same length. The values of these variables are randomly permuted.

Examples

The following example generates random permutations of given values by using the CALL RANPERM routine.

 data _null_;        array x x1-x4 (1 2 3 4);        seed = 1234567890123;        do n=1 to 10;           call ranperm(seed, of x1-x4);           put seed= @20 ' x= ' x1-x4;        end;  run; 

The following lines are written to the SAS log:

 seed=1332351321     x= 1 3 2 4  seed=829042065      x= 3 4 2 1  seed=767738639      x= 4 2 3 1  seed=1280236105     x= 1 2 4 3  seed=670350431      x= 2 1 4 3  seed=1956939964     x= 2 4 3 1  seed=353939815      x= 4 1 2 3  seed=1996660805     x= 4 3 1 2  seed=1835940555     x= 4 3 2 1  seed=910897519      x= 3 2 1 4 

See Also

CALL Routines:

  • 'CALL ALLPERM Routine' on page 335

  • 'CALL RANPERK Routine' on page 375




SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 704

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net