BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
tsky
Calcite | Level 5

Hello all,

 

I am wondering whether someone can help me with this.

 

I am running following macro, but always show more positional parameters found than defined and no any procedure was run;

 

%macro median(dsn, catvar, var, mvar);

proc univariate noprint data=&dsn; where &catvar=1; var &var; output out=apctls3_1 pctlpts=50 pctlpre=p_ pctlname=p50_1; run;

proc univariate noprint data=&dsn; where &catvar=2; var &var; output out=apctls3_2 pctlpts=50 pctlpre=p_ pctlname=p50_2; run;

proc univariate noprint data=&dsn; where &catvar=3; var &var; output out=apctls3_3 pctlpts=50 pctlpre=p_ pctlname=p50_3; run;

data median; merge apctls3_1 apctls3_2 apctls3_3; run;

data _null_;set median; call symput('M1',p_p50_1); call symput('M2',p_p50_2); call symput('M3',p_p50_3); run;

data &dsn; set &dsn;

if &catvar=1 then &mvar=&M1; else if &catvar=2 then &mvar=&M2; else if &catvar=3 then &mvar=&M3; run;

%mend median;

%tertile(a1, frtsummcat3, frtsumm, frttry2);

 

ERROR: More positional parameters found than defined.

 

Thanks

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

What is the definition of the macro %TERTILE?

You show the definition for a macro MEDIAN (not a best practice to name a macro by a statistic function call) but not not TERTILE.

View solution in original post

2 REPLIES 2
ballardw
Super User

What is the definition of the macro %TERTILE?

You show the definition for a macro MEDIAN (not a best practice to name a macro by a statistic function call) but not not TERTILE.

tsky
Calcite | Level 5

Thanks very much, such a silly mistake, costed my two hours

 

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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