SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Editing and Debugging SAS Programs
Editing SAS Programs


Now that you know how to include a SAS program into the Program Editor, let's review the characteristics of SAS statements and take a look at enhancing the readability of your SAS programs.


SAS Program Structure

Remember that SAS programs are made up of SAS statements.

SAS Statements

Although you can write SAS statements in almost any format, a certain layout enhances readability and enables you to understand the program's purpose. It's a good idea to
  • begin DATA and PROC steps in column one
  • indent statements within a step
  • begin RUN statements in column one
  • include a RUN statement after every DATA step or PROC step.

     data bankacct; 
        infile records;
        input name $ 1-10 accounttype $ 12-20
              deposit 22-25 withdrawal 27-30;
     run;
     proc print; 
     run;
     proc means mean;
        var deposit withdrawal; 
     run;      

Now let's take a look at the Program Editor features that you can use to edit your SAS programs.


back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement