SAS Office Analytics, SAS Add-In for Microsoft Office, and other integrations

Error sending email programmatically from SAS EG when updated to MS Office 2016

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 12
Accepted Solution

Error sending email programmatically from SAS EG when updated to MS Office 2016

I have a SAS EG program that automatically sends an email at the completion of a program using "filename mymail email" code (SMTP Access Method). It has been working fine for several years under MS Office 2013. Our computers are now being updated to MS Office 2016. On the computers that are currently updated to Office 2016 the email code fails and SAS stops running (see pertinent SAS Log below). What do I need to do to make this program work with MS Office 2016?

 

I am running SAS 9.4 TS Level 1M3 on Win32_7PRO platform.

 

Cheryl

 

ERROR:  An exception has been encountered.

Please contact technical support and provide them with the

       following traceback information:

 

The SAS task name is [DATASTEP (2)]

Exception occurred at (7068FB35)

Task Traceback

Address   Frame     (DBGHELP API Version 4.0 rev 5)

7068FB35  0BE3E680  mso20win32clientSmiley Surprisedrdinal1176+0x5E

7068FAED  0BE3E69C  mso20win32clientSmiley Surprisedrdinal1176+0x16

6F7CAB4A  0BE3EC30  mso99Lwin32clientSmiley Surprisedrdinal2299+0x57B07

6F6CF4DD  0BE3ECA8  mso99Lwin32clientSmiley Surprisedrdinal1507+0x149

35                       The SAS System

                                       15:27 Friday, May 5, 2017

 

6F6CF3F7  0BE3ED1C  mso99Lwin32clientSmiley Surprisedrdinal1507+0x63

6F6B7A6F  0BE3ED2C  mso99Lwin32clientSmiley Surprisedrdinal338+0xE44

6F6B75B8  0BE3ED58  mso99Lwin32clientSmiley Surprisedrdinal338+0x98D

6F6B99FD  0BE3ED74  mso99Lwin32clientSmiley Surprisedrdinal1412+0x20

69397496  0BE3EFD0  olmapi32:HrGetDefaultStoragePathW+0x23C

693973A0  0BE3EFE4  olmapi32:HrGetDefaultStoragePathW+0x146

693AB93D  0BE3F00C  olmapi32:FShouldUseMsoAuth+0x195

693AB8DD  0BE3F034  olmapi32:FShouldUseMsoAuth+0x135

687B120D  0BE3F04C  contab32:ABProviderInit+0x68

693AB3C7  0BE3F0A8  olmapi32:HrReadAutodiscoverXmlFile+0x3D3

693AACA7  0BE3F13C  olmapi32Smiley FrustratedcCopyProps+0x6DD

693A9C1D  0BE3F1E0  olmapi32:LINKEDLIST_AddToFront+0x4380

36                       The SAS System

                                       15:27 Friday, May 5, 2017

 

693A16EA  0BE3F250  olmapi32:MAPIGetInitInfo+0x56C

693A0EA8  0BE3F298  olmapi32:MAPILogonEx+0x159

696AB928  0BE3F318  olmapi32:MAPIResolveName+0xC9A

696ABBFA  0BE3F338  olmapi32:MAPILogon+0x33

586C60B3  0BE3F360  MSMAPI32:MAPILogon+0x71

58FF9688  0BE3F394  MAPI32:MAPILogon+0xB6

5BEA71CB  0BE3F538  sasvmail:hxeinit_ui+0x1017B

5BE970C0  0BE3F550  sasvmail:hxeinit_ui+0x70

5BE94074  0BE3F674  sasvmail:tkvercn1+0x3034

5BE91A7C  0BE3F6A8  sasvmail:tkvercn1+0xA3C

039B5F07  0BE3F728  sasxkern:tkvercn1+0x64EC7

668A4F7D  0BE3F8E8  sasdsx:tkvercn1+0x13F3D

37                       The SAS System

                                       15:27 Friday, May 5, 2017

 

668A1512  0BE3F914  sasdsx:tkvercn1+0x104D2

668913A4  0BE3F940  sasdsx:tkvercn1+0x364

