BookmarkSubscribeRSS Feed
malov0610
Calcite | Level 5


Hello, i need help. If anyone can show me on the data I attached the difference between the data and the macro code.

5 REPLIES 5
Tom
Super User Tom
Super User

You seem to have just attached datasets.

What are you asking for help with?

malov0610
Calcite | Level 5

I would like to understand the difference between data / proc steps and macro steps. I know the syntax, but when I try to write macro code I don't know how to define it exactly. If you can just show me in a simple example on my data.

Kurt_Bremser
Super User

@malov0610 wrote:

I would like to understand the difference between data / proc steps and macro steps. I know the syntax, but when I try to write macro code I don't know how to define it exactly. If you can just show me in a simple example on my data.


There are no "macro steps". The macro preprocessor enables the dynamic creation of any SAS code anywhere in a program.

 

Writing macro code starts with working non-macro code that needs to be expanded to work in different situations, or be used in multiple places.

Quentin
Super User

The purpose of the DATA step (and PROC step) is to process data.

 

The purpose of the macro language is to generate SAS code.  That SAS code is often the code for DATA steps or PROC steps which process data.

 

The macro language is a code generator.  Instead of typing SAS code yourself, you can type macro language code, and then run the macro language code in order to generate SAS code.

Reeza
Super User

Have you take the first SAS e-course? I highly recommend that and its free. 

Otherwise I have a list of curated resources here to teach you specific topics, with macro tutorials towards the end of the list. 

 

https://github.com/statgeek/SAS-Tutorials/blob/master/Base_Certification_Resource_Guide.md

 

 

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
  • 5 replies
  • 1376 views
  • 2 likes
  • 5 in conversation