Proc Print - remove variable =

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

Proc Print - remove variable =

How would I change my proc report code so that instead of displaying "Division=East" it just displays "East". I basically just want to remove the "Division=" piece. Also, is there a way to remove the line that displays between groups?

 

data mydata;
infile datalines dlm="|";
Length Dept_Description $ 40 Division $5 Units 4;
Input Dept_Description Division Units;
datalines;
Red|East|1234
Blue|East|2546
Green|West|8495
Yellow|West|5162
;
title "report 1";
proc report data=mydata;
column Dept_Description Units;
by Division;
run; 

Current Output

report 1

Division=East
Dept_Description     Units
Red                 1234
Blue                 2546

--------------------------------------------------------------------------------
report 1

Division=West
Dept_Description     Units
Green                      8495
Yellow                      5162


Desired Output

report 1

East
Dept_Description     Units
Red                         1234
Blue                         2546


report 1

West
Dept_Description     Units
Green                      8495
Yellow                      5162

 


Accepted Solutions
Solution
‎12-18-2017 10:58 AM
Super User
Posts: 12,148

Re: Proc Print - remove variable =

One way:

options nobyline;
title "report 1";
title3 #byval(division);
proc report data=mydata;
column Dept_Description Units;
by Division;
run;title; 

options byline; /*reset*/

View solution in original post


All Replies
Super User
Posts: 21,530

Re: Proc Print - remove variable =

I believe that's the BY title. You can specify NOBYLINE option and then customize it yourself. 

 

http://www2.sas.com/proceedings/sugi23/Coders/p75.pdf

 

 

Solution
‎12-18-2017 10:58 AM
Super User
Posts: 12,148

Re: Proc Print - remove variable =

One way:

options nobyline;
title "report 1";
title3 #byval(division);
proc report data=mydata;
column Dept_Description Units;
by Division;
run;title; 

options byline; /*reset*/
☑ This topic is solved.

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

Discussion stats
  • 2 replies
  • 85 views
  • 2 likes
  • 3 in conversation