Resources

SASŪ High-Performance Analytics Samples

The SAS High-Performance Analytics sample programs and install verification tests can be run only after you edit and submit this file. The file contains site-specific information about your environment so that the procedures can run successfully.

Example 1 for PROC HPREDUCE

/****************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                 */
/*                                                              */
/*    NAME: hpred01.sas                                         */
/*   TITLE: Example 1 for PROC HPREDUCE                         */
/*          Unsupervised variable selection                     */
/* PRODUCT: HPA                                                 */
/*  SYSTEM: ALL                                                 */
/*    KEYS: Variable Selection,                                 */
/*          Unsupervised                                        */
/*   PROCS: HPREDUCE                                            */
/*    DATA:                                                     */
/*                                                              */
/* SUPPORT: Z. Alan Zhao                                        */
/*     REF: SAS/HPA User's Guide, PROC HPREDUCE chapter         */
/*    MISC:                                                     */
/*                                                              */
/****************************************************************/

data one;
  array x{10};
  array c{10};
  do i=1 to 2000;
    do j=1 to 10;
       x{j}=ranuni(1);
       c{j}=int(ranuni(1)*4);
    end;

          if c{1} eq 0 Then b1 = 'aa';
          if c{1} eq 1 Then b1 = 'bb';
          if c{1} eq 2 then b1 = 'cc';
          if c{1} eq 3 then b1 = 'dd';
          if c{1} eq 4 then b1 = 'ee';

          if c{2} eq 0 Then b2 = 'ff';
          if c{2} eq 1 Then b2 = 'gg';
          if c{2} eq 2 then b2 = 'hh';
          if c{2} eq 3 then b2 = 'ii';
          if c{2} eq 4 then b2 = 'jj';

          if c{3} eq 0 Then b3 = 'kk';
          if c{3} eq 1 Then b3 = 'll';
          if c{3} eq 2 then b3 = 'mm';
          if c{3} eq 3 then b3 = 'nn';
          if c{3} eq 4 then b3 = 'oo';
    output;
  end;
run;

title  "HPREDUCE on Client";

proc hpreduce data=one;
       class b1-b3 c1-c3;
       reduce unsupervised b1 b1*b2 b3 c1-c3 x1-x10/maxsteps=5;
       performance details;
run;