BookmarkSubscribeRSS Feed
Taliah
Quartz | Level 8

Hello, I have a set of sas programs that run in sequence. The users run them through another program containing -

%incllude "/path/program1.sas"; %incllude "/path/program2.sas"; etc.

In some of the programs I need to be able to stop that program and all following programs from running, based on an if statement (e.g., when a variable is above a certain limit). How can that be done? Thank you.

 

 

2 REPLIES 2
ballardw
Super User

Is the "value" in a data set or a macro variable? Is the IF going to be in data step code or for macro variables between procedures/data steps?

 

Are the jobs run interactively or in batch?

 

The ABORT statement in a data step is conditional (can be run on a value encountered) and has options ABEND (halts SAS), Cancel and Return. Each behaves a bit differently depending on run environment, interactive or batch and possibly if encountered in an %include file. You can also set a condition code.

 

Taliah
Quartz | Level 8

Thank you. The value is a macro variable. The jobs are run in batch.

 

"You can also set a condition code." - what do you mean by that?

 

"Is the IF going to be in data step code or for macro variables between procedures/data steps?" I can set the if statement any way that will work. I compute the value of the macro variable, based on it I will need to stop the programs from running. Now I have that macro variable. I can write an IF statement in a data step, or another way if that will work better. 

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.

SAS Training: Just a Click Away

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

Browse our catalog!

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