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.

BASUG is hosting free webinars Next up: Mark Keintz presenting History Carried Forward, Future Carried Back: Mixing Time Series of Differing Frequencies on May 8. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
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

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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