SAS Support
Self Service Support
Assisted Support
Premium Support
Enterprise Support
Logging a Call
Service Levels
Hints and Tips
 

IS THERE A WAY TO CHECK THE SYNTAX OF A STEP PRIOR TO EXECUTING THE STEP?

SAS modules addressed: Base, Data Step/SQL

Yes, use the option 'Cancel' on the 'Run' statement. The CANCEL option terminates the step without executing it and prints a warning message that the step was not executed at the user's request.

For example:


SAS PROGRAM: 

Data happyDays;

  set sasuser.WhereIhavebeen;

  run cancel;



Proc print data=sasuser.WhereIhavebeen (obs=10);

  run cancel;



SAS LOG: 

data happyDays;

7      set sasuser.WhereIhavebeen;

8      run cancel;



WARNING: Data step not executed at user's request.

NOTE: DATA statement used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds



9      proc print data=sasuser.WhereIhavebeen (obs=10);

10     run cancel;



WARNING: The procedure was not executed at the user's request.

NOTE: PROCEDURE PRINT used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds


Did you find this page useful?

If you have any comments or questions, feel free to contact us.



0845 402 9907