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);