The SAS Output Delivery System and reporting techniques

How do you remove the "by" statement "Item Title"

Accepted Solution Solved
Reply
Contributor
Posts: 27
Accepted Solution

How do you remove the "by" statement "Item Title"

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...

proc report remove by.png


Accepted Solutions
Solution
‎05-04-2017 09:30 AM
SAS Super FREQ
Posts: 8,864

Re: How do you remove the "by" statement "Item Title"

HI:
Have you tried OPTIONS NOBYLINE; before the PROC REPORT step and then OPTIONS BYLINE; at the end of the job to restore the regular behavior?

cynthia

View solution in original post


All Replies
Solution
‎05-04-2017 09:30 AM
SAS Super FREQ
Posts: 8,864

Re: How do you remove the "by" statement "Item Title"

HI:
Have you tried OPTIONS NOBYLINE; before the PROC REPORT step and then OPTIONS BYLINE; at the end of the job to restore the regular behavior?

cynthia
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 165 views
  • 0 likes
  • 2 in conversation