The SAS Output Delivery System and reporting techniques

PROC Report

Accepted Solution Solved
Reply
Frequent Contributor
Frequent Contributor
Posts: 98
Accepted Solution

PROC Report

My Code:

ods excel file="..xlsx"

style=Print;

ods excel options(

sheet_name = 'Termed_Providers_Detail'

embedded_titles='yes'

EMBEDDED_FOOTNOTES= 'Yes'

sheet_interval="table"

frozen_headers='1'

orientation='landscape'

);

RUN;

PROC REPORT DATA=Detail3;

COLUMN Member_ID Member_Effective_Date Provider_ID Provider_Name COUNTY Provider_Term_Date Par_Non_Par;

title " LOB 1300 Termed Provider Report Detail " ;

footnote" Run at &sDay &stime";

RUN;

ods _all_ close;

Dynamicly Data Detail3 is empty table. I stil need create an Excel File Tab Name = LOB 1300 Termed Provider Report Detail,  blank Sheet with footnote "No Data meet the Criteria".

 

Can any one give advise.

Thank you

Joanne


Accepted Solutions
Solution
‎06-22-2017 07:30 AM
Super User
Super User
Posts: 7,074

Re: PROC Report

I think we have seen this problame before.  I believe that for PROC REPORT you need at least one observation.

So you might try something like this.

%let footnote2=;
data to_report ;
  if _n_=1 and eof then do;
    call symputx('footnote2','No data to report');
    output;
  end;
  set detail3 end=eof;
run;

PROC REPORT DATA=to_report ;
COLUMN Member_ID Member_Effective_Date Provider_ID
        Provider_Name CO=UNTY Provider_Term_Date Par_Non_Par
;
compute after _page_ / left;
      line "&footnote2" ;
endcomp;
title " LOB 1300 Termed Provider Report Detail " ;
footnote" Run at &sDay &stime";
RUN;

View solution in original post


All Replies
Super User
Posts: 11,343

Re: PROC Report

And what is that output supposed to look like? How many rows?

 

Do you know why the data set is emply?

Frequent Contributor
Frequent Contributor
Posts: 98

Re: PROC Report

Dynamically meet the criteria , some time has the result, some time dose not have the result, I want have the reprot, even dose nto have the result, just blank sheet with tile and footnote.

Frequent Contributor
Frequent Contributor
Posts: 98

Re: PROC Report

when it has the data, not having lots of rows, most is 100 records...

Frequent Contributor
Frequent Contributor
Posts: 98

Re: PROC Report

This code woks.

/***************************************************************************/

ods excel options(

sheet_name = 'Termed_Providers_Detail'

embedded_titles='yes'

EMBEDDED_FOOTNOTES= 'Yes'

sheet_interval="table"

frozen_headers='1'

orientation='landscape'

);

*RUN*;

%let footnote2=;

*data* Detail3 ;

if _n_=*1* and eof then do;

call symputx('footnote2','No data to report');

output;

end;

ELSE call symputx('footnote2','');

set detail3 end=eof;

*run*;

*PROC* *REPORT* DATA=Detail3;

COLUMN Member_ID Member_Effective_Date Provider_ID Provider_Name COUNTY
Provider_Term_Date Par_Non_Par;

title " LOB 1300 Termed Provider Report Detail " ;

compute after _page_ / left;

line "&footnote2" ;

endcomp;

title " LOB 1300 Termed Provider Report Detail " ;

footnote" Run at &sDay &stime";

*RUN*;

ods _all_ close;



##- Please type your reply above this line. Simple formatting, no
attachments. -##
Solution
‎06-22-2017 07:30 AM
Super User
Super User
Posts: 7,074

Re: PROC Report

I think we have seen this problame before.  I believe that for PROC REPORT you need at least one observation.

So you might try something like this.

%let footnote2=;
data to_report ;
  if _n_=1 and eof then do;
    call symputx('footnote2','No data to report');
    output;
  end;
  set detail3 end=eof;
run;

PROC REPORT DATA=to_report ;
COLUMN Member_ID Member_Effective_Date Provider_ID
        Provider_Name CO=UNTY Provider_Term_Date Par_Non_Par
;
compute after _page_ / left;
      line "&footnote2" ;
endcomp;
title " LOB 1300 Termed Provider Report Detail " ;
footnote" Run at &sDay &stime";
RUN;
Frequent Contributor
Frequent Contributor
Posts: 98

Re: PROC Report

Thank you, I am going to try .

Frequent Contributor
Frequent Contributor
Posts: 98

Re: PROC Report

No excel sheet been created. I guess might should not using Proc Report, if using Proc Print might work. Attach log file for your refrence.

 

My code:

%LET sDAY =%sysfunc(today(),DATE9.);

%LET stime=%sysfunc(datetime(),TOD.);

ods excel file="/mnt/nfs/prod/Sched/OpsDeptData/Operations/Reports/LOB_1300_PP/Enrollment/Termed_Providers/2017/Termed_Providers_&Rpt_Dt1.-&Rpt_Dt2..xlsx"

style=Print;

ods excel options(

sheet_name = '1300_Termed_Providers'

embedded_titles='yes'

EMBEDDED_FOOTNOTES= 'Yes'

sheet_interval="table"

frozen_headers='1'

orientation='landscape'

);

RUN;

PROC REPORT DATA=Final3;

COLUMN Member_ID Member_Effective_Date Provider_ID Provider_Name COUNTY Provider_Term_Date Par_Non_Par;

title " LOB 1300 Termed Provider Report" ;

footnote" Run at &sDay &stime";

RUN;

/***************************************************************************/

ods excel options(

sheet_name = 'Termed_Providers_Detail'

embedded_titles='yes'

EMBEDDED_FOOTNOTES= 'Yes'

sheet_interval="table"

frozen_headers='1'

orientation='landscape'

);

RUN;

%let footnote2=;

data to_report ;

if _n_=1 and eof then do;

call symputx('footnote2','No data to report');

output;

end;

set detail3 end=eof;

run;

PROC REPORT DATA=Detail3;

COLUMN Member_ID Member_Effective_Date Provider_ID Provider_Name COUNTY Provider_Term_Date Par_Non_Par;

title " LOB 1300 Termed Provider Report Detail " ;

compute after _page_ / left;

line "&footnote2" ;

endcomp;

title " LOB 1300 Termed Provider Report Detail " ;

footnote" Run at &sDay &stime";

RUN;

ods _all_ close;

 

 

 

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 190 views
  • 0 likes
  • 3 in conversation