A very common coding technique SAS programmers use is identifying the largest value for a given column using DATA Step BY statement with the DESCENDING option. In this example I wanted to find the largest value of the number of runs (nRuns) by each team in the SASHELP.BASEBALL dataset. Using a SAS workspace server, one would write:
Figure 2 shows the results of the code we ran in Figure 1:
To run this DATA Step distributed we will leveraging the SAS® Cloud Analytic Services in SAS® Viya. Notice in Figure 3, there is no need for the PROC SORT step which is required when running DATA Step single threaded in a SAS workspace server. This is because SAS® Cloud Analytic Services in SAS® Viya . Instead we will use
Figure 4 shows the results when running distributed DATA Step in SAS® Cloud Analytic Services in SAS® Viya.
Until the BY statement running in the SAS® Cloud Analytic Services in SAS® Viya supports DESCENDING use this technique to ensure your DATA Step runs distributed.