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
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;
And what is that output supposed to look like? How many rows?
Do you know why the data set is emply?
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.
when it has the data, not having lots of rows, most is 100 records...
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;
Thank you, I am going to try .
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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.