What’s New in PROC FREQ Procedure, Version 9.

by Irina 21. July 2007 06:24
  1. NLEVELS

    Some times you might be interested to know the number of levels for all character variables or all numeric variables in that data set with out printing there frequency table.

    PROC FREQ DATA=SASHELP.CLASS NLEVELS;
    TABLES _CHAR_ / NOPRINT;
    RUN;
    Similarly you can use TABLES _ NUMERIC _ / NOPRINT; or TABLES VAR1--VAR2 / NOPRINT;
  2. CONTENTS: CONTENTS=link-text: Used in TABLES statement to specify the meaningful text(on the hyper link) for the HTML contents file that links to crosstabulation tables. The CONTENTS= option affects only the HTML contents file, and not the HTML body file. If you omit this option, by default, the HTML link text for crosstabulation tables is “Cross-Tabular Freq Table”. This option is useful to specify the different text for different crosstabulationtable links.
    Example:
    ODS HTML
    BODY = "DATA.HTM"
    CONTENTS = "TOC.HTM"
    FRAME = "FRAME.HTM"
    PATH= "Path name"
    STYLE=DEFAULT;
    PROC FREQ DATA=SASHELP.CLASS;
    TABLES SEX * AGE / CONTENTS= "First freq table for Sex vs Age";
    TABLES SEX * WEIGHT / CONTENTS = "Second freq table for Sex vs WEIGHT";
    FORMAT WEIGHT PHYSIC.;
    RUN;
    ODS HTML CLOSE;
  3. CROSSLIST:

  4. CROSSLIST: Used in TABLES statement to display the crosstabulation tables in column format instead of the default crosstabulation cell format. You cannot specify both the LIST option and the CROSSLIST option in the same TABLES statement.

    Example:
    PROC FREQ DATA=SASHELP.CLASS;
    TABLES SEX * AGE / CROSSLIST;
    RUN;
  5. NOSPARSE:
    By default for CROSSLIST tables, as shown in above example, PROC FREQ displays all levels of the column variable within each level of the row variable, including any column variable levels with zero frequency for that row. For CROSSLIST tables, the NOSPARSE option suppresses display of variable levels with zero frequency.
    Example:
    PROC FREQ DATA=SASHELP.CLASS;
    TABLES SEX * AGE / CROSSLIST NOSPARSE;
    RUN;

    Tags: proc_freq

    SAS

    About the author

    Irina Spivak Irina Spivak
    Team Leader at G-Stat. More...


    Send mail Email

    Authors

    Blogroll

      Disclaimer

      The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

      © Copyright 2010

      Sign in

      eXTReMe Tracker