1 / 23

ARE YOU USING PROC REPORT YET?

ARE YOU USING PROC REPORT YET?. Priya Ramaswami Janssen R&D US. Advantages of PROC REPORT - Very powerful - Perform lists, subsets, statistics, computations, formatting within one procedure. - Multiple functions in one – SORT,

hogan
Télécharger la présentation

ARE YOU USING PROC REPORT YET?

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ARE YOU USING PROC REPORT YET? Priya Ramaswami Janssen R&D US

  2. Advantages of PROC REPORT - Very powerful - Perform lists, subsets, statistics, computations, formatting within one procedure. - Multiple functions in one – SORT, PRINT, MEANS, TABULATE, some DATA STEP processing

  3. SYNTAX PROC REPORT data=input dataset options; WHERE <optional>; COLUMN list of variables; DEFINE variable 1 / column attributes; DEFINE variable 2 / column attributes; …. DEFINE last variable / column attributes; COMPUTE block <optional>; BREAK statement <optional>; RBREAK statement <optional>; RUN;

  4. PROC REPORT statement – Common options: • DATA= Input dataset used for processing the report • NOWD Short for NOWINDOWS. Sends the report to the output window instead of the interactive REPORT window • SPLIT= Wraps the header and column contents at the specified character. The default character is ‘/’ • HEADLINE Creates a line below the column header • HEADSKIP Inserts a blank line between the column header and the first line of data • OUT= Creates an output dataset with the contents of the REPORT procedure. This is especially helpful while trouble-shooting any new variables created in the COMPUTE block or specified breaks.

  5. WHERE statement - subset the data. Syntax: keyword WHERE + conditions COLUMN statement - lists all the variables to be displayed in the report, including variables created in the COMPUTE block Syntax: keyword COLUMN + variable names.

  6. DEFINE statement - how the variables are presented in the report. Syntax: keyword DEFINE + variable name + slash (/) + set of keywords and options. Common keywords: • GROUP categorizes observations by the variable • DISPLAY default; displays values for each observation as they appear in the data. • ORDER sorts the data by the variable • ANALYSIS performs the specified statistical function on the variable • COMPUTED identifies variables created in the COMPUTE block.

  7. COMPUTE block - begins with the COMPUTE statement and ends with the ENDCOMP statement. Create new variables, add blank lines, add footnotes. BREAK statement is optional and is used for summarizing groups of data. Syntax: BREAK before or after variable / <options>; BREAK variable has to be a group or order variable. A summary line is created when the value of the variable changes. The keyword BEFORE creates the summary line before the data; the keyword AFTER creates the summary line after the data.

  8. RBREAK statement is optional and is used to create a summary line for the whole report. Syntax: RBREAK before or after / <options>; Options for the BREAK and RBREAK statements: - UL Underline - OL Overline - DUL Double underline - DOL Double overline - PAGE Skip a page before the next row - SKIP Skip a line before the next row - SUMMARIZE Create a summary line for each variable specified - SUPPRESS Not print the value of the break variable in the summary line

  9. ORDER= Option Specifies the method of sorting the variable. Used in conjunction with the ORDER keyword in the DEFINE statement. There are four types of sorts that can be performed with the ORDER= option. • ORDER=INTERNAL Sorts by the variable’s unformatted values • ORDER=DATA Sorts by the order of the variable’s values as in the dataset • ORDER=FORMATTED Default; Sorts by the variable’s formatted values • ORDER=FREQ Sorts by the frequency counts of the variable’s values

  10. COMPUTE BLOCK • One of the most unique features of the REPORT procedure. • Enables to modify values, add variables, add headers and footnotes, and control the contents of columns. • The COMPUTE block begins with the COMPUTE statement and ends with the ENDCOMP statement. Typically placed after the DEFINE statements.   2 types of COMPUTE blocks: • associated with a location with respect to the layout of the report • associated with the report item only. Syntax: compute <location> <report item> </ options>; executable statements endcomp;

  11. OUTPUT DELIVERY SYSTEM (ODS) Output from the PROC REPORT can be directed to a pdf file, rtf file or html file. Syntax: ods listing close; ods rtf file = file location\file name.rtf; proc report steps from previous example ods rtf close;

  12. Contact details Priya Ramaswami, Janssen R&D US pramaswa@its.jnj.com

More Related