Introduction to SAS programming

SAS programming has two basic building blocks

  1. DATA Step programming.

  2. SAS Procedures.

Any SAS application will have these components involved. DATA step programming involves row by row processing on input data; while SAS Procedures on the other side have variety of applications. Various SAS procedures like PROC FREQ, PROC MEANS, PROC SUMMARY etc. work on whole data at a time and try find out different aspects like mean, max, average etc. from it. On the other hand some SAS procedures merely process the data e.g. PROC SORT, PROC APPEND etc. Few of the other SAS procedures are used sometimes to produce end results like PROC PRINT, PROC REPORT, PROC EXPORT etc.

More interestingly SAS also supports SQL via PROC SORT and thereby making it easier to understand for SQL users.

Please note that there can multiple ways to reach the same end result. Hence many of those Procedures or DATA steps can be used interchangeably.

Another angle of looking into SAS programming is following a sequence of data movement through Application.

  1. Data sourcing/generation

  2. Data processing

  3. Data exporting / Generating required outputs end results

Following table will help you understand this.