Create the cellvalue definitions. The DEFINE CELLVALUE statements define the values that will appear in the cells of the crosstabulation table.


The HEADER= attribute specifies the text that appears in the legend. Because there is no text specified for any of these cellvalues, there is no legend in the output.


The FORMAT= attribute specifies the format to use for the cellvalue. The DATA_FORMAT_OVERRIDE=ON attribute specifies to use the format specified in the data component. The PRINT=ON attribute specifies the cellvalue to appear in the table.


The CELLSTYLE AS statement uses expressions to set the style element of the cells conditionally according to the values of the variables for the Frequency cellvalue. The _VAL_ variable represents the value of a cell. Therefore, in this example, if the value in a cell is less than ten, then the font color for the DataStrong style element is green. If the value in the cell is between 40 and 50, then the font color for the DataStrong style element is orange. If the value is greater then 50, then the font color is red.


      define cellvalue Frequency;
         header="";
         label="Frequency Count";
         format=BEST7.; data_format_override=on; print=on;
         cellstyle _val_ < 10 as datastrong {color=green},
                   _val_ > 40 & _val_ < 50 as datastrong {color=orange},
                   _val_ >= 50 as datastrong {color=red};
         end;

      define cellvalue Expected;
         header="";
         label="Expected Frequency";
         format=BEST6. data_format_override=on print=on;
         end;

      define cellvalue Deviation;
         header="";
         label="Deviation from Expected Frequency";
         format=BEST6. data_format_override=on print=on;
         end;

      define cellvalue CellChiSquare;
         header="";
         label="Cell Chi-Square";
         format=BEST6. print=on;
         end;

      define cellvalue TotalPercent;
         header="";
         label="Percent of Total Frequency";
         format=6.2 print=on;
         end;

      define cellvalue Percent;
         header="";
         label="Percent of Two-Way Table Frequency";
         format=6.2 print=on;
         end;

      define cellvalue RowPercent;
         header="";
         label="Percent of Row Frequency";
         format=6.2 print=on;
         end;

      define cellvalue ColPercent;
         header="";
         label="Percent of Column Frequency";
         format=6.2 print=on;
         end;

      define cellvalue CumColPercent;
         header="";
         label="Cumulative Percent of Column Frequency";
         format=6.2 print=on;
         end;