66A45598  0BE3F950  sasds:tkvercn1+0x4558

66A443B2  0BE3FF28  sasds:tkvercn1+0x3372

02BF576C  0BE3FF74  sashost:Main+0xE4FC

02D06038  0BE3FF88  sashost:Main+0x11EDC8

7650336A  0BE3FF94  kernel32:BaseThreadInitThunk+0x12

77E79902  0BE3FFD4  ntdll:RtlInitializeExceptionChain+0x63

77E798D5  0BE3FFEC  ntdll:RtlInitializeExceptionChain+0x36

 

 


Accepted Solutions
Solution
‎05-12-2017 03:10 PM
Occasional Contributor
Posts: 12

Re: Error sending email programmatically from SAS EG when updated to MS Office 2016

I finally have a solution for our problem sending email from SAS EG through MS Office 2016. The solution does not make any logical sense to me but it works. We only had to remove one line of code for the program to work correctly with Office 2016. Here is the line of code:

 

libname excellib clear;

 

This code has nothing to do with the email at all. That libname was used in conjunction with a proc import datastep in a different process flow to read in some Excel files and the libname was cleared after the files were imported. It worked fine with Office 2013 but it caused SAS to crash using Office 2016.

View solution in original post


All Replies
Grand Advisor
Posts: 10,218

Re: Error sending email programmatically from SAS EG when updated to MS Office 2016

It may help someone diagnose the problem if you can provide an example of the code that sends the email.

Very likely is that Windoze has changed something such as not allowing SMTP or other option that was possible previously.

Occasional Contributor
Posts: 12

Re: Error sending email programmatically from SAS EG when updated to MS Office 2016

I did not post the code before because it has not changed. Here it is:

 

filename outbox email 'email1@somewhere.com';

data _null_;

file outbox

 

TO= ('email1@somewhere.com' 'email2@somewhere.com')

CC= (&CC_Email.)

SUBJECT= " HRMS Data Transfer: &TCODE "

;

put ' Greetings, ';

put ' ';

put " Data for &TCODE is ready for transfer. ";

put ' ';

put " For Analyte Group(s): &CLASS_VALUES ";

put ' ';

put " From Instrument: &INSTR_ID ";

put ' ';

put " First Run: &MinRun ";

put ' ';

put " Last Run: &MaxRun ";

put ' ';

put " Instrument Operator: &OPERATOR ";

put ' ';

put " HRMS Data Integrator: &MS_INTEGRATOR_ID ";

put ' ';

put ' ';

put " [E-mail from SAS EG sent "

" %sysfunc(date(),weekdate17.), %sysfunc(time(),time5.)] ";

run;

Grand Advisor
Posts: 10,218

Re: Error sending email programmatically from SAS EG when updated to MS Office 2016

You likely need to check your system settings for EMAILSYS EMAILDLG and possibly any or all of EMAILHOST, EMAILAUTHPROTOCOL, EMAILID, EMAILPORT and EMAILPW.

With a new Office install your IT folks may have changed things related to how SAS interacts with the email system and the old settings set for the previous version aren't compatible. The options will need to be modified in the SAS configuration, either your settings or the config.sys file. These are not changeable during a SAS session.

Occasional Contributor
Posts: 12

Re: Error sending email programmatically from SAS EG when updated to MS Office 2016

Thank you for this suggestion. It will probably take me a little while to see if this fixes the problem but I will report back as soon as I am able to test it.

Solution
‎05-12-2017 03:10 PM
Occasional Contributor
Posts: 12

Re: Error sending email programmatically from SAS EG when updated to MS Office 2016

I finally have a solution for our problem sending email from SAS EG through MS Office 2016. The solution does not make any logical sense to me but it works. We only had to remove one line of code for the program to work correctly with Office 2016. Here is the line of code:

 

libname excellib clear;

 

This code has nothing to do with the email at all. That libname was used in conjunction with a proc import datastep in a different process flow to read in some Excel files and the libname was cleared after the files were imported. It worked fine with Office 2013 but it caused SAS to crash using Office 2016.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 195 views
  • 0 likes
  • 2 in conversation