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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 549 views
  • 0 likes
  • 2 in conversation