The SAS Output Delivery System and reporting techniques

Address proper alignment and Print for Report Title

Accepted Solution Solved
Reply
Contributor
Posts: 35
Accepted Solution

Address proper alignment and Print for Report Title

[ Edited ]

I am trying to print the address as a main group header of my report from data and want the lines to wrap up properly.

 

I have different fields for address in data that i have concatenated to get 1 field

for example:

name, address1, address2,city,state,zip ----->cats(name,address1,city,state,zip) as new_add in my table

eg: one of new_place data value is ---> Mcdonald's,100 newyork Ave,Queens,NY,56432

 

reports prints it out as 1 line on bygroup header  : Mcdonald's,100 newyork Ave,Queens,NY,56432 (i am using byvar(new_add) on title to print on different pages)

 

But i want to be broken and text wrraped as below :

Mcdonald's

100 newyork Ave 

Queens NY 56432

 

what options in proc report can be used to do so.

 

here's my code

TITLE1 bold f= Calibri h=14pt wrap j=c "reportTitle";
TITLE4      " ";
TITLE5    f= Calibri j=l h=9pt    "#byval(new_add)";

proc report nofs  data = rep nowd spanrows split='~' headline missing

by new_add  ;
column new_add  var1 var2 var3;

;
define  new_add /group noprint '' format=$place. left style = {cellwidth=70mm  rules=none };

define var1/group   left style = {cellwidth=70mm  rules=none };

define var2/group   left style = {cellwidth=70mm  rules=none };

define var3/group   left style = {cellwidth=70mm  rules=none };

run;

break after  new_add / skip dul;
run;

 

 

 

 

 

 

 


Accepted Solutions
Solution
‎12-25-2016 05:36 PM
SAS Super FREQ
Posts: 8,720

Re: Address proper alignment and Print for Report Title

Hi:

  Here's a full example with the output shown in RTF and PDF.

cynthia

use_escapechar.png

View solution in original post


All Replies
Grand Advisor
Posts: 10,223

Re: Address proper alignment and Print for Report Title

I would suggest that when you concatenate the fields together to make your new_add variable to insert either a carriage return, linefeed or newline character to force breaks. Which to use may depend on ODS destination.

Grand Advisor
Posts: 9,584

Re: Address proper alignment and Print for Report Title


How about this:


data class;
 set sashelp.class;
 group=catx('~n',sex,age);
run;
proc sort data=class ;by group;run;
options nobyline;
ods escapechar='~';
title '#byval1';
proc report data=class nowd;
by group;
column Name	Sex	Age	Height	Weight	;
run;

Solution
‎12-25-2016 05:36 PM
SAS Super FREQ
Posts: 8,720

Re: Address proper alignment and Print for Report Title

Hi:

  Here's a full example with the output shown in RTF and PDF.

cynthia

use_escapechar.png

Contributor
Posts: 35

Re: Address proper alignment and Print for Report Title

This works too..but the later one is more explanatory.

Thanks to everybody.

☑ This topic is SOLVED.

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

Discussion stats
  • 4 replies
  • 308 views
  • 2 likes
  • 4 in conversation