You are on page 1of 5

(4)Enhanced Report Writing

Create Enhanced Report Using PROC REPORT


Syntax
Proc Report Data=xxxx <options>;
column xxxx;
define xxxx/ <options>;
run;
Two modes:
WINDOW MODE & NON-WINDOW MODE
In window mode, the output is sent to REPORT window instead of OUTPUT
Window
Specify non-window mode using option NOWD
Should always use non-window mode
Column statement decides the layout of the report, it specifies the number of the columns
And their sequence in the report
Define statement enhances the appearance of each column by adding proper options, there
Is no requirement in the order of options when they are added

Common Used Options In PROC REPORT
Commonly used options:
Headline (Draws a line under the column headers)
Headskip (puts a blank line beneath the column headers)
Split (It splits the variable name in two line if the variable name is long)(by default is /)
Width (it defines the width between two column)
Flow (If the values sentence is long then it continue the sentence in second line)
ID (if the variables dont fit in the one page then with the ID we can see the value by
the id. Like value by the staffid)
**Use of Nowd, Headline, Headskip, Split, Width, Define, Column, Format**;
proc report data=mydata.company
nowd headline headskip split='*';
column staffid gender salary;
define staffid/width=15 'Employee*ID';
define gender/width=15 'Gender';
define salary/width=15 'Income
format=comma12.2;
run;
**long format**;
proc format ;
value $gender
'F'='Worker gender is female'
'M'='Worker gender is male';
run;

options fmtsearch=(work);

**use flow to avoid truncation**;
proc report data=mydata.company
nowd headline;
column staffid gender salary;
define staffid/width=15
'Employee ID';
define gender/width=15 'Gender'
format=$gender. flow;
define salary/width=15
'Income'
format=comma12.2;
run;
** ID**;
proc report data=mydata.company
nowd headline;
column staffid gender salary dob
dateofhire jobdesc;
define staffid/width=15 id;
define gender/width=15 ;
define salary/width=15 ;
define dob/width=15;
define dateofhire/width=15;
define jobdesc/width=50;
where gender='F';
run;

You might also like