BookmarkSubscribeRSS Feed
JasonL
Quartz | Level 8

Can somebody explain what the following statement does?

 

%mBuildLookupTab1(NAME=Region_Code_Conversion,DATASET=MyData.CCAC_LHIN,KEY=Region_ID,OBJ1=Region_Code);

5 REPLIES 5
PaigeMiller
Diamond | Level 26

It executes a SAS macro named %mBuildLookupTab1 (so someone has previously created this macro, and possibly stored it in a location from which it will be called), with arguments NAME, DATASET, KEY and OBJ1 taking on the values shown.

--
Paige Miller
JasonL
Quartz | Level 8

Ok thanks.

Cynthia_sas
SAS Super FREQ

Hi:

  This code is invoking a SAS macro program definition named %mBuildLookupTab1. Someplace, there should be code that has this:

 

%macro mBuildLookupTab1();

 

...... more code .....

 

%mend;

 

The "more code" is what gets executed when the macro program is invoked. Within the parentheses in the macro definition and the macro invocation are macro parameters: NAME, DATASET, KEY, and OBJ1. Inside the %MACRO definition, the parameters are being defined. In the "more code", the macro parameters should be visible as their macro variable equivalents: &NAME, &DATASET, &KEY, and &OBJ1. Without knowing more about what is in the "more code" in the macro definition program, it's nearly impossible to tell what is happening in the macro program when it is executed.

 

  You can turn on

options MPRINT SYMBOLGEN;

 

to see what the macro program is doing when you run it.

 

  Hope this helps,

Cynthia

JasonL
Quartz | Level 8

Thanks a lot Cynthia!

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
  • 495 views
  • 0 likes
  • 4 in conversation