It depends on how your data looks like. Let's call your special value as value
and let's assume that it is in character format. That special value is located in a variable column ,let's call it Var1
.
You put if statement as below,
data _null_;
set yourdata;
if Var1 = "value" then /* if "Var1" is equal to "value" then */
call symput ('value1',Var1); /* create a Macro variable with call symput*/
run; /* Now you can use this &value1 anywhere in your code */
ods listing close;
ods tagsets.excelxp file="&path\yourfile.xls" style=statistical
options(sheet_name='&value1.*'); /* If you want to add a character into the sheet name,
then you can write &value.* as there is a dot between them */
;
proc print data=yourdata; run;
ods tagsets.excelxp close;
ods listing;
call symput
or something similar to construct a title statement. – Joe