Help using Base SAS procedures

Sas Stop Valve?

Accepted Solution Solved
Reply
Occasional Contributor DDX
Occasional Contributor
Posts: 10
Accepted Solution

Sas Stop Valve?

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!


Accepted Solutions
Solution
‎05-07-2013 06:15 PM
Super User
Posts: 10,538

Re: Sas Stop Valve?

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


All Replies
Super User
Posts: 5,260

Re: Sas Stop Valve?

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
Trusted Advisor
Posts: 1,630

Re: Sas Stop Valve?

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.

Occasional Contributor DDX
Occasional Contributor
Posts: 10

Re: Sas Stop Valve?

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

Solution
‎05-07-2013 06:15 PM
Super User
Posts: 10,538

Re: Sas Stop Valve?

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.

Occasional Contributor DDX
Occasional Contributor
Posts: 10

Re: Sas Stop Valve?

This is perfect! And now so obvious. Thanks

N/A
Posts: 1

Re: Sas Stop Valve?

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 

Super User
Posts: 10,538

Re: Sas Stop Valve?

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

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 390 views
  • 6 likes
  • 5 in conversation