This example uses the same data set as in Example 8.1.
When the input data set resides on the SAS appliance, the SAS appliance performs all samplings, writes out a sample on the
SAS appliance, and reports the frequency results back to the client. In the following statements, the input data resides in
the MyLib library (which is a distributed data source), and the output data set is a distributed data set in the MyLib library.
You can use PROC DATASETS to delete the output table if it already exists on the SAS appliance. The ods output FreqTable=Freqtab; statement saves the frequency table to a SAS data set called Freqtab on the client.
/*MyLib is a libref for a distributed data source
In this case, the computation is automatically done
on the SAS appliance.*/
option set=GRIDHOST = "&GRIDHOST";
option set=GRIDINSTALLLOC = "&GRIDINSTALLLOC";
libname MyLib &LIBTYPE
server ="&GRIDDATASERVER"
user =&USER
password=&PASSWORD
database=&DATABASE;
proc delete data=MyLib.out_smp_ex3; run;
proc hpsample data=MyLib.hmeq_example out=MyLib.out_smp_ex3 samppct=10 seed=1;
var loan value delinq derog;
class job reason;
target job reason;
ods output FreqTable=Freqtab;
run;
Output 8.3.1 shows the performance environment information.
Output 8.3.1: Performance Information
| Performance Information | |
|---|---|
| Host Node | << your grid host >> |
| Execution Mode | Distributed |
| Grid Mode | Symmetric |
| Number of Compute Nodes | 8 |
| Number of Threads per Node | 1 |
Output 8.3.2 shows the number of observations in each stratum (constructed by a combination of the levels of each of the two targets)
in the data set MyLib.Hmeq and in the sample.
Output 8.3.2: Frequency Table
| Stratified Sampling1 Frequency Table | |||
|---|---|---|---|
| Target1 Level | Target2 Level | Number of Obs | Number of Sample |
| 107 | 11 | ||
| DebtCon | 115 | 12 | |
| HomeImp | 57 | 7 | |
| Mgr | 21 | 0 | |
| Mgr | DebtCon | 572 | 58 |
| Mgr | HomeImp | 174 | 17 |
| Office | 27 | 3 | |
| Office | DebtCon | 620 | 62 |
| Office | HomeImp | 301 | 32 |
| Other | 68 | 8 | |
| Other | DebtCon | 1604 | 161 |
| Other | HomeImp | 716 | 71 |
| ProfExe | 24 | 2 | |
| ProfExe | DebtCon | 847 | 85 |
| ProfExe | HomeImp | 405 | 43 |
| Sales | DebtCon | 97 | 11 |
| Sales | HomeImp | 12 | 0 |
| Self | 5 | 0 | |
| Self | DebtCon | 73 | 8 |
| Self | HomeImp | 115 | 11 |