I have a proc report statement that is rendering with the "by" statement variables, but I do not want them to show.
Here is the code...
**********************************************************************************************************************************************
%let dcps_student_id = '05143698';
/* use this to print the DCPS logo. This macro is OUSTSIDE the loop that makes the pdf */
%macro dcps_logo;
%put #######;
%put Blank Header;
%put #######;
data mydata;
text=' ';
run;
proc report data=mydata noheader nowd contents=''
style(header)=[bordercolor=white]
style(summary)=[bordercolor=white]
style(report)=[frame=void rules=none];
column text;
define text / display;
run;
ods region x=0.8cm y=0.5cm;
ods pdf text="^S={preimage='\\SERVERNAME\PROJECTLOCATION\Images\DCPS_bridge.png?height=1.50cm&width=2.5cm'}";
ods pdf text =" ";
%mend dcps_logo;
/* ods is defined as output delivery system */
ods _all_ close;
/* clear graph title(s), if there is(are) one(any) from pervious iterations */
title;
title2;
title3;
footnote;
ods escapechar='^';
options nocenter nodate nonumber orientation=portrait device=actximg; /* oreintation of the report */
/* set macro variable for number of terms */
proc sql noprint;
select distinct max_terms into :max_terms
from SASdev.transcript_GPA
where dcps_student_id = &dcps_student_id
;
quit;
%macro loop;
data transcript;
set SASdev.transcript_GPA;
where dcps_student_id = &dcps_student_id;
call symput('dcps_student_id',dcps_student_id);
call symput('number_terms',number_terms);
call symput('max_terms',max_terms);
a1='\\SERVERNAME\sasdata\Transcripts\sasData\test_123.pdf';
a1=compress(a1);
call symput('attachment',a1);
run;
%put attachment=&attachment;
ods pdf file="&attachment"
startpage=now
pdftoc=1
dpi=300;
ods layout absolute x=0.0cm y=0.0cm;
/* only one label per page*/
ods proclabel="&dcps_student_id";
%dcps_logo;
ods pdf nobookmarkgen;
ods region x=5.0cm y=1.0cm;
ods pdf text ="^S={font_size=14pt font_face=Calibri color=grey just=l}Duval County Public Schools Transcript";
%do i=1 %to &max_terms;
%let left=0.0;
%if &i=1 %then %let down=&i;
%else %let down=%eval(&i*2+1);
ods region x=&left.in y=&down.in width=3.75in;
proc report data=work.transcript split='~' nocenter nowindows
style(header)={font_face=Calibri font_size=4pt height=0.12in just=c vjust=c background=lightgrey font_weight=bold};
columns ('Grade' grade_level)
('Course' course_number course_name)
(score)
('Credits' credits_attempted credits_earned );
where dcps_student_id = '05143698';
by school_year term_code term_gpa term_gpa_weighted cum_gpa cum_gpa_weighted;
define grade_level / group 'Level' style={cellwidth=0.35in cellheight=0.12in just=c vjust=c font_face="Helvetica" fontsize=4pt } ;
define course_number / display 'Number' style={cellwidth=0.50in cellheight=0.12in just=c vjust=c font_face="Helvetica" fontsize=4pt } ;
define course_name / display 'Name' style={cellwidth=0.90in cellheight=0.12in just=l vjust=c font_face="Helvetica" fontsize=4pt } ;
define score / display 'Score' style={cellwidth=0.35in cellheight=0.12in just=c vjust=c font_face="Helvetica" fontsize=4pt } ;
define credits_attempted / display 'Attempted' style={cellwidth=0.42in cellheight=0.12in just=c vjust=c font_face="Helvetica" fontsize=4pt } ;
define credits_earned / display 'Earned' style={cellwidth=0.42in cellheight=0.12in just=c vjust=c font_face="Helvetica" fontsize=4pt } ;
title1 height=6pt bold 'School Year: #BYVAL(school_year) Term: #BYVAL(term_code)';
title2 height=6pt bold 'Term GPA: #BYVAL(term_gpa) Term GPA (weighted): #BYVAL(term_gpa_weighted)';
title3 height=6pt bold 'Cumulative GPA: #BYVAL(cum_gpa) Cumulative GPA (weighted): #BYVAL(Cumulative_gpa_weighted)';
title4 &down;
break after grade_level/page;
run;
%end;
ods pdf nobookmarkgen; /* this removes the -content or index- rendering once pdf is created */
title1;
title2;
title3;
ods layout end;
ods pdf startpage=now;
%mend loop; /* end the macro Loop */
%loop; /* invoke the macro Loop */
**********************************************************************************************************************************************
Here is the output...
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.