BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
JHE
Obsidian | Level 7 JHE
Obsidian | Level 7

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

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

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

7 REPLIES 7
ballardw
Super User

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

 

Do you know why the data set is emply?

JHE
Obsidian | Level 7 JHE
Obsidian | Level 7

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.

JHE
Obsidian | Level 7 JHE
Obsidian | Level 7

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

JHE
Obsidian | Level 7 JHE
Obsidian | Level 7
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. -##
Tom
Super User Tom
Super User

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;
JHE
Obsidian | Level 7 JHE
Obsidian | Level 7

Thank you, I am going to try .

JHE
Obsidian | Level 7 JHE
Obsidian | Level 7

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;

 

 

 

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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