SAS Tutorial | How to Automate Emails Using SAS

Sdílet
Vložit
  • čas přidán 21. 08. 2024

Komentáře • 61

  • @jasonhehe
    @jasonhehe Před 3 lety +4

    Thank you majestic creature!

  • @anguraj1401
    @anguraj1401 Před 2 lety +1

    Nice ..Thanks for posting..

  • @fungaijani
    @fungaijani Před 2 lety +1

    Great video man...

  • @bierimquartier4358
    @bierimquartier4358 Před 2 lety +1

    Thanks, nice one.

  • @thepineweaver
    @thepineweaver Před 3 lety +1

    Thanks!

  • @douglasmorales3789
    @douglasmorales3789 Před 3 lety +1

    great tips.

    • @SASUsers
      @SASUsers  Před 3 lety

      We're glad you enjoyed the content!

  • @kashmirshadows8150
    @kashmirshadows8150 Před 3 lety +1

    Thank you

  • @zefur321
    @zefur321 Před 2 lety +1

    I retrieve mail address from user accounts in SMC and dynamic send mail to related users.
    I also use Xcmd (in stored process) to compress and split file (using winRAR app) before attached file if the size is greater than x MB limited by mail server.

  • @yoannkouame3282
    @yoannkouame3282 Před 3 lety

    so great!!! thanks

  • @MasterofPlay7
    @MasterofPlay7 Před 3 lety +2

    do you have the codes so we can examine it?

    • @SASUsers
      @SASUsers  Před 3 lety

      Thank your inquiry! We are checking on this for you!

    • @Pistolero891
      @Pistolero891 Před 3 lety +2

      Second this comment, thanks

    • @SASUsers
      @SASUsers  Před 3 lety +1

      Link to code is now added in the description!

  • @srinubabu1871
    @srinubabu1871 Před 3 lety

    Great Video. a lot of information. Could I Know where can getThe Code?

    • @SASUsers
      @SASUsers  Před 3 lety

      Srinu, thank you for your inquiry! We are checking on this for you!

    • @SASUsers
      @SASUsers  Před 3 lety +1

      Link to code is now added in the description!

  • @magical_mary8799
    @magical_mary8799 Před 3 lety +1

    this is awesome, can you please share a small code/tutorial just on sending email via SAS where email id's are in excel sheet without too many macros as this one has. just import a excel sheet that has email id and then send email. I am continuously getting stuck. Thanks god bless you :)

    • @SASUsers
      @SASUsers  Před 3 lety

      Checking on this for you!

    • @magical_mary8799
      @magical_mary8799 Před 3 lety

      @@SASUsers thank you !! do u know the loop or concatenate function where I can combine multiple observations of a particular variable to one single cell/variable using sas.

    • @magical_mary8799
      @magical_mary8799 Před 3 lety +1

      this will help to combine all email id's in one row and then instead of shooting multiple emails i can send only one email with all id's in "TO"

    • @SASUsers
      @SASUsers  Před 3 lety

      We're sorry that we are unable to address your two questions- both are the kind of question that are frequently posted to the SAS Community Forum or asked of Tech Support. In either case, you would need to provide an example of the data you're starting with, provide an example of your desired result and then post the code you've tried. We suggest starting here: 2.sas.com/6050yMp7a or the Community Forum for SAS Programming, here: 2.sas.com/6051yMp7x

  • @jgarces2011
    @jgarces2011 Před 2 lety

    I am interested in automating some reports to run in SAS EG along with checking for a file upload into a directory before running the SAS code for the report. Is there any videos in reference to this that I can watch and learn from that you know of? I do like the feature of sending out emails with the reports as well and also a text message to verify that it ran. I will try this out. Thank you.

    • @SASUsers
      @SASUsers  Před 2 lety

      Jaime, thank you for your inquiry! We are checking into this for you!

    • @SASUsers
      @SASUsers  Před 2 lety

      Hi Jaime,
      The code in the video should work with SAS Enterprise Guide, when modified for your purposes. There are not any videos about specifically automating emails in Enterprise Guide. Most Enterprise Guide users will need to collect information from their Enterprise Guide administrator to make sure that their SAS server is configured correctly with the right options for allowing email. So if you do not have permissions to change Enterprise Guide start-up options in relation to sending emails, then you will need to ask your SAS Administrator to do the needed setup before you could run any code, such as that shown in the video. Unfortunately, we cannot provide detailed Technical Support in this feedback area, so if you or your Administrator needs to work with Tech Support, then fill out the form at this link: 2.sas.com/6050Jwjgg to open a track with them.
      Also, the video author makes use of the SAS Macro Facility in this code. So, if you are new to using SAS Macro variables and SAS Macro programs, you might want to look at some of the SAS Macro Language training we have. There are 2 courses on the public schedule, as shown on the Programming learning path, here: 2.sas.com/6051Jwjg9 -- just click on the course titles for SAS Macro Language 1 and SAS Macro Language 2 in order to read the full description of the course. You also asked about checking for the existence of a file. this can be done one of several ways, depending on whether your Enterprise Guide Administrator permits users to issue operating system commands. You could either use operating system commands to test the existence of an uploaded file or you could use the FILEEXIST function, as shown in this Tech Support note: 2.sas.com/6052Jwjgi .
      === ===

  • @KaranKaran-uz6sz
    @KaranKaran-uz6sz Před 3 lety

    I have a question what is a linker program which creates library refrences (sdtm,adam,macros folder)

    • @SASUsers
      @SASUsers  Před 3 lety

      Thanks for your inquiry! As we indicated on some of your other messages, if you have more detailed questions it is best to work with technical support.

  • @nadeemies
    @nadeemies Před 2 lety

    Thank you for creating this. Only issue I am having is that the file is corrupt when opening from the email. When I download the xlsx from SAS folder and open it's fine. Also the email attached file has a filesize indicating there is data... Any idea what this could be?
    Using following simplified code in %SendReports:
    attach=("&path/Report.xlsx");

    • @SASUsers
      @SASUsers  Před 2 lety

      Thank you for asking, Nadeem! We're checking on this and will get back to you soon!

    • @nadeemies
      @nadeemies Před 2 lety

      @@SASUsers Hi! Just an update. I figured it out. It's because my SAS grid is on a linux environment. So I had to remove the library xlsx and instead do a proc export and then define content_type in the attachment field in the macro. All good now!

    • @SASUsers
      @SASUsers  Před 2 lety

      Wonderful! Thanks for letting us know, Nadeem, and excellent work figuring it out! 👍

  • @ARjunSIngh-np1fe
    @ARjunSIngh-np1fe Před 2 lety

    I am facing a challenge since long .. couldn't find solution.... Please help ... How can we add snapshot of a report on mail body using sas

    • @SASUsers
      @SASUsers  Před 2 lety +1

      Arjun, thank you for your inquiry! We are checking on this for you!

    • @ARjunSIngh-np1fe
      @ARjunSIngh-np1fe Před 2 lety

      @@SASUsers thank you sir, appreciate your quick response

    • @SASUsers
      @SASUsers  Před 2 lety

      ARjun, Hi:
      We cannot provide detailed Tech Support here in the CZcams feedback area. To send mail, you need to work with your Administrator to determine that the right startup options for emailing are sent. It also makes a difference what your email restrictions regarding the email format you are allowed to send. For example with HTML or Plain Text format for emails, you would usually have to attach the image as a separate file attachment. Some mail administrators restrict program-generated emails to Plain Text format, so all of your additional snapshots, images or reports would need to be sent as an attachment to the email. The SAS email engine allows an ATTACH= option so you can easily attach files to a mail.
      To get more in-depth help, you can open a track with SAS Tech Support by filling out the form at this link: 2.sas.com/6054KYhI8 . Or you can post questions about email in the SAS Community Forums. Many times you'll find useful suggestions like this one: 2.sas.com/6056KYhIE about emailing in the Community Forums.
      === ===

  • @pawedukata8953
    @pawedukata8953 Před 3 lety

    Hello,
    Ok. We know how to send mail with SAS with some text as an electronic signature. How we can send email with a signature as a text and as an image? Please answer me or show me where I could find such information or who can I ask about it whereas versions of SAS are base 9.2 and 9.4. There are also some questions resulting from question one. Greetings

    • @SASUsers
      @SASUsers  Před 3 lety +1

      Pawel, thank you for your inquiry! We are checking on this for you!

    • @SASUsers
      @SASUsers  Před 3 lety

      There is an upcoming #SASWebinar on this topic that might interest you 2.sas.com/6054yqoiM There are a lot of email settings that need to be configured by the system admin, so we would recommend that you work with technical support or post questions under communities for more individualized help. SAS Programming Community would be a great place to start 2.sas.com/6055yqoi3

    • @SASUsers
      @SASUsers  Před 3 lety

      You may also find some #SAStips. Note functionality wasn't available until 9.4M2 as indicated in this blog, so if you are asking to do this in SAS 9.2, it was not a functionality of the software at that time, and you would have to upgrade to at least 9.4M2 or later. See 2.sas.com/6055yqxeZ

  • @naveensandilya23
    @naveensandilya23 Před rokem

    How do we change the font (like bold italic) in the email body?

    • @SASUsers
      @SASUsers  Před rokem

      Thank you so much for your inquiry! We are checking on this for you!

    • @SASUsers
      @SASUsers  Před rokem

      You can create emails using SAS by using PUT statements or with FPUT/FWRITE, but changing fonts and styles is easy, since you use regular html CSS style statements.
      For example, the first highlighted line below sets the style for the entire body of the email - in the 2nd highlighted line it’s setting specific style for the title: bolds the text - setting italics is .
      filename mailit email
      from = Tracy@sas.com
      to = (Tracy@sas.com)
      replyto = (Tracy@sas.com)
      subject = "Private Events Sold or Offered on &subject"
      type='text/html';
      data _null_;
      do i=1 to &count;
      set report_all;
      by order service_start_date;
      if i=1 then
      do;
      fid = fopen('mailit','o');
      rc = fput(fid,"" ||
      "" ||
      "Prviate Events Sold or Offered on &title");
      rc = fwrite(fid);
      rc = fput(fid,"" ||
      As this forum isn't ideal for posting code or screenshots, please send email to curriculumconsulting@sas.com if you have any questions. We hope this helps!

    • @naveensandilya23
      @naveensandilya23 Před rokem

      @@SASUsers Thank you so much for your response! Its working!!

    • @SASUsers
      @SASUsers  Před rokem

      Awesome! So glad we could help!

  • @joao2106
    @joao2106 Před 2 lety

    I do have 2 questions
    1 imagine that today ia friday 22pm and i finished the e-mail rigor nos and i need that to be send on moonday noon how do i supõe-se to this?
    2 i need for those which did not read this e-mail by tuesday i need tô send a SMS tô than

    • @SASUsers
      @SASUsers  Před 2 lety

      Hi there! We're looking into this for you and will follow back up with more info! 👍

    • @SASUsers
      @SASUsers  Před 2 lety

      Hi!
      Here is our Training team's response to this: Unfortunately, we cannot post code or do any kind of Tech Support in this CZcams feedback area. If you need to schedule a batch job on Friday that will send mail on Monday, that is typically the type of program that you write and then use a scheduler to submit. The type of scheduler you use will depend on your operating system and whether your SAS Administrator has turned on the ability to email from within a batch job. The code that you would need to use to do this is too lengthy and without knowing other pertinent information about your configuration, it is impossible to answer. I am not sure whether there is any capability to do your second task (to send an SMS message if the mail is not read by Tuesday.) This is also a question for Tech Support about whether it is possible to track whether someone reads the mail from SAS. We recommend that you open a track with SAS Tech Support and provide them with your site license information so they can help you with the specifics for your operating system and software. To open a track with Tech Support, fill out the form at this link: 2.sas.com/6059yNsQ9 .

  • @reetikasikri1618
    @reetikasikri1618 Před 3 lety

    Can we extract the file from Outlook mail box using sas and use the file?

    • @SASUsers
      @SASUsers  Před 3 lety

      Checking on this for you!

    • @SASUsers
      @SASUsers  Před 3 lety

      That's a whole 'nother topic. You can use a data connector to read Outlook (Exchange) data in SAS Enterprise Guide (see this topic: communities.sas.com/t5/SAS-Programming/Can-SAS-Read-email-inbox/td-p/195431) But for cloud-based email (like Microsoft 365) you would need to use Microsoft Graph APIs. There's a lot to it -- check here: blogs.sas.com/content/sasdummy/2020/07/09/sas-programming-office-365-onedrive/

    • @NEERAJKUMAR389
      @NEERAJKUMAR389 Před 2 lety

      @@SASUsers Thanks for this article. Wanted to know if there is way to send content of any table in body of the mail in same method as above.

  • @baskerwilNL
    @baskerwilNL Před 3 lety

    The SMTP settings are configured in the sasv9. config files and are being setup during a normal 9 deployment. In the email part, I usually have to add content_type="application/xlsx" for xlsx. files to be opened in Outlook. Is there any reason why this sometimes works without, as in this examaple, or sometimes needs to be added?

    • @SASUsers
      @SASUsers  Před 3 lety

      Hello, Asger, and thanks for your question! Will you please clarify which part of the code you're referring to, and the related timestamp in the video? For example, are you asking about the code in line 72 at 7:39?

    • @baskerwilNL
      @baskerwilNL Před 3 lety

      @@SASUsers Hello, yes exactly. I run numerous nightly email distribution jobs and I usually have to add the content_type option when attaching xlsx files, so I was just curious why it’s omitted here.

    • @SASUsers
      @SASUsers  Před 3 lety

      Thanks for clarifying, Asger. We're checking on this for you, and will get back to you when we have more information.

    • @SASUsers
      @SASUsers  Před 3 lety

      Hi Asger: our documentation for Email Options > ATTACH= > CONTENT_TYPE= says "If you do not specify a content type, SAS tries to determine the correct content type based on the filename. For example, if you do not specify a content type, a filename of home.html is sent with a content type of text/html."
      You can find this under Syntax > Email Options in "FILENAME Statement: EMAIL (SMTP) Access Method" here 2.sas.com/6054yy4jg
      We hope that helps. If you have more questions, please let us know!

  • @techwithramsey
    @techwithramsey Před 3 lety

    Where can I download the code?

    • @SASUsers
      @SASUsers  Před 3 lety

      Thanks for your inquiry! We are checking on this for you!

    • @SASUsers
      @SASUsers  Před 3 lety

      Link to code is now added in the description!