HI
i am having issues opening pdf documents created by ods pdf from emails sent via a sas program. The pdfs are stored remotely on a unix server and i am using standard filename statement to send the email using sas via the unix server.
the problems start when i receive the email and try to open the pdf. I get the following message
'file has been damaged or not properly decoded'.
i Know that sas is creating the files ok as i am able to ftp the file down from the server and open it. So it would appear that the ftp does decode the file but the email service doesnt.
has anyone experienced similar issues?
thanks
Hi,
Does the following help?:
12563 - PDF file created by Enterprise Guide is corrupted and unable to openin Acrobat
I did also see the following which mentions a similar issue, but it was on Mainframe, as opposed to Unix:
https://communities.sas.com/thread/5085?start=0&tstart=0
Regards,
Amir.
HI amir
some useful information, thanks.
unfortunately this did not solve my problem. This does though
%let path=/home;
%let pdf_name=report1.pdf;
%let pdf_name_in_email=report2.pdf;
%let email_body_text_file=email_body.txt;
%let email_from=me@you.com ;
%let email_to= me@you.com ;
%let subject=TEST EMAIL;
data _null_;
email_cmd = "(uuencode; " !!
" uuencode &path./&pdf_name. &pdf_name_in_email.;) " !!
"| cat &path./&email_body_text_file. - " !!
"| mailx -s '&subject.' -r '&email_from.' &email_to.";
call symput('email_cmd', email_cmd);
run;
%let rc=%sysfunc(system(&email_cmd.));
the last piece i need to figure now is how to change the email type from plain text to html. If you try to attach an html file in the body of the email it just displays the html code rather than the output.
i've tried -a 'content-type:text/html' straight after the mailx command but it doesnt work.
any ideas
thanks
Attached is code I used to email a PDF using UNIX. This code builds to PDF and then attaches it to an Email Body.
The PDF attachment is built using ODS PDF Command.
Then email is sent via SAS email. I am not sure it will work with EG.
Michael
He, Dvg. Have you tested E-mailing PDF with the code from Wizard? If yes, please share the result with us. Thanks.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: