LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (May 2011, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 4 May 2011 06:48:38 -0500
Reply-To:     "Data _null_;" <iebupdte@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Data _null_;" <iebupdte@GMAIL.COM>
Subject:      Re: Batch Email Problem with Microsoft Exchange
Comments: To: "OBrien, Craig" <COBrien@cpsc.gov>
In-Reply-To:  <10E63108D76A9F4DB6ABB9180C351A82300B51ACA2@TONIC.INT.CPSC>
Content-Type: text/plain; charset=ISO-8859-1

If the problem is related to the Windows prompt about sending e-mail you may be able to achieve the desired result using CDO. I don't know what CDO stands for.

This is how I was able to avoid the issue. I could not use such programs as "click yes".

data _null_; length to script filevar command $256; to = catx('@',sysget('USERNAME'),'YourDomain.com');

script = catx('\',pathname('WORK'),'email.vbs'); filevar = script; /* write the script */ file dummy1 filevar=filevar; put 'Const sch="http://schemas.microsoft.com/cdo/configuration/"'; put 'Set myMail=CreateObject("CDO.Message")'; put 'With myMail'; put +3 '.Subject="Sending email with CDO"'; put +3 '.From="YourMailID@YourDomain.com"'; put +3 '.' To=:$quote128.; put +3 '.TextBody="This is a message."'; put +3 '.Configuration.Fields.Item (sch & "sendusing")=2'; put +3 '.Configuration.Fields.Item (sch & "smtpserver")="smtp.YourDomain.com"'; put +3 '.Configuration.Fields.Item (sch & "smtpserverport")= 25'; put +3 '.Configuration.Fields.Update'; put +3 '.Send'; put 'End With'; put 'set myMail=nothing';

/* close the script file by opening another file, not used */ /* without this VBSCRIPT remains open and cannot be used below in the same data set */ filevar = catx('\',pathname('WORK'),'DUMMY2.vbs'); file dummy1 filevar=filevar;

/* look at the script, not necessary but may be useful */ infile dummy6 filevar=script end=eof; do _n_ = 1 by 1 while(not eof); input; putlog 'NOTE: ' _n_ 3. +1 _infile_; end;

/* call the script */ command = catx(' ','cscript //nologo',quote(strip(script))); infile dummy7 pipe filevar=command end=eof; do while(not eof); input; put _infile_; end; stop; run;

On Tue, May 3, 2011 at 4:16 PM, OBrien, Craig <COBrien@cpsc.gov> wrote: > I have this problem that crops up intermittently, and I was wondering if anyone on the list had seen something similar. Basically I have a program I run every week (in batch mode) that gets the past week's data, splits out different subsets, and emails those subsets (as attached word or excel files) to different people in the agency. Every now and then (once every month or two) it just stops in the middle of sending out the emails. The batch mode window stays up, but nothing is getting written to the log. Eventually I have to force SAS to close, rerun the program without sending emails, and send the emails manually. The only error message I get from SAS or Outlook is the one for forcing SAS to close. I'm assuming it's some conflict between the Microsoft Exchange server and SAS, but without any error messages I have no idea what's going on. > > Any ideas? > > Other possibly useful details: I'm on XP, SAS v9.2, sending the emails with a _Null_ datastep and an email filename. I run the program from UltraEdit through a Python program. > > ----- > Craig W. O'Brien > Consumer Product Safety Commission > EPHA (Emerging Hazards) > Room 601-08, (301) 504-7336 > > *****!!! > Unless otherwise stated, any views or opinions expressed in this > e-mail (and any attachments) are solely those of the author and do > not necessarily represent those of the U.S. Consumer Product Safety > Commission. > > Copies of product recall and product safety information can be sent > to you automatically via Internet e-mail, as they are released by > CPSC. To subscribe or unsubscribe to this service go to the following > web page: https://www.cpsc.gov/cpsclist.aspx > *****!!! >


Back to: Top of message | Previous page | Main SAS-L page