Hi:
One technique that I have used very successfully is to design a form letter using Microsoft Word and creating the letter with the appropriate field codes for a mail merge. Word will accept a CSV file as the "data" for a mail merge. So I use SAS to make the CSV file with the name and address information.
Then, after the CSV file is created, I use Word to point to the CSV file and start the mail merge. This method has worked very well for me, because all of the formatting of the letter content is done with Word.
To answer your question, you can only insert a LINE break in PROC REPORT with a LINE statement for GROUP or ORDER items. I do not believe this will work in your case. The other approach you can use is to insert an ODS ESCAPECHAR "new line" control string at the end of the address. In SAS 9.1.3, you use the ODS ESCAPECHAR statement to declare an ESCAPECHAR for use. Then the ESCAPECHAR+n represents a line feed or carriage return character when the output is sent to ODS PDF, RTF or HTML. For more information about ODS ESCAPECHAR in SAS 9.1.3, refer to this paper:
http://www2.sas.com/proceedings/forum2007/099-2007.pdf
Another example of a form letter approach (that doesn't use Word or CSV) is shown below, using PROC REPORT and ODS PDF. In this approach, the entire text of the letter, including names and addresses is put into a LINETXT variable. Then the letter text varies, depending on each student's age. PROC REPORT has the ability to start a page for every NAME, so this technique will ensure that every student's letter starts a new page. This approach works well for paragraphs of text inside the letter.
cynthia
[pre]
data letter(keep=name lineno linetxt);
length linetxt $1000;
set sashelp.class;
where age ge 14;
lineno = 1;
linetxt = name;
output;
** this address will be the same for every person;
** because SASHELP.CLASS does not have addresses;
** but with your data, you could use the real address;
lineno=2;
linetxt= '1234 Sesame Street';
output;
lineno=3;
linetxt = 'Anytown, ST 12345~3n';
output;
lineno=4;
linetxt = catx(' ','Dear',name,'~2n');
output;
lineno=5;
hold='We notice that you are now';
linetxt=catx(' ',hold,put(age,2.0),'years old.');
if age lt 15 then do;
linetxt=catx(' ',linetxt,"You have a few years before you can apply for your learner's permit.",
"But, if you and your parents come in for our free Teen Driving seminar,",
"we will guarantee you a 20% discount on our driving lessons.~2n");
output;
end;
else if age ge 15 then do;
linetxt=catx(' ',linetxt,"Our records show that you have applied for a learner's permit.",
"If you and your parents come in for our free Teen Driving seminar,",
"we will guarantee you a 20% discount on our driving lessons.~2n");
output;
end;
lineno=6;
linetxt='To take advantage of this special offer, have your parents call 1-800-888-8888.~2n';
output;
lineno=7;
linetxt='Sincerely,~4n';
output;
lineno=8;
linetxt='Ima Salesman~nDriveMaster, Inc.';
output;
run;
ods listing close;
title; footnote;
ods pdf file='formletter_drive.pdf';
ods escapechar='~';
proc report data=letter nowd noheader
style(report)={rules=none frame=void cellspacing=0 cellpadding=3 outputwidth=80%} ;
title h=14pt 'DriveMaster, Inc.';
title2 ' ';
title3 ' ';
footnote 'The Easy Way to Teach Your Teen To Drive Safely';
column name lineno linetxt;
define name / order noprint;
define lineno / order noprint;
define linetxt/
style(column)={font_face='Helvetica'};
compute linetxt;
if lineno in (1,2,3) then do;
call define(_col_,'style','style={font_weight=bold font_size=12pt}');
end;
else do;
call define(_col_,'style','style={font_weight=medium font_size=10pt}');
end;
endcomp;
break after name / page;
run;
ods pdf close;
[/pre]