Hello fellow SAS programmers, I am tring to create a report notification where a group of people get an email saying that they have purchased an item on so on date with a list of other induvuduals who have purchased the same/similar item. Here is my table: Purchase_ID Purchase_Date Name Phone Email_Txt 101 1/1/2016 jon 123 You are getting this email because you have purchased this item on 01/01/2016 101 1/2/2016 smith 456 You are getting this email because you have purchased this item on 01/02/2016 201 1/5/2016 KAY 789 You are getting this email because you have purchased this item on 01/05/2016 201 1/3/2016 TOM 654 You are getting this email because you have purchased this item on 01/03/2016 201 1/2/2016 JILL 741 You are getting this email because you have purchased this item on 01/02/2016 I want to creat a report that will look like: You are getting this email because you have purchased this item on 01/01/2016 Purchase_ID Purchase_Date Name Phone 101 1/1/2016 jon 123 101 1/2/2016 smith 456 You are getting this email because you have purchased this item on 01/02/2016 Purchase_ID Purchase_Date Name Phone 201 1/5/2016 KAY 789 201 1/3/2016 TOM 654 201 1/2/2016 JILL 741 My Code: proc sort data=book3 out=temp101;
by Purchase_ID EMAIL_TXT;
run;
options nobyline;
proc report data=temp101 nowd headline headskip wrap;
by Purchase_ID EMAIL_TXT;
column Purchase_Date Name Phone;
define Purchase_Date/'Purchase Date';
define Name/'Customer Name';
define Phone/'Customer Phone';
title1 justify=left "NOTIFICATION";
title justify=left "#byval2";
run;
When I run the code, I am uinable to group records by Purchase_ID with title as EMAIL_TXT using the #byval. Here is my output report: You are getting this email because you have purchased this item on 01/01/2016 Purchase Date Customer Name Customer Phone 01JAN2016 jon 123 You are getting this email because you have purchased this item on 01/02/2016 Purchase Date Customer Name Customer Phone 02JAN2016 smith 456 You are getting this email because you have purchased this item on 01/02/2016 Purchase Date Customer Name Customer Phone 02JAN2016 JILL 741 You are getting this email because you have purchased this item on 01/03/2016 Purchase Date Customer Name Customer Phone 03JAN2016 TOM 654 You are getting this email because you have purchased this item on 01/05/2016 Purchase Date Customer Name Customer Phone 05JAN2016 KAY 789 Is there a way I can group all records under one Purchase_ID with EMAIL_TXT as Title? Any help will be much appreciated! Thanks in advance
... View more