08-22-2014 12:49 PM
I need to make a mail-merge document which is a randomization form for a study (one page per randomization number). Each page has the company logo at the top, three centered title lines, a box with the randomization number and treatment assignment and some fields that need to be filled out by hand.
My first idea would be to use a few TITLE statements for the logo and the title lines and then a few PROC REPORT statements for the remainder, adjusting the table borders according to the needs (for instance, the signature field would be a two-row, one-column table with the first row having the bottom border and the second row having the word "Signature").
I was wondering if there is either an easier (or cooler!) way to do this using the capabilities of SAS 9.4. Two ideas that came to mind were the use of ODS LAYOUT and of the ODS Report Writing Interface. Do you have any thoughts or any experiences to share on the optimal way to go about doing this?
PS The same question would apply in producing the accompanying randomization envelopes which will also be produced by mail-merging.
08-23-2014 06:17 PM
One thing you can do is #1) make your main merge document in Microsoft Word and define the merge fields over in Word. Then write your SAS program to create the values for the merge fields (usually in a CSV file). Finally, you go over to Word and start the merge using the CSV file to provide the information for each form. Another alternative #2) is to make the letter in a dataset in a SAS program and then merge your name data with the letter dataset and produce the entire letter file using ODS RTF. This previous forum posting has an example of #2 https://communities.sas.com/message/107987#107987.
In addition, a more automated version of #1 that uses DDE is explained in #3) this paper http://www2.sas.com/proceedings/sugi29/034-29.pdf.
And, yet another version of #1, using ODS HTML is shown in #4) this paper http://analytics.ncsu.edu/sesug/2005/CC05_05.PDF.