DATA Step, Macro, Functions and more

DO and %DO

Reply
Occasional Contributor
Posts: 5

DO and %DO

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.

Super User
Posts: 5,091

Re: DO and %DO

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.

Super User
Posts: 10,532

Re: DO and %DO

%DO is used to control MACRO logic within a defined macro (%macro name; .... %mendSmiley Wink. 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.

SAS Super FREQ
Posts: 8,743

Re: DO and %DO

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
Ask a Question
Discussion stats
  • 3 replies
  • 199 views
  • 2 likes
  • 4 in conversation