02-19-2015 11:47 PM
i have a table that looks like this
id. Date. Code
A1. 02/01/15. OOC
A2. 02/01/2015. OOC
A3. 02/03/15. DB
A4. 02/04/15. DB
I want create a pivot table in sas looking like this
02/01/15. 02/03/15. 02/04/15
DB. 1. 1
then I would like it if I can add the pivot table to the body of outlook
02-20-2015 10:18 AM
Otherwise, to embed a Microsoft data structure in a Microsoft mail product would seem to call for Microsoft technology.
02-20-2015 01:21 PM
your correct i came up with a proc report does exactly that ...now the question how I would be able export that to the body of outlook to be able to email it out ... I have the code to auto email already I would like to know how attach the html output named report which resides in results... I'm playing around with ods but any help would be greatly appreciated
02-21-2015 02:42 AM
i Have a code so alter to this it creates the report in results but when it runs the output section it doesn't pick it up
any thoughts what I'm mmight be missing?
FILENAME output EMAIL
SUBJECT= "Sales summary report 1" FROM= "firstname.lastname@example.org"
TO= "email@example.com" CT= "text/html" /* Required for HTML output */ ;
ODS HTML BODY=output STYLE=sasweb; TITLE JUSTIFY=left
"Total Sales by Country and Product type as of %sysfunc(date(),yymmdd10.)";
PROC REPORT DATA=sashelp.prdsale NOWD STYLE(REPORT)=[PREHTML="<hr>"] /*Inserts a rule between title & body*/; COLUMNS COUNTRY PRODTYPE,ACTUAL; DEFINE COUNTRY /GROUP; DEFINE PRODTYPE /ACROSS; DEFINE ACTUAL/SUM ""; BREAK AFTER PRODTYPE /SUMMARIZE;
RUN; ODS HTML CLOSE;
02-21-2015 02:45 AM
PROC REPORT DATA=sashelp.prdsale NOWD STYLE(REPORT)=[PREHTML="<hr>"] /*Inserts a rule between title & body*/; COLUMNS COUNTRY PRODTYPE,ACTUAL; DEFINE COUNTRY /GROUP; DEFINE PRODTYPE /ACROSS; DEFINE ACTUAL/SUM ""; BREAK AFTER PRODTYPE /SUMMary
it didn't copy correctly here is rest of code... I need for results to be added to body of outlook like a pic
02-21-2015 10:02 AM
Since many mail systems do not allow HTML mail these days, I generally use the method shown in this paper:http://support.sas.com/resources/papers/proceedings11/300-2011.pdf starting on page 7. I send my ODS files as attachments. That always works very reliably for me. That way I don't have to worry about whether the mail system allows HTML or RTF or PDF format mail or not. If you continue to have issues, you might want to open a track with Tech Support, there are many settings that can only be done at start up that have to be turned on before mail from SAS will work and depending on your OS and your mail client, you may not have the right things set for sending mail no matter which method you use.