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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 719 views
  • 1 like
  • 4 in conversation