BookmarkSubscribeRSS Feed
SeekYourWay
Calcite | Level 5

Hi,

I'm new to SAS macros, but have been trying to follow the logics of the program that I have.

Apparently, the program itself is made up of macros, and it creates a lot of temporary variables.

My question is....can I use proc print to generate a report that shows the values of temporary variables? Normally, when I do proc print, and use the "VAR" statement, it only allows me to choose column names that are in the original dataset columns.

Thanks

6 REPLIES 6
Reeza
Super User

Have you tried running the program with options mprint or mlogic set instead?

Otherwise you'll need to include some explicit %put &my_mvar at different stages to check what you need.

options mprint mlogic;

/*run your code*/

SeekYourWay
Calcite | Level 5

thank you for the reply, however, I am creating a new post to describe my problem at bit more clearly.

Astounding
PROC Star

The simple version:

%put _user_;

That's a short-cut that displays all the macro variables you have created, but omits the automatic macro variables that the software creates for you.  You don't get control like you would with a VAR statement in PROC PRINT.

If you want to see the automatic variables, you can use:

%put _automatic_;

Or if you just want all of them, there's:

%put _all_;

There are one or two more possibilities, but you're most likely looking for the first version (_user_).

Good luck.

SeekYourWay
Calcite | Level 5

thank you for the reply, however, I am creating a new post to describe my problem at bit more clearly.

JasonDiVirgilio
Quartz | Level 8

Options  symbolgen;

...is helpful too when you want the macro var resolution to go to your log without having to do %put statements.

SeekYourWay
Calcite | Level 5

thank you for the reply, however, I am creating a new post to describe my problem at bit more clearly.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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