BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
saikiran_nemani
Obsidian | Level 7
I need to send emails like
sai@gmail.com kiran@gmail.com

%mac(no=001)
%mac(no=002)

The parameter which was passed 001 the email should go to sai@gmail.com

The parameter which was passed 002 the email should go to kiran@gmail.com

How to code?
1 ACCEPTED SOLUTION

Accepted Solutions
Satish_Parida
Lapis Lazuli | Level 10

Please let us know if it worked for you

data emails;
input emails:$200.;
id=_n_;  /*This is one way of Iding, there are several other ways*/
cards;
sai@gmail.com
kiran@gmail.com
;
run;

%macro mac(no=);
	data _null_;
	set emails;
	where id=&no;
	call symput('email',emails);
	stop;
	run;
	
	%put &=email;
	
	/****Add Email Sending Code Here****/
%mend mac;

%mac(no=1);
%mac(no=2);

View solution in original post

5 REPLIES 5
saikiran_nemani
Obsidian | Level 7
Can you explain
andreas_lds
Jade | Level 19

Read the documentation!

Satish_Parida
Lapis Lazuli | Level 10

Please let us know if it worked for you

data emails;
input emails:$200.;
id=_n_;  /*This is one way of Iding, there are several other ways*/
cards;
sai@gmail.com
kiran@gmail.com
;
run;

%macro mac(no=);
	data _null_;
	set emails;
	where id=&no;
	call symput('email',emails);
	stop;
	run;
	
	%put &=email;
	
	/****Add Email Sending Code Here****/
%mend mac;

%mac(no=1);
%mac(no=2);

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 944 views
  • 1 like
  • 4 in conversation