BookmarkSubscribeRSS Feed
JovanaUniCredit
Calcite | Level 5

When I want to run this macro:

 

%macro prep_graph(Tab_Input=,stat=,var=);
proc transpose data=&Tab_Input out=&stat._&var._PRE(drop=_name_);
by RatingClassFirstAv;
id Age;
var &stat._&var.;
run;

proc transpose data=&stat._&var._PRE out=&stat._&var._graph
(rename=(_NAME_ = Age));
id RatingClassFirstAv;
run;

proc sql;
create table &stat._&var._graph as
select input(Age, 4.) as Age, *
from &stat._&var._graph ;
quit;

proc sort data=&stat._&var._graph ;
by Age;
run;

proc transpose data=&stat._&var._graph out=&stat._&var._PRE (rename=(_NAME_ = RatingClassFirstAv));
id Age;
run;
%mend prep_graph;

%prep_graph(Tab_Input=Stat, stat=Avg, ,var=PD);

 

I've got an message:

 

WARNING: Apparent invocation of macro PREP_GRAPH not resolved.

ERROR 180-322: Statement is not valid or it is used out of proper order.

 

And when I run everything without macro, it works perfectly.

 

How to resolve it?

1 REPLY 1
Shmuel
Garnet | Level 18

You have entered a missing surplus argument invoking the macro

%prep_graph(Tab_Input=Stat, stat=Avg, ,var=PD);

replace with

%prep_graph(Tab_Input=Stat, stat=Avg,var=PD);

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
  • 1 reply
  • 436 views
  • 0 likes
  • 2 in conversation