BookmarkSubscribeRSS Feed
new_sas_user
Calcite | Level 5

What do these two statements Do WITHIN SAS macros? Can these statements be used outside of Macros? Again, is there a helpful site that breaks things down well? I'm still feeling really lost in the SAS pages online.

3 REPLIES 3
Astounding
PROC Star

You have received poor guidance.  Macro language is not something you should spend your time on, when you are a new SAS user.  If you would like, I can give you a dozen topics that would be a better use of your time.

ballardw
Super User

%DO is used to control MACRO logic within a defined macro (%macro name; .... %mend;). It can not be used in open code (out side of a macro).

 

DO is to control code in a datastep and certain computation blocks in procedures such as Proc Report.

Cynthia_sas
Diamond | Level 26
I discuss this and other topics related to the difference between Data Step programming and Macro programs in this paper: https://support.sas.com/resources/papers/proceedings13/120-2013.pdf

cynthia

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

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 3 replies
  • 1420 views
  • 2 likes
  • 4 in conversation