Amadeus cookies policy - you'll see this message only once.

Amadeus use cookies on this website. They help us to know a little bit about you and how you use our website, which improves the browsing experience and marketing - both for you and for others. They are stored locally on your computer or mobile device. To accept cookies, continue browsing as normal. Or, go to the privacy policy for more information.

Syntax Checking SAS Programs

To check the syntax of a data step or procedure without actually running the code, add a CANCEL keyword to the end of the RUN statement, as shown in the following example:

    data work.test; 
       infile 'external file'; 
       input a b c; 
    run cancel; 
proc print data=work.test; run cancel;

Each step will validate the "tokens" in your syntax and report any errors to the SAS log. SAS will then stop processing that step, therefore no data are read.

Commonly, a macro variable is created that is resolved in place of the CANCEL keyword. This allows a global method of turning syntax checking on or off. This is demonstrated with the following example:

    %let debug=CANCEL;
%*let debug=;
data work.test; infile 'external file'; input a b c; run &debug.;
proc print data=work.test; run &debug.;