BookmarkSubscribeRSS Feed
Sheeba
Lapis Lazuli | Level 10

Hi,

 

I am planning to execute the below program . The purpose of the program is to extract the list of users from a sas dataset and to send the email to them .I would like to insert hyperlink in the highlighted areas

 

  1. Xxxxxxteam : I am looking for some hyperlink to be embedded here so that user will be able to email the xxxx team once they click here.
  2. IT Help desk : same thing here

Appreciate the responses.

 

Regards,

Sheeba

 

options mprint mlogic symbolgen;

 

data work.contact;

length First_Name $300 Last_Name $300 Email_Address $300 Manager_Name $300 Manager_Email $350;

set email_list;

run;

 

%macro sendreports(first_name, last_name,email);

      filename outbox EMAIL;

 

      data _null_;

           FILE outbox bcc=("&email.")

              From ='xxxx@yyyy.com'

           subject="Action Required:  Complete the 2022-2023 training";

           file outbox;

           put;

           put "Three weeks have passed since you were enrolled in the training. Completion of this course, by the deadline of December 31, 2022, demonstrates that you understand the policies and ensures you will retain your access  without disruption.";

           put;

              put;

           put " The course is expected to take no more than 20 minutes.  To locate the course:";

           put;

              put;

           put "•        Log on to ";

           put "•        From Employee Actions select My Learning";

           put "•        Click the Title column to sort learning alphabetically by title";

           put "•        Locate 2022-2023 yyyy course from the list of available courses and click the course link to begin";

           put;

              put;

              put "Please email the XXXXXXX Team if you have any questions or concerns. If you have trouble with your username or passwords, with accessing Source, or with launching the course, please contact the IT Help Desk.";

           put;

           put;

 

          

      run;

 

%mend sendreports;

proc sort data=email_list;

by Email_Address;

run;

 

data _null_;

      set contact;

      by email_address;

 

      if first.email_address then

           do;

                 call execute(cats('%sendreports(',first_name,',',last_name,',',email_address,')'));

           end;

run;

 

 

 

 

Regards,

Sheeba 

2 REPLIES 2
Reeza
Super User

Change the email content type to HTML and then use HTML to embed the link correctly.

That will necessitate changes to your other sections though. 

 

https://stackoverflow.com/questions/51890035/include-link-to-a-file-location-in-an-e-mail-in-sas

 

 

Sheeba
Lapis Lazuli | Level 10

Thank you very much for the reply Reeza.

 

I will try switching it to HTML and making changes. It looks like the hyperlink might not work with existing program though right.

Regards,

Sheeba

SAS Innovate 2025: Register Today!

 

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

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
  • 2 replies
  • 1141 views
  • 1 like
  • 2 in conversation