BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
DDX
Calcite | Level 5 DDX
Calcite | Level 5

Does anyone else ever accidentally hit run in a program with a long code without anything selected? I've done it and seen it happen a million times. I wonder if anyone knew of a macro/option that I could put at the top of my code that would just abort anything after that command. I know stop all submitted commands in an option but I have to end up re-running my datasets most of the time so it doesn't save too much time. I'm currently just commenting out large tasks but it doesn't really address the issue.

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

This may be a kludge but if there is a data set you don't want to run unless selected:

/*

Data wanttorunamanually;

Statements

....

run;

*/

Then when you want this to run highlight those lines and submit.

Of course I may be misunderstanding the problem.

View solution in original post

7 REPLIES 7
LinusH
Tourmaline | Level 20

You could embed the code you don't want to execute into a macro definition. It will be visible in the log, but not executed.

Data never sleeps
PaigeMiller
Diamond | Level 26

I wonder if anyone knew of a macro/option that I could put at the top of my code that would just abort anything after that command.

You want a statement that can go as the first statement of your code that will prevent any code from executing if you accidentally hit run when nothing is selected. I am not aware of anything like this.

This seems like a double edged sword, because when you do want the whole set of statements to execute, you have to remove or comment out whatever is the first statement.

I prefer cancelling execution via Ctrl-Break (on Windows).

In a macro environment you can use a %goto statement to skip certain code (including as the first executable line of the macro if you want) or %if 0 %then %do; followed by an %end; statement somewhere to comment out blocks of code.

--
Paige Miller
DDX
Calcite | Level 5 DDX
Calcite | Level 5

Thanks!

I guess I've never tried using control break, so I'll start there. I'll look into that macro option, but I didn't want to get too automated because the process I'm skipping is a data step which I'm refining all the time. From what both of you are saying though the macro option seems to be my best bet so far.

Thanks Again

ballardw
Super User

This may be a kludge but if there is a data set you don't want to run unless selected:

/*

Data wanttorunamanually;

Statements

....

run;

*/

Then when you want this to run highlight those lines and submit.

Of course I may be misunderstanding the problem.

DDX
Calcite | Level 5 DDX
Calcite | Level 5

This is perfect! And now so obvious. Thanks

TeamSouthAfrica
Calcite | Level 5

hi i am looking for someone to help me with conbrach alpha on SAS can you help me please. where is it located. i am using 9.4 enterprise. please help 

ballardw
Super User

Please start new threads instead of tacking on to old unrelated threads.

Cronbach's Alpha can be found with the Alpha option of Proc Corr

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 7 replies
  • 1645 views
  • 6 likes
  • 5 in conversation