Help using Base SAS procedures

Condition to execute proc

Reply
N/A
Posts: 0

Condition to execute proc

Hello,

I need help in this situation.

I need a condition before and out the proc, if the condition is true, run a proc, else skip.

Can someone help me?

Exemple:

IF &VAR. = 1
PROC SQL;
SELECT * FROM TABLE;
QUIT;
Super Contributor
Posts: 359

Re: Condition to execute proc

Posted in reply to deleted_user
%macro chkrun( var);
%if &var = 1 %then %do;
PROC SQL;
SELECT * FROM TABLE;
QUIT;
%end;
%mend;

%chkrun( 1 );
N/A
Posts: 0

Re: Condition to execute proc

Thanks!

It's work very well.
Ask a Question
Discussion stats
  • 2 replies
  • 108 views
  • 0 likes
  • 2 in conversation