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.

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!
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.

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