Macro Facility Overview A. Components of Macro Facility 1. Macro Processor 2. Macro Language B. Macro Language Components 1. Process To understand how SAS uses Macro's, we must look at how SAS processes any statement or job. When we execute jobs in SAS, all SAS statements are read into the input stack, and passed thru the SAS supervisor one token at a time.
Tokens are strings separated by blanks or operators.
The SAS supervisor reads tokens until it receives a semi-colon, which completes a SAS statement. Once the supervisor reads a complete statement, it checks it for syntax, and passes the statement to the wordscanner section of the supervisor. Here, the tokens are examined for their value, ie if the token is a SAS reserve word, user name and type, and passes the tokens on to the compiler. This process continues until a step boundary word is read. Then the SAS compiler compiles the code and executes statements for that step.