Example: DATA Step Program for Hadoop

This example demonstrates executing a DATA step program in Hadoop.
/* Enable DATA step parallel processing using the system option */
/* and enable messages to view non-compliant code in the SAS log */
options dsaccel=any msglevel=i;

/* Create a libref for Hadoop files */
libname griddlm hadoop user=myuser pw=hd12345
   HDFS_TEMPDIR="/user/temp" 
   HDFS_DATADIR="/userdata"
   HDFS_METADIR="/user/meta"
   config="C:\sasuser\scoring\hd1\conf\testconfig.xml"
   HPA_TEMPDIR_KEEP=YES;

/* Create a libref for the input data that is stored on disk. */
libname y '/myScoreData/';

/* Load the input table*/
data griddlm.intr;
   set y.intrid;
run;

/* Execute the score code using the Hadoop files. */
/* Both files must use the same libref. */
data griddlm.introut3;
   set griddlm.intr;
   /* Execute the score code. */
   if sum > 1000
      then score=1;
run;