BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
TS2000
Calcite | Level 5

I use the EMAIL device to send email through SAS from a Linux system. This works just fine in most cases, but when I attach an .xlsx file the file somehow gets corrupted. When I receive the email, everything looks good, but Excel can’t open the attachment. It gives an error message "We found a problem with some content in..." and then "Excel cannot open the file...". I see that the documentation for the EMAIL device has an option CONTENT_TYPE='content_type', but no indication what the possible values are. Is there a particular content type that should be specified? Or is there something else that needs to be done to allow .xlsx files to be attached? I’ve seen a post here from 2013 with the same problem, but no resolution. Below is code used:

filename em

email ("&emailaddr.")

       to = ("&emailaddr.")

       subject = "Test"

       attach = ("/amex2/ramp/misc/gsc_glob/tashelly/ods/GCG_Unique_CM_201911.xlsx")

       emailid = "&emailaddr."

;

 

data _null_;

file em;

put "Test";

run;

1 ACCEPTED SOLUTION

Accepted Solutions
tomrvincent
Rhodochrosite | Level 12
attach=
(
"foobar.xlsx" content_type="application/xlsx" lrecl=32000
)

View solution in original post

1 REPLY 1
tomrvincent
Rhodochrosite | Level 12
attach=
(
"foobar.xlsx" content_type="application/xlsx" lrecl=32000
)
How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 2238 views
  • 1 like
  • 2 in conversation