23
Priya Ramaswami Janssen R&D US

ARE YOU USING PROC REPORT YET?

  • Upload
    hogan

  • View
    52

  • Download
    0

Embed Size (px)

DESCRIPTION

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, - PowerPoint PPT Presentation

Citation preview

Page 1: ARE YOU USING  PROC REPORT YET?

Priya RamaswamiJanssen R&D US

Page 2: ARE YOU USING  PROC REPORT YET?

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

Page 3: ARE YOU USING  PROC REPORT YET?

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;

Page 4: ARE YOU USING  PROC REPORT YET?

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.

Page 5: ARE YOU USING  PROC REPORT YET?

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.

Page 6: ARE YOU USING  PROC REPORT YET?

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.

Page 7: ARE YOU USING  PROC REPORT YET?

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.

Page 8: ARE YOU USING  PROC REPORT YET?

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

Page 9: ARE YOU USING  PROC REPORT YET?
Page 10: ARE YOU USING  PROC REPORT YET?
Page 11: ARE YOU USING  PROC REPORT YET?
Page 12: ARE YOU USING  PROC REPORT YET?
Page 13: ARE YOU USING  PROC REPORT YET?

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

Page 14: ARE YOU USING  PROC REPORT YET?
Page 15: ARE YOU USING  PROC REPORT YET?
Page 16: ARE YOU USING  PROC REPORT YET?

COMPUTE BLOCKOne 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;

Page 17: ARE YOU USING  PROC REPORT YET?
Page 18: ARE YOU USING  PROC REPORT YET?
Page 19: ARE YOU USING  PROC REPORT YET?
Page 20: ARE YOU USING  PROC REPORT YET?
Page 21: ARE YOU USING  PROC REPORT YET?

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; 

Closes output window

Opens a file for the output in rtf format

Closes rtf file

Page 22: ARE YOU USING  PROC REPORT YET?
Page 23: ARE YOU USING  PROC REPORT YET?

Contact details

Priya Ramaswami, Janssen R&D US

[email protected]