Can we Display only headers no data in proc report

Reply
Frequent Contributor
Posts: 85

Can we Display only headers no data in proc report

Is it possible to display only headers in proc report i dont want data only headers to be displayed

Contributor
Posts: 74

Re: Can we Display only headers no data in proc report

With proc report, I don't know but you could do a workaround with the data. Keep one obs, set the values to missing and report that.

data shoes_dummy;

    set sashelp.shoes (obs = 1);

    call missing(region, product);

run;

title 'Empty Shoes Table';

proc report data =  shoes_dummy nowd;

    col region product;

run;

Grand Advisor
Posts: 9,594

Re: Can we Display only headers no data in proc report

No . You can't . Workaround way is making variables' name as an obs.

Code: Program

proc transpose data=sashelp.class(obs=0) out=temp ;
var _all_;
run;
proc transpose data=temp out=want(drop=_name_ _label_);
var _name_;
run;
proc report data=want nowd noheader;run;

SAS Super FREQ
Posts: 8,721

Re: Can we Display only headers no data in proc report

Hi:

  Here is a possible approach. You have to have at least one data row. It can be "empty", but perhaps it will work for you.

cynthia

ods html file='c:\temp\strange_report.html';

options missing=' ';

proc report data=sashelp.class(obs=1) nowd missing;

title 'Model Report with only headers and 1 blank row';

  column name age sex height weight;

  compute weight;

    name = ' ';

    age.sum = .;

    sex = ' ';

    height.sum = .;

    weight.sum = .;

  endcomp;

run;

ods html close;

options missing=.;

Contributor
Posts: 74

Re: Can we Display only headers no data in proc report

>You have to have at least one data row. It can be "empty"

Thanks.  That's what I did, just beforehand.

Grand Advisor
Posts: 9,594

Re: Can we Display only headers no data in proc report

But that will bring BOX into REPORT , which I think OP don't want this .

Frequent Contributor
Posts: 85

Re: Can we Display only headers no data in proc report

Yes i am getting one box below header i want only headers to be displayed with out any data

Esteemed Advisor
Posts: 6,702

Re: Can we Display only headers no data in proc report

How "nice" does your output need to be?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Esteemed Advisor
Esteemed Advisor
Posts: 7,251

Re: Can we Display only headers no data in proc report

Rather than proc report can you not just do something like (not tested):

data _null_;

     file "yourfile.txt";

     set sashelp.vcolumn (where=(libname="WORK" and memname="YOURDS"));

     put label;

run;

Ask a Question
Discussion stats
  • 8 replies
  • 572 views
  • 0 likes
  • 6 in conversation