Desktop productivity for business analysts and programmers

Problem in different layout of report

Reply
N/A
Posts: 0

Problem in different layout of report

Hi

How can I display report where i have two values 'Number of Invoices Received'
and 'Number of Invoices Autopass' in a datasets with only these columns in the datasets.


Report Output

Report header

Number of Invoices Received : 800
Number of Invoices Autopass :1000

Report footer

Which type of task or which type of Proc will give me the above output. Message was edited by: Sunil Gandhi
SAS Super FREQ
Posts: 8,818

Re: Problem in different layout of report

Hi:
Assuming that your data looks like this with only 2 columns and 1 row:
[pre]
Obs numrec numauto
1 800 1000
[/pre]
Then you could use PROC TRANSPOSE on your data:
[pre]
proc transpose data=twocols out=trans;
label numrec = "Number of Invoices Received"
numauto = "Number of Invoices Autopass";
format numrec numauto comma6.;
run;

ods listing;
ods html file='show_trans.html' style=egdefault;

proc print data=trans;
title 'Transposed Report "Header" ';
footnote 'Transposed Report "Footer" ';
var _NAME_ _LABEL_ COL1;
run;

ods _all_ close;
[/pre]
And then the output from the above PROC PRINT would look like this:
[pre]
Transposed Report "Header"

Obs _NAME_ _LABEL_ COL1
1 numrec Number of Invoices Received 800
2 numauto Number of Invoices Autopass 1,000






Transposed Report "Footer"

[/pre]
Enterprise Guide does have a TRANSPOSE task, you could use that to transpose the data before the PROC PRINT or LIST Data task. And, of course, you could only use _LABEL_ and COL1 in the PROC PRINT or LIST Data task to get closer to the report you want.

There are two other alternative that don't use PROC TRANSPOSE. One involves using PROC TABULATE (Summary Table Task) and the other involves using a DATA step program to write the report to FILE PRINT ODS.

cynthia
N/A
Posts: 0

Re: Problem in different layout of report

Thanx a million,
But I dont want to display the column header i.e. want to suppress column header
for example:-
In your above output you are getting this
Obs _NAME_ _LABEL_ COL1
How to suppress this?
SAS Super FREQ
Posts: 8,818

Re: Problem in different layout of report

Hi:
In that case, on of your choices is to move to a code node and use a PROC REPORT step with the NOHEADER option on the transposed data set:
[pre]
proc report data=trans nowd noheader;
title 'PROC REPORT: Transposed Report "Header"';
footnote 'Transposed Report "Footer"';
column _LABEL_ COL1;
run;
[/pre]

The other choices involve using a DATA step program.
cynthia
Ask a Question
Discussion stats
  • 3 replies
  • 112 views
  • 0 likes
  • 2 in conversation