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;

 

 

 

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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