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;
Hi:
Here's a full example with the output shown in RTF and PDF.
cynthia
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.
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;
Hi:
Here's a full example with the output shown in RTF and PDF.
cynthia
This works too..but the later one is more explanatory.
Thanks to everybody.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.