BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
alepage
Barite | Level 11

Hello,

I am using a proc http procedure to send information to an API Web Site.  During the SAS code execution, one macro variable name ex; ContactId&i is generated as well as its value.   For 5000 contacts, I will have something like ContactId1 - ContactId5000 and their corresponding string value.

 

I do not want to keep the log file because they are too big. So, I wonder how to gather the macro variable name and value into a dataset where each iteration create a new macro variable and how to update the dataset.

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Consider adding an append before your drop the result data set.

 

proc append base=results data=results&i force;
run;

View solution in original post

4 REPLIES 4
Astounding
PROC Star

SAS is automatically doing this for you.  Take a look at (and copy from if you so choose) dictionary.macros.

alepage
Barite | Level 11
Could you please provide a SAS snippet code that show how to do that
ballardw
Super User

@alepage wrote:
Could you please provide a SAS snippet code that show how to do that

proc sql;
   select * 
   from dictionary.macros
   ;
run;

Will send all of the macro variable information to the result window.

Obviously could create a data set using the Create table <name you want> as syntax.

Could also filter with a Where name is like condition.

 

Reeza
Super User

Consider adding an append before your drop the result data set.

 

proc append base=results data=results&i force;
run;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 4 replies
  • 1246 views
  • 6 likes
  • 4 in conversation