Example: Calculate Statistics from DBMS Data

This example uses the FREQ procedure to calculate statistics on the Invoices DB2 table.
libname mydblib db2 ssid=db2;

proc freq data=mydblib.invoices(keep=invnum country);
  tables country;
  title 'Invoice Frequency by Country';
run;
This output shows the one-way frequency table that this example generates.
Use the FREQ Procedure
                                Invoice Frequency by Country
                                  The FREQ Procedure

                                      COUNTRY

                                                     Cumulative    Cumulative
    COUNTRY                 Frequency     Percent     Frequency      Percent
    -------------------------------------------------------------------------
    Argentina                      2       11.76             2        11.76
    Australia                      1        5.88             3        17.65
    Brazil                         4       23.53             7        41.18
    USA                           10       58.82            17       100.00