The SAS Output Delivery System and reporting techniques

Report

Reply
N/A
Posts: 0

Report

Hi,

I need to create a summary report with all counts.So I created a count for each dataset and together put it on the one dataset,but the output is not so exact if I use the below code,

data summaryReport;
set Var1 Var2 Var3 Var4 ;
run;

Var1 Var2 Var3 Var4
38
0
0
40

I need an output as below,

Var1 38
Var2 0
var3 0
var4 40

Please let me know.
Thanks Message was edited by: Raveenat
Super User
Posts: 11,343

Re: Report

Posted in reply to deleted_user
How did you summarize and combine the previous output? You may be creating extra work with that approach.
N/A
Posts: 0

Re: Report

Hi

I created a count for each dataset by using this macros,

%macro cnt_inv (tbl=, vr=, table=);
PROC SQL;
create table &tbl. as
select count(*) as &vr. from &table.
quit;
%mend cnt_inv;

%cnt_inv (tbl=var1, vr=prior, table=test1);
%cnt_inv (tbl=var2, vr=worked, table=test2);
%cnt_inv (tbl=Var3, vr=new, table=test3)
%cnt_inv (tbl=var4, vr=crnt, table=test4);
Super User
Posts: 10,046

Re: Report

Posted in reply to deleted_user
Emmmm.
Maybe you will like dictionary table:


[pre]
proc sql ;
create table summary as
select memname label='Table Name',nobs label='Number of Observations'
from dictionary.tables
where libname='SASHELP' and memname in ('CLASS' 'SHOES');
quit;
[/pre]


Ksharp
Ask a Question
Discussion stats
  • 3 replies
  • 147 views
  • 0 likes
  • 3 in conversation