DATA Step, Macro, Functions and more

In PC SAS 9.4, how to leave the rest of code not to be executed

Reply
Regular Contributor
Posts: 241

In PC SAS 9.4, how to leave the rest of code not to be executed

Hello everyone,

 

I know "ENDSAS" can stop and exit SAS immedietely. but I don't want SAS exit,I just want it stop execute the rest code.

Is there any other function code I can use during the code line to stop execute the rest lines of codes?

 

Thanks!

Super Contributor
Posts: 438

Re: In PC SAS 9.4, how to leave the rest of code not to be executed

[ Edited ]
Posted in reply to GeorgeSAS

You can turn on syntax check mode. SAS will still go over your code but not execute anything (apart from data_null_ steps). Look at the options SYNTAXCHECK and DMSSYNCHK. Consider adding NOREPLACE and OBS=0 to be safe.

 

Good luck,

- Jan.

Super User
Posts: 11,343

Re: In PC SAS 9.4, how to leave the rest of code not to be executed

Posted in reply to GeorgeSAS

In a datastep you can conditionally use the STOP to halt the step:

 

If <condition> then stop;

Super User
Posts: 10,020

Re: In PC SAS 9.4, how to leave the rest of code not to be executed

Posted in reply to GeorgeSAS
I would add  /*  between two type of code .
E.X.

data x;
 ....
run;
proc print;

/*

proc print;





And you will find only the code before /* be executed .


Ask a Question
Discussion stats
  • 3 replies
  • 185 views
  • 0 likes
  • 4 in conversation