Is there a way to put free texts above your title within your output? I tried it but it gave me an error that it needs to be placed by a group.
Below is my code:
ods excel file="\\fenrir\DEVL\sam_s\Standard Opioid ODS Conversion\Summary_test.xlsx" options(start_at="1,1"
frozen_headers="5"
frozen_rowheaders="3"
/*autofilter="1-5"*/
sheet_name="Summary"
row_repeat="1"
embedded_titles="yes");
proc report split='~' data=Table1_Final out=Table1_Final_1 spanrows style(header)=[fontweight=bold background=lightblue foreground=black]
style(column)={font_face='Calibri' fontsize=11pt};
column Status P4 P3 P2 P1;
define Status / Display "";
define P1 / Analysis "7/1/20 -~ 12/31/2020" style(column)=[cellwidth=15% textalign=center just=decimal];
define P2 / Analysis "4/1/20 -~ 09/30/2020" style(column)=[cellwidth=15% textalign=center just=decimal];
define P3 / Analysis "1/1/20 -~ 06/30/2020" style(column)=[cellwidth=15% textalign=center just=decimal];
define P4 / Analysis "10/1/19 -~ 03/31/2020" style(column)=[cellwidth=15% textalign=center just=decimal];
title1 '# of Members Filling Opioids';
endcomp;
compute before _Page_ / left;
length text0 - text6 $100;
if _BREAK_= ' ' then
do;
text0="OPIOID OVERUTILIZATION";
text1="HEALTH PLAN GROUP: &Clnt_Name";
text2="CLIENT id: &clntid";
text3="Date Generated: &To_Date";
text4="Evaluation Period: &Eval_Date";
text5="Data Sources: PDW";
end;
line text0 $100.;
line text1 $100.;
line text2 $100.;
line text3 $100.;
line text4 $100.;
line text5 $100.;
endcomp;
compute before Status;
line '';
line '';
endcomp;
run;
ods excel close;
I want it to look like the attachment Example.xlsx but when I run my code it looked like \Summary_test.xlsx
You don't show a TITLE statement in that code so I am not sure how to interpret your requirement.
If you mean text before the entire procedure you can use either ODS TEXT or Proc ODSTEXT to create text that goes to the ODS destination. You will need to modify the Sheet_interval option to get the output on the same sheet as the Proc Report output.
Many users here don't want to download Excel files because of virus potential, organization policy or others have such things blocked by security software.
If you want something to "look like" then provide an image.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.