BookmarkSubscribeRSS Feed
Ajitesh
Calcite | Level 5

Hi,

 

I have 10000 account numbers and i just want to pass all the account numbers one by one through SAS Macro.  I am using this query-

 

proc sql;

create table abc

select * from xyz where account in (want to pass accounts through SAS Macro);

quit;

 

 

 

4 REPLIES 4
PaigeMiller
Diamond | Level 26

Assuming the account numbers are in a SAS data set which I will name HAVE, and the variable is named ACCOUNTID

 

proc sql;
create table abc
select * from xyz where account in (select distinct accountid from have);
quit;

No macro needed.

--
Paige Miller
Ajitesh
Calcite | Level 5

Thanks for your reply but you did not understand my question. I want to create macro and want to pass all the accounts through macro. And i know proc sql query.

PaigeMiller
Diamond | Level 26

So please provide a little more information ... what is this macro supposed to do? Can you show, as an example, non-macro code that works for one account number?

--
Paige Miller
Tom
Super User Tom
Super User

This sounds like an XY problem. http://xyproblem.info/

 

Please explain what you are trying to do (the larger picture). Explain in more detail what do you want this macro to do? How does being able to do that help with the larger problem?

sas-innovate-wordmark-2025-midnight.png

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!

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
  • 4 replies
  • 742 views
  • 1 like
  • 3 in conversation