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;

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 667 views
  • 6 likes
  • 4 in conversation