BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

Hello

What is the difference between way1 and way2?

In way1 written %macro RRR(N=);

In way2 written %macro RRR(N);

Is it positional parameters in both ways?

What is thwa way to see in the log the actual code that the  processor see?

 

 

/****Way1***/
%macro RRR(N=);
%if &N. > 10 %then %do;
proc means data = sashelp.class MEAN;
var age;
run;
%end;
%else %put No calculation;
%mend;
%RRR(N=19);

/****Way2***/
%macro RRR(N);
%if &N. > 10 %then %do;
proc means data = sashelp.class MEAN;
var age;
run;
%end;
%else %put No calculation;
%mend;
%RRR(N=19);

 

 

3 REPLIES 3
japelin
Rhodochrosite | Level 12
In way1, you must always write "keyword parameter name & =", but it does not matter if the position is swapped when there are two or more parameters. You can also set an initial value.
In way2, the positional parameter names can be omitted, but if there are two or more parameters, they must be written in the order in which they are defined.
ChrisNZ
Tourmaline | Level 20

Is it positional parameters in both ways?

positional parameter means there's no = sign

 

 

What is thwa way to see in the log the actual code that the processor see?

See option MPRINT

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 3 replies
  • 739 views
  • 0 likes
  • 4 in conversation