Help using Base SAS procedures

Macro

Reply
N/A
Posts: 0

Macro

Hi Friends,

I am getting an error while substituting values to this macro code. Please let me the error in this code.

%macro cnt_inv(tbl=, vr=, st=, part= , ds=);
PROC SQL;
create table &tbl. as
select count(*) as &vr. from &ds.
where com in (&st.) and (&part.)
group by userid ;
quit;
%mend cnt_inv;

Thanks in Advance
Raj
Contributor
Posts: 32

Re: Macro

Posted in reply to deleted_user
t Message was edited by: Ravi Mantripragada
Contributor
Posts: 32

Re: Macro

Posted in reply to deleted_user
%macro cnt_inv(tbl=, vr=, st=, part= , ds=);
PROC SQL;
create table &tbl. as
select count(*) as &vr. from &ds.
where com in ( (&st.) , (&part.) )group by userid ;
quit;
%mend cnt_inv;
Contributor
Posts: 32

Re: Macro

Posted in reply to deleted_user
OR this should do it.. I think this should work..

%macro cnt_inv(tbl=, vr=, st=, part= , ds=);
PROC SQL;
create table &tbl. as
select count(*) as &vr. from &ds.
where com in (&st. , &part.)
group by userid ;
quit;
%mend cnt_inv;
Contributor
Posts: 32

Re: Macro

Posted in reply to deleted_user
There should not be any period after the name of the macro..

like &UID not &UID.

Where you need to use period after &CUT in the below example.

C:\ ...\&CUT..xls
N/A
Posts: 0

Re: Macro

Ravi ,Thanks for your information !!!
Ask a Question
Discussion stats
  • 5 replies
  • 178 views
  • 0 likes
  • 2 in conversation