Hello, i need help. If anyone can show me on the data I attached the difference between the data and the macro code.
You seem to have just attached datasets.
What are you asking for help with?
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.
@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.
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.
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
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.