Hi, I am using ODS to output the results of PROC REPORT into XLS files, and I have run into a few issues. To give you a little background, I am using a macro loop to produce reports for groups of people within an organization. I want to include the group's formal name in the report title (have had some success with this), and I want to include the group's abbreviated title in the exported filename (have had no success with this). It might be helpful to add that the BY STATEMENT is only included in the PROC REPORT so that #BYVAL can be used in TITLE2. The BY STATEMENT is otherwise unnecessary because each iteration of the loop runs the report for a different group. 1. I would like to pass the value of a variable (group_desc) to a title. I was able to do this using #BYVAL. The problem is that my output provides an unwanted line of text, which shows the value produced by the BY STATEMENT in PROC REPORT. Since my TITLE already contains the relevant value, I would like to suppress or turn off this unwanted line of text. 2. I would like to pass the value of a different variable (acad_group) to the filename. I have not yet figured out how to do this. Here is an abbreviated version of the relevant parts of my code. Thanks in advance for your help! ods html file="c:\temp\college_x_term_&I..xls" style=Styles.Custom /*I want to include the value for acad_group in the filename*/ headtext="<style> td {mso-number-format:\@}</style>"; title1 bold color=CX000000 bcolor=CXFFFFFF &titleterm ; title2 bold color=CX000000 bcolor=CXFFFFFF 'Grade Distribution for #BYVAL(group_desc)'; /*Populated with the by statement (below)*/ proc report data=work.dummy_report nowindows headline; by group_desc; /*The by statement is included to populate the #BYVAL option in TITLE2 (above)*/ column acad_group group_desc A B C D E F; define acad_group / noprint group; define group_desc / "College" group; define acad_org / "Department" group; define A / analysis "N" f=comma6.0; define B / analysis "N" f=comma6.0; define C / analysis "N" f=comma6.0; define D / analysis "N" f=comma6.0; define F / analysis "N" f=comma6.0; run; ods html close; quit;
... View more