Chapter Contents

Previous

Next
SAS Macro Language: Reference

Introduction

This chapter describes a typical pattern that the SAS System follows to process a program. These concepts are helpful in understanding how the macro processor works with other parts of the SAS System. However, they are not required for most macro programming. They are provided so that you can understand what is going on behind the scenes.

Note:   The concepts in this chapter present a logical representation, not a detailed physical representation, of how SAS software works.  [cautionend]

When you submit a program, it goes to an area of memory called the input stack. This is true for all program and command sources: the Display Manager, the SCL SUBMIT block, the SCL COMPILE command, or from batch or noninteractive sessions. The input stack shown in Submitted Programs are Sent to the Input Stack contains a simple SAS program that displays sales data. The first line in the program is the top of the input stack.

Submitted Programs are Sent to the Input Stack

[IMAGE]

Once a program reaches the input stack, SAS transforms the stream of characters into individual tokens. These tokens are transferred to different parts of the SAS System for processing, such as the DATA step compiler, the macro processor, and the SAS procedures. Knowing how SAS recognizes tokens and how they are transferred to different parts of the SAS System will help you understand how the various parts of the SAS System and the macro processor work together and how to control the timing of macro execution in your programs. The following sections show you how a simple program is tokenized and processed.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.