The HPDECIDE Procedure

Example 6.2 Running with Client Data in Distributed Mode

This example demonstrates how to use PROC HPDECIDE to make decisions when the type of the decision data set is LOSS and the target is continuous. When the input data set resides on the client and a PERFORMANCE statement with a NODES= option is specified, as in the following statements, PROC HPDECIDE copies the data set to the SAS appliance, where the computation is performed:

    data data2;
        input tar p ;
        DATALINES;
        1     6
        2     2
        3     1
        3     4
        4     2
        5     0
        3     3
        6     2
        7     1
        3     5
    ;

    data decdata2(type=loss);
        input dv1 dv2 dv3 tar ;
        DATALINES;
        0 0 3 0
        1 0 2 1
        0 2 1 2
        0 3 0 3
    ;

The following statements take as input the data2 and decdata2 data sets (which reside on the client) and output the out2 and outstat2 data sets. The decision variables are dv1, dv2, and dv3, and the target variable is tar. Because five grid nodes are specified in the PERFORMANCE statement, the input data sets are distributed from the client to the five grid nodes, which perform the computations and then write the output data sets back to the client.

 proc hpdecide data=data2 out=out2 outstat=outstat2;
     decision decdata=decdata2 decvars=dv1-dv3;
     predicted p;
     target tar;
     performance details nodes=5 nthreads=8
     host="&GRIDHOST" install="&GRIDINSTALLLOC";
 run;

 proc print data=out2;
 run;

 proc print data=outstat2;
 run;

Output 6.2.1 shows the out2 data set, which displays the decision for each observation. For each observation, the continuous target variable was interpolated.

Output 6.2.1: out2 Data Set

Obspdv1dv2dv3D_DECDATA2EL_DECDATA2CL_DECDATA2BL_DECDATA2_WARN_
1606-3dv3-320 
22021dv1000 
31102dv2030 
4404-1dv3-100 
52021dv100-1 
60003dv100-2 
73030dv1000 
82021dv100-3 
91102dv207-4 
10505-2dv3-200 


Output 6.2.2 shows the outstat2 data set, which shows that the total loss is 0 and the average loss is 0, based on the decisions from the out2 data set.

Output 6.2.2: outstat2 Data Set

Obs_LOSS__ALOSS_
1121.2


Output 6.2.3 shows the performance information.

Output 6.2.3: Performance Information

Performance Information
Host Node<< your grid host >>
Install Location<< your grid install location >>
Execution ModeDistributed
Number of Compute Nodes5
Number of Threads per Node8


Output 6.2.4 shows the timing information.

Output 6.2.4: Timing Information

Procedure Task Timing
TaskSecondsPercent
Startup of Distributed Environment1.2298.34%
Data Transfer from Client0.000.21%
Computation0.000.05%
Writing Output0.021.39%


Last updated: July 02, 2020