BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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;
2 REPLIES 2
Flip
Fluorite | Level 6
%macro chkrun( var);
%if &var = 1 %then %do;
PROC SQL;
SELECT * FROM TABLE;
QUIT;
%end;
%mend;

%chkrun( 1 );
deleted_user
Not applicable
Thanks!

It's work very well.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 962 views
  • 0 likes
  • 2 in conversation