Going Under the Hood: How Does the Macro Processor Really Work?

Size: px
Start display at page:

Download "Going Under the Hood: How Does the Macro Processor Really Work?"

Transcription

1 Going Under the Hood: How Does the Really Work? ABSTRACT Lisa Lyons, PPD, Inc Hamilton, NJ Did you ever wonder what really goes on behind the scenes of the macro processor, or how it works with other parts of the SAS system? With the knowledge of the macro processing sequence of events, programmers can better understand how macro processing works Since most macros are generic ones, this particular knowledge can save valuable development, debugging, and validation time This paper will help you to understand the timing of macro processing and its relationship with SAS language processing INTRODUCTION The SAS macro facility is a component of base SAS The macro facility is a tool for text substitution, which reduces the amount of text entered for common tasks The SAS macro facility works in conjunction with base SAS to build and execute programs The macro facility has two main components: The macro processor, which is the portion of the system that does the work and; macro language, the syntax used to communicate with the macro processor The technical aspects are not required for most macro programming, however understanding the concepts of how the macro processor works with other parts of the SAS System can help improve programming productivity The concepts in this paper present a logical representation of macro processing MECHANICS OF MACRO PROCESSING Understanding Tokens When a program is submitted, it goes to an area of memory called the input stack The input stack holds a SAS program while it waits for processing by the word scanner The word scanner is a component that examines the stream of characters from the input stack and assembles them into tokens The area within the word scanner which holds the tokens is called the word queue Tokens are the smallest pieces of information that are meaningful to the SAS language This process is called tokenization The word scanner then determines the destination of the tokens (DATA step compiler, macro processor, SAS procedures, etc) There are four general types of tokens: Literal: A string of characters enclosed in single or double quotation marks my program or my program Numbers: Digits, date/time values and hexadecimal numbers 345, 07JUL04, 0 x Names: A string of characters beginning with an underscore or letter and continuing with letters (words in your programs) Data, _test, linesleft, proc, _n_, if Special: Characters other than letters, numbers or underscore which have meaning to the SAS system / + - * ; $ ( ) & % = The underlying building blocks of a SAS program are the tokens the word scanner creates from your language statements Each word, literal string, number or special character is a token A token ends when the word scanner encounters either a blank space after a token or the beginning of a new token Two special symbol tokens signal the word scanner to send information to the macro processor The ampersand (&) and the percent sign (%) followed by an underscore or character triggers the macro processor to examine the tokens associated with the & or % - -

2 Tokenization of a SAS Program Without Activity In the example below as the word scanner pulls the first token from the input stack it recognizes it as the beginning of the DATA step and triggers the DATA step compiler, which requests more tokens The compiler pulls the tokens from the word scanner and checks the syntax of the tokens It continues to do this until it reaches the end of the DATA step boundary, which in this case is the semicolon after the run statement Figure Word scanner obtains tokens and determines destination SCL Compiler Command DATA Step Compiler data age Word queue data age 3 ( 4 drop 5 = 6 birthdt The word scanner reads the information from the input stack word by word and places the information into the word queue within the word scanner The word queue contains six positions labeled to 6 Word is the top of the queue, while word 6 is the bottom As the word scanner continues to pull from the input stack and place into the word queue, the first word moves to the top of the queue and so on ) ; set demog; age=(visitdt-birthdt)/365; Tokenization of a SAS Program With Activity All SAS programs are compiled and executed in the same manner Once a program is submitted, the statements are held in the input stack and wait for processing by the word scanner The word scanner examines the stream of characters from the input stack, tokenizes them, then determines their destination The appropriate compiler does syntax checking and passes the compiled statements, at boundary steps, on for execution When the word scanner detects a macro trigger, ampersand (&) or percent (%), it sends information and temporarily turns processing over to the macro processor The word scanner interrupts while the macro processor is active As a result, macro language processing occurs after tokenization, but before compilation The macro processor converts the macro language into language statements and places it back to the top of the input stack The word scanner continues by tokenizing the newly built SAS language statements that have been submitted by the macro processor Figures through 5 illustrate the process of tokenization with macro activity SAS creates a symbol table at the beginning of each session to hold in memory automatic and global macro variable values The value of the macro variable is stored in the symbol table for the duration of the SAS session See section Symbol Tables for further detail - -

3 Figure processor and symbol table SCL Compiler Command DATA Step Compiler SAS Automatic variables SYSTIME 09:00 %let file=demog; data age; set &file; age=(visitdt-birthdt)/365; In figure 3 the word scanner starts at the first character in the input stack and recognizes the percent (%) sign as a macro trigger The word scanner turns control over to the macro processor for processing The macro processor removes the %LET statement, and places the entry in the symbol table Figure 3 processor examines the %LET statement and writes to the symbol table % 6 let User-Defined Variables FILE DEMOG file=demog; data age; set &file; age=(visitdt-birthdt)/365; - 3 -

4 When the macro processor is finished, control is turned back over to the word scanner and tokenization resumes In Figure 4, the DATA keyword triggers the DATA Step compiler The word scanner continues to submit tokens until it comes to the macro trigger &FILE The word scanner turns control back over to the macro processor The macro processor concludes that FILE is a macro variable, which exists in the user-defined section of the global symbol table The macro processor replaces the macro variable (FILE) in the input stack with the associated text from the user-defined section of the symbol table (DEMOG) After the text substitution, control is turned back over to the word scanner as shown in Figure 5 The DATA Step compiler continues to request tokens and check syntax If there are no syntax errors in the step, the step is translated into execution The word scanner continues the process until the entire input stack has been read Figure 4 Word scanner resumes tokenization, macro processor substitutes text in input stack DATA Step Compiler data age; set 3 & 4 file User-Defined Variables FILE DEMOG The word scanner recognizes the macro trigger & and turns control over to the macro processor demog; age=(visitdt-birthdt)/365; If the end of the input stack is a DATA step boundary and there are no syntax errors, the compiler compiles and executes the step as shown in Figure 5 SAS then frees the DATA step task Certain user-defined macro variables created within a program remain in the global symbol table for the duration of the SAS session (detail to follow) If the end of the input stack is not a step boundary (eg more statements), the processed statements remain in the compiler until it reaches a boundary in which it executes the statements Figure 5 Word scanner completes processing DATA Step Compiler data age; set demog; age=(visidt-birthdt)/365; run Symbol Table User-Defined Variables FILE DEMOG ;

5 MACRO VARIABLES Basic Concepts of Variables variables are tools that allow you to write reusable programs The length of a macro variable is determined by the text assigned so its length varies with each value it contains variables contain only character data, however there are options to evaluate numbers when needed Depending on the type of macro variable, it will remain the same for the entire SAS session unless explicitly changed Some basic characteristics of macro variables include: Certain macro variables can be referenced anywhere in a SAS program (other than within data lines) variables names must be a valid SAS name (not a reserved SAS word) and start with a letter or underscore They can be used in either open code (defined outside a macro definition) or inside a macro definition or program variables are not dataset variables and do not relate directly to observations in a dataset, they are tools that allow you to write reusable code There are two types of macro variables, automatic and user-defined: Automatic macro variables are defined by the SAS system at the start of each session Most automatic variables contain information about your session, such as date, time when session opened, version, etc User-defined macro variables are defined by the programmer and are specific to the programmers needs Every macro variable has a domain or scope A macro variable s domain determines how values are assigned and how the macro processor resolves references Domains can be nested, and numerous macro variables can be nested and executed within macro programs %macro first(dsout=); SAS code %macro second(var=); SAS code %mend second; Second Domain First Domain Domains or also known as scopes %mend first; SYMBOL TABLES variables are stored in an area of memory known as symbol tables Symbol tables simply hold in memory the macro variable name and its value There are two types of symbol tables, global and local The global symbol table is automatically created at the beginning of each SAS session Global symbol tables contain macro variables that are defined in either open code (outside of a macro definition) or created automatically by the SAS system variables stored in the global symbol table remain the same for the entire SAS session Global macro variables are also available to any part of the SAS session Global macro variables include: All automatic variables (except SYSPBUFF) All macro variables created in open code All macro variables created with %GLOBAL Most macro variables created by the CALL SYMPUT - 5 -

6 Figure 3 Illustration of the User-Defined Variables FILE DEMOG (BEFORE macro processing) %let file=demog; data age; set &file; if age <=50; (AFTER macro processing) data age; set DEMOG; if age <=50; Global macro variables can be created at any time during a SAS session The values of global macro variables may be changed at any point during a session (except for some automatic SAS variables) Exceptions that preclude referencing the value of a global macro variable are: variables that exists in both global and local symbol tables The macro processor will search for the value in the local symbol table first s variables created with the CALL SYMPUT routine in a DATA step cannot be referenced with an & until the program reaches a step boundary Unlike global symbol tables, which are created at the beginning of the SAS session, local symbol tables are created at the time the word scanner identifies the %macro trigger Therefore, user-defined macro variables created within individual macro programs are stored in the local symbol table only during the execution of the macro program Once the macro program ends, the local macro symbol table and variables are deleted s defined in macro programs that are not explicitly defined as global are typically held in a local symbol table During tokenization the word scanner identifies a macro trigger and temporarily turns processing over to the macro processor Key macro language statements help the macro processor identify when to add a variable to the global symbol table or to create a temporary local symbol table Local symbol tables are empty until the macro program creates at least one macro variable The following can create local symbol tables The presence of one or more macro parameters A macro variable created in %LOCAL statements that define macro variables such as %DO, %LET (within a macro program and when a global macro variable with the same name is not already created) Before the macro processor creates or assigns a value to a macro variable it searches the symbol table to see if the variable already exists The process starts with the local symbol table and if necessary moves to the global symbol table It is important to understand the process of how macro variables are assigned and resolved When the macro processor encounters a macro program trigger (%macro), the processor automatically creates the local symbol table and stores the table in an area of memory Consider the following example in Figure 3-6 -

7 Figure 3 Illustration of a Local Symbol Table (Before and After Processing) Global symbol table created at the beginning of SAS session User-Defined Global Variables FILE DEMOG Automatic system variables %LET file=demog in open code %macro triggers the creation of the empty local symbol table Local Symbol Table Local Symbol Table VAR SYSBP Word Scanner (BEFORE macro processing) %macro vitinfo(var=); data vitals; set datavitals(keep=pid visit &var); (AFTER macro processing) data vitals; set datavitals(keep=pid visit SYSBP); %mend vitinfo; %subset(var=sysbp); The macro call %subset(var=sysbp) triggers the macro processor to assign the macro variable value in the local symbol table In Figure 3, the word scanner pulls the code (character by character) from the input stack and begins tokenization Once the word scanner recognizes the %macro statement, it triggers the macro processor to temporarily take over control The macro processor creates a local symbol table As it continues to process the macro program it checks to see if the variables defined exist in the local symbol table If the variables do not exist in the local symbol table, the processor continues to check all domains until it determines if the variables already exist in either another domain or the global symbol table If it finds the macro variable in either a local symbol table or global symbol table it then resolves the variable But what about references to macro variables outside of a macro program that is not defined by a %LET (in open code) or %GLOBAL statement? Since the local symbol table is deleted immediately after execution of the macro program, any macro variable referenced outside of a macro program is no longer able to resolve and issues a warning in the log Take the following example; - 7 -

8 SAMPLE CODE: %macro aegrade(dsout=, var=); data &dsout; set adverse; if &var <=3; %mend aegrade; Because the sample code makes reference to macro variables outside of the macro program, the following warning would appear in the SAS log; WARNING: Apparent symbolic reference VAR not resolved %aegrade(dsout=aesev, var=severity); data ae; set adverse; if &var = ; In order for macro variables to be defined throughout the SAS session the user would need to define the macro variable using the %GLOBAL statement The %GLOBAL statement creates macro variables that are available in all referencing environments Sending Symbol Table Values to the SAS Log During the development of macros, it may be useful to write all or part of the contents of the local and global symbol tables to the SAS log Using either the SAS system option SYMBOLGEN or the %PUT statement with the following options can accomplish this Using %PUT Statement The %PUT statement is part of the macro language and does not need to be part of a DATA or PROC step It only displays text and information about macro variables in the log The %PUT statement can be written as follows: %put &macro_variable_name; To help distinguish it in the log you could add text such as: %put MY MACRO VARIABLE=&macro_variable_name; In addition to writing individual values to the SAS log, there are additional options that allow you to write all macro variables, automatic SAS variables, global or local as well as user macro variables to the log The options along with the %PUT are: _ALL AUTOMATIC GLOBAL LOCAL USER_ lists all defined macro variables regardless of scope lists all automatic SAS variables lists all user-defined global variables lists all user-defined local macro variables defined within the current executing macro lists all user-defined macro variables (global and local) Using the SYMBOLGEN Option When the SYMBOLGEN option is enabled, the results of the resolution of the macro variables are displayed in the log SYMBOLGEN displays the value of a macro variable directly before the statement with the macro variable reference The SYMBOLGEN option helps the user debug macro code, but does display all of the macro variables, where the %PUT statement allows you to selectively display macro variables - 8 -

9 The following statement enables SYMBOLGEN: options symbolgen; %let file=demog; %let tabvar=gender; proc freq data=data&file; table &tabvar; title Frequencies by &tabvar as of &sysday ; SAS LOG: SYMBOLGEN: variable FILE resolves to demog SYMBOLGEN: variable TABVAR resolves to gender 73 proc freq data=data&file; 74 table &tabvar; SYMBOLGEN: variable TABVAR resolves to gender SYMBOLGEN: variable SYSDAY resolves to Monday 75 title "Frequencies by &tabvar as of &sysday"; 76 COMPILING AND EXECUTING MACRO DEFINITIONS s are compiled programs that can be called in a submitted SAS program or from a SAS command prompt In order to compile a macro, a macro definition must be defined The general form of a macro definition is as follows: %macro macro_name; macro code %mend macro_name; Once a macro definition is submitted, the macro processor compiles the definition and produces a member in the WORK session SASMACR catalog The member in the catalog consists of the compiled macro program and text As previously described, when the word scanner detects a macro trigger such as % followed by a non-blank character it turns processing over to the macro processor The macro processor examines the token and recognizes it as a macro definition The macro processor continues to pull tokens from the input stack and compiles them until it reaches the end of the macro definition (%MEND) During macro compilation the macro processor: Creates an entry in the session catalog Compiles and stores all macro program statements for that macro as macro instructions Stores non-compiled items in the macro as text such as: variable references Text written by %PUT statements functions Arithmetic and logical macro expression Figure 4 Example of Compiled vs Text Items %macro sortby(byval=); %if &byval ne %then %do; proc sort data=mydata; by pid &byval; %end; %mend sortby; - 9 -

10 During compilation, if the macro processor identifies a syntax error, the macro processor continues checking the remaining macro code and issues messages for any additional syntax errors The macro processor will not store the macro for execution s that the macro processor compiles but does not store are called dummy macros The following macro definition will be used to illustrate how the macro processor compiles, stores and processes a macro definition Figure 4 How a Definition Gets Compiled User-Defined Variables FILE DEMOG 3 ( 4 keep 5 = 6 pid Catalog vitinfo macro %macro vitinfo(var=); data vitals; set datavitals visit &var); %mend vitinfo; %vitinfo(var=sysbp); SOURCE CODE: %macro vitinfo(var=); data vitals; set datavitals(keep=pid visit &var); %mend vitinfo; %vitinfo(var=sysbp); - 0 -

11 For illustration purposes, the compiled macro appears as the original macro definition in the input stack In actuality the entry would contain compiled macro instructions with constant text Execution of a Compiled execution consists of a series of repetitive actions Once a macro has been compiled and there is a call to a macro (eg %vitinfo), macro execution starts with the macro processor opening the SASMACR catalog to read the appropriate macro catalog entry As the macro processor executes the compiled macro it performs the following actions: Opens the session catalog and creates a local symbol table specific to the compiled macro processor removes tokens for the macro call from the input stack and places any parameter values in the local macro symbol table Executes compiled macro program statements Places non-compiled items back in to the top of the input stack as text Waits for the word scanner to process the text in the input stack Figure 43 to 47 illustrates how the macro processor executes a compiled macro Figure 43 The macro call goes from input stack to word scanner % Catalog sortby macro %macro sortby(byval=); %if &byval ne %then %do; proc sort data=mydata; by pid &byval; %end; sortby; %mend sortby; proc print data=mydata; title Mydata by Gender ; The word scanner examines the input stack and detects % followed by a nonblank character It triggers the macro processor to examine the tokens The macro processor recognizes the %sortby as an entry in the SASMACR catalog and begins to process as follows: - -

12 The macro processor opens the WORK SASMACR catalog and creates a local symbol table specific to the compiled macro and enters a blank entry for BYVAL The macro processor removes the tokens for the macro call from the input stack and enters the value BYVAL in the SORTBY local symbol table 3 Once the parameter values have been added to the local symbol table, the macro processor turns its attention to the compiled macro In this example it encounters the %IF instruction and recognizes the next item will be text containing a condition 4 The macro processor places the text &byval ne back in the input stack ahead of the remaining text in the program 5 The macro processor waits for the word scanner to tokenize the newly generated text Figure 44 The macro program SORTBY continues executing SORTBY Local Symbol Table Local Variables BYVAL GENDER Catalog sortby macro %macro sortby(byval=); &byval ne proc print data=mydata; title Mydata by Gender ; %if &byval ne %then %do; proc sort data=mydata; by pid &byval; %end; %mend sortby; 6 The word scanner resumes and recognizes the ampersand followed by a nonblank character and triggers the macro processor 7 The macro processor examines the token &BYVAL and first searches the SORTBY local symbol table for a matching entry When the macro processor finds the entry, it replaces the macro variable in the input stack with the value GENDER - -

13 Figure 45 The macro program SORTBY continues executing SORTBY Local Symbol Table Local Variables BYVAL GENDER Catalog sortby macro %macro sortby(byval=); GENDER ne proc print data=mydata; title Mydata by Gender ; %if &byval ne %then %do; proc sort data=mydata; by pid &byval; %end; %mend sortby; 8 The macro processor waits for the word scanner to tokenize the generated text, the word scanner reads GENDER ne from the input stack 9 The macro processor evaluates the expression GENDER ne, and because the expression is true proceeds to the %THEN and %DO statements 0 The macro processor executes the compiled %DO instructions and recognizes the next item is text It places the text back to the top of the input stack and waits for the word scanner to continue tokenization The word scanner recognizes the beginning of a PROC step and triggers the compiler to begin accepting tokens The word scanner transfers the tokens to the compiler from the top of the input stack - 3 -

14 Figure 46 The macro program SORTBY continues executing Compiler proc sort data = 3 mydata 4 ; 5 by 6 pid SORTBY Local Symbol Table Local Variables BYVAL GENDER Catalog sortby macro %macro sortby(byval=); &byval; proc print data=mydata; title Mydata by Gender ; %if &byval ne %then %do; proc sort data=mydata; by pid &byval; %end; %mend sortby; When the word scanner detects the ampersand followed by a nonblank character, it triggers the macro processor 3 The macro processor once again first searches the SORTBY local symbol table for a matching entry When the macro processor finds the entry, it replaces the macro variable at the top of the input stack with the value GENDER 4 The word scanner resumes tokenization and continues to send tokens to the compiler 5 The macro processor resumes processing the compiled macro It recognizes the end of the %DO at the %END and continues until the %MEND 6 Once the macro processor reaches the %MEND statement, it removes the SORTBY local symbol table and macro SORTBY ends execution 7 The word scanner resumes tokenization, recognizes the PROC as the beginning of a step boundary and triggers the compiler 8 The compiled PROC step is executed and the compiler is cleared - 4 -

15 Figure 47 Remaining statements are compiled and executed Compiler proc sort data=mydata; by pid gender; proc print data=mydata; title Mydata by Gender ; Catalog %macro sortby(byval=); %if &byval ne %then %do; proc sort data=mydata; by pid &byval; %end; %mend sortby; sortby macro SUMMARY The macro processor helps facilitate macro compilation and execution The relationship contains repetitive actions that begin with text submitted to the input stack, which is then tokenized by the word scanner Certain tokens trigger the macro processor at which time the word scanner waits for the macro processor to process an activity If the macro processor produces text as part of its activity, it places the text in the top of the input stack and waits while the word scanner resumes tokenization The word scanner then sends the token to the appropriate compiler This repetitive process continues until the entire program has been processed The technical aspects are not required for most macro programming, however understanding the concepts of how the macro processor works can help improve programming productivity REFERENCES SAS Language Reference, First Edition, Cary, NC, SAS Institute Inc, 997 SAS Guide to Processing, Version 6, Second Edition, Cary, NC, SAS Institute Inc, 990 Burlew, Michele M, SAS Programming Made Easy, Cary, NC, SAS Institute Inc, 998 ACKNOWLEDGMENTS Special thanks to my dear friend Adel Fahmy for encouraging me to take on the challenge of writing and presenting this topic TRADEMARKS SAS and all other SAS Institute Inc product or service names are registered trademarks or trademarks of SAS Institute, Inc in the USA and other countries Indicates USA registration Other brand and product names are registered trademarks or trademarks of their respective companies CONTACT INFORMATION Comments, questions and additions are welcomed Contact the author at: Lisa Lyons - PPD, Inc 3575 Quakerbridge Road, Suite 0 Hamilton, NJ lisalyons@lawrenceppdicom - 5 -

Journey to the center of the earth Deep understanding of SAS language processing mechanism Di Chen, SAS Beijing R&D, Beijing, China

Journey to the center of the earth Deep understanding of SAS language processing mechanism Di Chen, SAS Beijing R&D, Beijing, China Journey to the center of the earth Deep understanding of SAS language processing Di Chen, SAS Beijing R&D, Beijing, China ABSTRACT SAS is a highly flexible and extensible programming language, and a rich

More information

Introduction. Getting Started with the Macro Facility CHAPTER 1

Introduction. Getting Started with the Macro Facility CHAPTER 1 1 CHAPTER 1 Introduction Getting Started with the Macro Facility 1 Replacing Text Strings Using Macro Variables 2 Generating SAS Code Using Macros 3 Inserting Comments in Macros 4 Macro Definition Containing

More information

Get Started Writing SAS Macros Luisa Hartman, Jane Liao, Merck Sharp & Dohme Corp.

Get Started Writing SAS Macros Luisa Hartman, Jane Liao, Merck Sharp & Dohme Corp. Get Started Writing SAS Macros Luisa Hartman, Jane Liao, Merck Sharp & Dohme Corp. ABSTRACT The SAS Macro Facility is a tool which lends flexibility to your SAS code and promotes easier maintenance. It

More information

Introduction to the SAS Macro Facility

Introduction to the SAS Macro Facility Introduction to the SAS Macro Facility Uses for SAS Macros The macro language allows for programs that are dynamic capable of selfmodification. The major components of the macro language include: Macro

More information

GET A GRIP ON MACROS IN JUST 50 MINUTES! Arthur Li, City of Hope Comprehensive Cancer Center, Duarte, CA

GET A GRIP ON MACROS IN JUST 50 MINUTES! Arthur Li, City of Hope Comprehensive Cancer Center, Duarte, CA GET A GRIP ON MACROS IN JUST 50 MINUTES! Arthur Li, City of Hope Comprehensive Cancer Center, Duarte, CA ABSTRACT The SAS macro facility, which includes macro variables and macro programs, is the most

More information

SAS Macro Language: Reference

SAS Macro Language: Reference SAS Macro Language: Reference INTRODUCTION Getting Started with the Macro Facility This is the macro facility language reference for the SAS System. It is a reference for the SAS macro language processor

More information

DSCI 325: Handout 15 Introduction to SAS Macro Programming Spring 2017

DSCI 325: Handout 15 Introduction to SAS Macro Programming Spring 2017 DSCI 325: Handout 15 Introduction to SAS Macro Programming Spring 2017 The Basics of the SAS Macro Facility Macros are used to make SAS code more flexible and efficient. Essentially, the macro facility

More information

Sandra Hendren Health Data Institute

Sandra Hendren Health Data Institute INTRODUCTION TO THE MACRO LANGUAGE Sandra Hendren Health Data Institute The purpose of this paper is to explain the macro language at a conceptual level. It will not discuss the syntax of the language

More information

APPENDIX 4 Migrating from QMF to SAS/ ASSIST Software. Each of these steps can be executed independently.

APPENDIX 4 Migrating from QMF to SAS/ ASSIST Software. Each of these steps can be executed independently. 255 APPENDIX 4 Migrating from QMF to SAS/ ASSIST Software Introduction 255 Generating a QMF Export Procedure 255 Exporting Queries from QMF 257 Importing QMF Queries into Query and Reporting 257 Alternate

More information

SAS Macro. SAS Training Courses. Amadeus Software Ltd

SAS Macro. SAS Training Courses. Amadeus Software Ltd SAS Macro SAS Training Courses By Amadeus Software Ltd AMADEUS SOFTWARE LIMITED SAS TRAINING Amadeus have been delivering SAS Training since 1989 and our aim is to provide you with best quality SAS training

More information

CHAPTER 7 Using Other SAS Software Products

CHAPTER 7 Using Other SAS Software Products 77 CHAPTER 7 Using Other SAS Software Products Introduction 77 Using SAS DATA Step Features in SCL 78 Statements 78 Functions 79 Variables 79 Numeric Variables 79 Character Variables 79 Expressions 80

More information

SAS Macro Programming for Beginners

SAS Macro Programming for Beginners ABSTRACT SAS Macro Programming for Beginners Lora D. Delwiche, Winters, CA Susan J. Slaughter, Avocet Solutions, Davis, CA Macro programming is generally considered an advanced topic. But, while macros

More information

Simplifying Your %DO Loop with CALL EXECUTE Arthur Li, City of Hope National Medical Center, Duarte, CA

Simplifying Your %DO Loop with CALL EXECUTE Arthur Li, City of Hope National Medical Center, Duarte, CA PharmaSUG 2017 BB07 Simplifying Your %DO Loop with CALL EXECUTE Arthur Li, City of Hope National Medical Center, Duarte, CA ABSTRACT One often uses an iterative %DO loop to execute a section of a macro

More information

SAS Macro Dynamics - From Simple Basics to Powerful Invocations Rick Andrews, Office of the Actuary, CMS, Baltimore, MD

SAS Macro Dynamics - From Simple Basics to Powerful Invocations Rick Andrews, Office of the Actuary, CMS, Baltimore, MD Paper BB-7 SAS Macro Dynamics - From Simple Basics to Powerful Invocations Rick Andrews, Office of the Actuary, CMS, Baltimore, MD ABSTRACT The SAS Macro Facility offers a mechanism for expanding and customizing

More information

Functions vs. Macros: A Comparison and Summary

Functions vs. Macros: A Comparison and Summary Functions vs. Macros: A Comparison and Summary Mahipal Vanam Phaneendhar Vanam Srinivas Vanam Percept Pharma Services, Bridgewater, NJ ABSTRACT SAS is rich in various built-in functions, and predefined

More information

Surviving the SAS Macro Jungle by Using Your Own Programming Toolkit Kevin Russell, SAS Institute Inc., Cary, North Carolina

Surviving the SAS Macro Jungle by Using Your Own Programming Toolkit Kevin Russell, SAS Institute Inc., Cary, North Carolina PharmaSUG 2016 Paper BB11 Surviving the SAS Macro Jungle by Using Your Own Programming Toolkit Kevin Russell, SAS Institute Inc., Cary, North Carolina ABSTRACT Almost every night there is a reality show

More information

Macro Basics. Introduction. Defining and Using Macro Variables. Defining and Using Macros. Macro Parameters. Part 1. Chapter 1. Chapter 2.

Macro Basics. Introduction. Defining and Using Macro Variables. Defining and Using Macros. Macro Parameters. Part 1. Chapter 1. Chapter 2. Part 1 Macro Basics Chapter 1 Chapter 2 Chapter 3 Chapter 4 Introduction Defining and Using Macro Variables Defining and Using Macros Macro Parameters 2 Carpenter s Complete Guide to the SAS Macro Language

More information

Basic Macro Processing Prepared by Destiny Corporation

Basic Macro Processing Prepared by Destiny Corporation Basic Macro Processing Prepared by Destiny Corporation Macro variables In this module we discuss the first of the two special characters - the ampersand (&). When the SAS Supervisor sees an ampersand followed

More information

Macro Internals for the User Developer s Overview. Susan O Connor, SAS Institute Inc., Cary, NC

Macro Internals for the User Developer s Overview. Susan O Connor, SAS Institute Inc., Cary, NC Macro Internals for the User Developer s Overview Susan O Connor, SAS Institute Inc., Cary, NC ABSTRACT You have used the macro language software that is part of base software from SAS Institute Inc. or

More information

Paper HOW-06. Tricia Aanderud, And Data Inc, Raleigh, NC

Paper HOW-06. Tricia Aanderud, And Data Inc, Raleigh, NC Paper HOW-06 Building Your First SAS Stored Process Tricia Aanderud, And Data Inc, Raleigh, NC ABSTRACT Learn how to convert a simple SAS macro into three different stored processes! Using examples from

More information

Foundations and Fundamentals. SAS System Options: The True Heroes of Macro Debugging Kevin Russell and Russ Tyndall, SAS Institute Inc.

Foundations and Fundamentals. SAS System Options: The True Heroes of Macro Debugging Kevin Russell and Russ Tyndall, SAS Institute Inc. SAS System Options: The True Heroes of Macro Debugging Kevin Russell and Russ Tyndall, SAS Institute Inc., Cary, NC ABSTRACT It is not uncommon for the first draft of any macro application to contain errors.

More information

Unlock SAS Code Automation with the Power of Macros

Unlock SAS Code Automation with the Power of Macros SESUG 2015 ABSTRACT Paper AD-87 Unlock SAS Code Automation with the Power of Macros William Gui Zupko II, Federal Law Enforcement Training Centers SAS code, like any computer programming code, seems to

More information

SAS Macro Dynamics: from Simple Basics to Powerful Invocations Rick Andrews, Office of Research, Development, and Information, Baltimore, MD

SAS Macro Dynamics: from Simple Basics to Powerful Invocations Rick Andrews, Office of Research, Development, and Information, Baltimore, MD ABSTRACT CODERS CORNER SAS Macro Dynamics: from Simple Basics to Powerful Invocations Rick Andrews, Office of Research, Development, and Information, Baltimore, MD The SAS Macro Facility offers a mechanism

More information

The SAS Interface to REXX

The SAS Interface to REXX 95 CHAPTER 9 The SAS Interface to REXX Overview 95 The Subcommand Environment 96 Retrieving and Assigning the Values of REXX Variables in a SAS Program 97 Using the GETEXEC DATA Step Function 97 Using

More information

Macros from Beginning to Mend A Simple and Practical Approach to the SAS Macro Facility

Macros from Beginning to Mend A Simple and Practical Approach to the SAS Macro Facility Macros from Beginning to Mend A Simple and Practical Approach to the SAS Macro Facility Michael G. Sadof, MGS Associates, Inc., Bethesda, MD. ABSTRACT The macro facility is an important feature of the

More information

How to Create Data-Driven Lists

How to Create Data-Driven Lists Paper 9540-2016 How to Create Data-Driven Lists Kate Burnett-Isaacs, Statistics Canada ABSTRACT As SAS programmers we often want our code or program logic to be driven by the data at hand, rather than

More information

Files Arriving at an Inconvenient Time? Let SAS Process Your Files with FILEEXIST While You Sleep

Files Arriving at an Inconvenient Time? Let SAS Process Your Files with FILEEXIST While You Sleep Files Arriving at an Inconvenient Time? Let SAS Process Your Files with FILEEXIST While You Sleep Educational Testing Service SAS and all other SAS Institute Inc. product or service names are registered

More information

Lecture 1 Getting Started with SAS

Lecture 1 Getting Started with SAS SAS for Data Management, Analysis, and Reporting Lecture 1 Getting Started with SAS Portions reproduced with permission of SAS Institute Inc., Cary, NC, USA Goals of the course To provide skills required

More information

The Ins and Outs of %IF

The Ins and Outs of %IF Paper 1135-2017 The Ins and Outs of %IF M. Michelle Buchecker, ThotWave Technologies, LLC. ABSTRACT Have you ever had your macro code not work and you couldn't figure out why? Even something as simple

More information

Utilizing the Stored Compiled Macro Facility in a Multi-user Clinical Trial Setting

Utilizing the Stored Compiled Macro Facility in a Multi-user Clinical Trial Setting Paper AD05 Utilizing the Stored Compiled Macro Facility in a Multi-user Clinical Trial Setting Mirjana Stojanovic, Duke University Medical Center, Durham, NC Dorothy Watson, Duke University Medical Center,

More information

An Animated Guide: An Introduction to SAS Macro Quoting Russ Lavery Bryn Mawr, PA

An Animated Guide: An Introduction to SAS Macro Quoting Russ Lavery Bryn Mawr, PA An Animated Guide: An Introduction to SAS Macro Quoting Russ Lavery Bryn Mawr, PA Figure 1 ABSTRACT This paper builds on a NESUG 2002 paper that described the general functioning of the SAS Macro Processor.

More information

SAS Macro Language 1: Essentials. Course Notes

SAS Macro Language 1: Essentials. Course Notes SAS Macro Language 1: Essentials Course Notes SAS Macro Language 1: Essentials Course Notes was developed by Jim Simon and Linda Mitterling. Additional contributions were made by Davetta Dunlap, John McCall,

More information

Using SAS/SCL to Create Flexible Programs... A Super-Sized Macro Ellen Michaliszyn, College of American Pathologists, Northfield, IL

Using SAS/SCL to Create Flexible Programs... A Super-Sized Macro Ellen Michaliszyn, College of American Pathologists, Northfield, IL Using SAS/SCL to Create Flexible Programs... A Super-Sized Macro Ellen Michaliszyn, College of American Pathologists, Northfield, IL ABSTRACT SAS is a powerful programming language. When you find yourself

More information

Macro Quoting: Which Function Should We Use? Pengfei Guo, MSD R&D (China) Co., Ltd., Shanghai, China

Macro Quoting: Which Function Should We Use? Pengfei Guo, MSD R&D (China) Co., Ltd., Shanghai, China PharmaSUG China 2016 - Paper 81 Macro Quoting: Which Function Should We Use? Pengfei Guo, MSD R&D (China) Co., Ltd., Shanghai, China ABSTRACT There are several macro quoting functions in SAS and even some

More information

More About SAS Macros

More About SAS Macros More About SAS Macros (Than You Thought Possible) Donald P. Gallogly DCBS IMD Topics The SAS Macros System Macro Variables Writing Macros The SAS Macros System The SAS Macros System SAS macros and macro

More information

FSEDIT Procedure Windows

FSEDIT Procedure Windows 25 CHAPTER 4 FSEDIT Procedure Windows Overview 26 Viewing and Editing Observations 26 How the Control Level Affects Editing 27 Scrolling 28 Adding Observations 28 Entering and Editing Variable Values 28

More information

DATA Step Debugger APPENDIX 3

DATA Step Debugger APPENDIX 3 1193 APPENDIX 3 DATA Step Debugger Introduction 1194 Definition: What is Debugging? 1194 Definition: The DATA Step Debugger 1194 Basic Usage 1195 How a Debugger Session Works 1195 Using the Windows 1195

More information

Tired of CALL EXECUTE? Try DOSUBL

Tired of CALL EXECUTE? Try DOSUBL ABSTRACT SESUG Paper BB-132-2017 Tired of CALL EXECUTE? Try DOSUBL Jueru Fan, PPD, Morrisville, NC DOSUBL was first introduced as a function in SAS V9.3. It enables the immediate execution of SAS code

More information

&&&, ;;, and Other Hieroglyphics Advanced Macro Topics Chris Yindra, C. Y. Training Associates

&&&, ;;, and Other Hieroglyphics Advanced Macro Topics Chris Yindra, C. Y. Training Associates &&&, ;;, and Other Hieroglyphics Advanced Macro Topics Chris Yindra, C. Y. Training Associates INTRODUCTION SAS macros are powerful tools that can create reusable code modules to do a variety of programming

More information

BASICS BEFORE STARTING SAS DATAWAREHOSING Concepts What is ETL ETL Concepts What is OLAP SAS. What is SAS History of SAS Modules available SAS

BASICS BEFORE STARTING SAS DATAWAREHOSING Concepts What is ETL ETL Concepts What is OLAP SAS. What is SAS History of SAS Modules available SAS SAS COURSE CONTENT Course Duration - 40hrs BASICS BEFORE STARTING SAS DATAWAREHOSING Concepts What is ETL ETL Concepts What is OLAP SAS What is SAS History of SAS Modules available SAS GETTING STARTED

More information

Copy That! Using SAS to Create Directories and Duplicate Files

Copy That! Using SAS to Create Directories and Duplicate Files Copy That! Using SAS to Create Directories and Duplicate Files, SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and

More information

The DATA Statement: Efficiency Techniques

The DATA Statement: Efficiency Techniques The DATA Statement: Efficiency Techniques S. David Riba, JADE Tech, Inc., Clearwater, FL ABSTRACT One of those SAS statements that everyone learns in the first day of class, the DATA statement rarely gets

More information

New Macro Features Added in SAS 9.3 and SAS 9.4

New Macro Features Added in SAS 9.3 and SAS 9.4 SAS1575-2015 New Macro Features Added in SAS 9.3 and SAS 9.4 Richard D. Langston, SAS Institute Inc. ABSTRACT This paper describes the new features added to the macro facility in SAS 9.3 and SAS 9.4. New

More information

ABSTRACT MORE THAN SYNTAX ORGANIZE YOUR WORK THE SAS ENTERPRISE GUIDE PROJECT. Paper 50-30

ABSTRACT MORE THAN SYNTAX ORGANIZE YOUR WORK THE SAS ENTERPRISE GUIDE PROJECT. Paper 50-30 Paper 50-30 The New World of SAS : Programming with SAS Enterprise Guide Chris Hemedinger, SAS Institute Inc., Cary, NC Stephen McDaniel, SAS Institute Inc., Cary, NC ABSTRACT SAS Enterprise Guide (with

More information

SAS Data Libraries. Definition CHAPTER 26

SAS Data Libraries. Definition CHAPTER 26 385 CHAPTER 26 SAS Data Libraries Definition 385 Library Engines 387 Library Names 388 Physical Names and Logical Names (Librefs) 388 Assigning Librefs 388 Associating and Clearing Logical Names (Librefs)

More information

How to Incorporate Old SAS Data into a New DATA Step, or What is S-M-U?

How to Incorporate Old SAS Data into a New DATA Step, or What is S-M-U? Paper 54-25 How to Incorporate Old SAS Data into a New DATA Step, or What is S-M-U? Andrew T. Kuligowski Nielsen Media Research Abstract / Introduction S-M-U. Some people will see these three letters and

More information

SAS Online Training: Course contents: Agenda:

SAS Online Training: Course contents: Agenda: SAS Online Training: Course contents: Agenda: (1) Base SAS (6) Clinical SAS Online Training with Real time Projects (2) Advance SAS (7) Financial SAS Training Real time Projects (3) SQL (8) CV preparation

More information

Run your reports through that last loop to standardize the presentation attributes

Run your reports through that last loop to standardize the presentation attributes PharmaSUG2011 - Paper TT14 Run your reports through that last loop to standardize the presentation attributes Niraj J. Pandya, Element Technologies Inc., NJ ABSTRACT Post Processing of the report could

More information

QUEST Procedure Reference

QUEST Procedure Reference 111 CHAPTER 9 QUEST Procedure Reference Introduction 111 QUEST Procedure Syntax 111 Description 112 PROC QUEST Statement Options 112 Procedure Statements 112 SYSTEM 2000 Statement 114 ECHO ON and ECHO

More information

Contents. Overview How SAS processes programs Compilation phase Execution phase Debugging a DATA step Testing your programs

Contents. Overview How SAS processes programs Compilation phase Execution phase Debugging a DATA step Testing your programs SAS Data Step Contents Overview How SAS processes programs Compilation phase Execution phase Debugging a DATA step Testing your programs 2 Overview Introduction This section teaches you what happens "behind

More information

A Guided Tour Through the SAS Windowing Environment Casey Cantrell, Clarion Consulting, Los Angeles, CA

A Guided Tour Through the SAS Windowing Environment Casey Cantrell, Clarion Consulting, Los Angeles, CA A Guided Tour Through the SAS Windowing Environment Casey Cantrell, Clarion Consulting, Los Angeles, CA ABSTRACT The SAS system running in the Microsoft Windows environment contains a multitude of tools

More information

A Time Saver for All: A SAS Toolbox Philip Jou, Baylor University, Waco, TX

A Time Saver for All: A SAS Toolbox Philip Jou, Baylor University, Waco, TX South Central SAS Users Group 2016 A Time Saver for All: A SAS Toolbox Philip Jou, Baylor University, Waco, TX ABSTRACT SAS Macros are a useful tool to any SAS Programmer. A macro variable can be used

More information

Program Validation: Logging the Log

Program Validation: Logging the Log Program Validation: Logging the Log Adel Fahmy, Symbiance Inc., Princeton, NJ ABSTRACT Program Validation includes checking both program Log and Logic. The program Log should be clear of any system Error/Warning

More information

Jeff Phillips, ARC Professional Services Group Veronica Walgamotte, ARC Professional Services Group Derek Drummond, ARC Professional Services Group

Jeff Phillips, ARC Professional Services Group Veronica Walgamotte, ARC Professional Services Group Derek Drummond, ARC Professional Services Group ~- WARNING: ApPARENT MACRO INVOCATION NOT RESOLVED TECHNIQUES FOR DEBUGGING MACRO CODE Jeff Phillips, ARC Professional Services Group Veronica Walgamotte, ARC Professional Services Group Derek Drummond,

More information

Storing and Reusing Macros

Storing and Reusing Macros 101 CHAPTER 9 Storing and Reusing Macros Introduction 101 Saving Macros in an Autocall Library 102 Using Directories as Autocall Libraries 102 Using SAS Catalogs as Autocall Libraries 103 Calling an Autocall

More information

A Tutorial on the SAS Macro Language

A Tutorial on the SAS Macro Language HW152 SESUG 2015 A Tutorial on the SAS Macro Language John J. Cohen, Advanced Data Concepts LLC, Newark, DE ABSTRACT The SAS Macro language is another language that rests on top of regular SAS code. If

More information

An Introduction to SAS/FSP Software Terry Fain, RAND, Santa Monica, California Cyndie Gareleck, RAND, Santa Monica, California

An Introduction to SAS/FSP Software Terry Fain, RAND, Santa Monica, California Cyndie Gareleck, RAND, Santa Monica, California An Introduction to SAS/FSP Software Terry Fain, RAND, Santa Monica, California Cyndie Gareleck, RAND, Santa Monica, California ABSTRACT SAS/FSP is a set of procedures used to perform full-screen interactive

More information

Lecture Outline. COMP-421 Compiler Design. What is Lex? Lex Specification. ! Lexical Analyzer Lex. ! Lex Examples. Presented by Dr Ioanna Dionysiou

Lecture Outline. COMP-421 Compiler Design. What is Lex? Lex Specification. ! Lexical Analyzer Lex. ! Lex Examples. Presented by Dr Ioanna Dionysiou Lecture Outline COMP-421 Compiler Design! Lexical Analyzer Lex! Lex Examples Presented by Dr Ioanna Dionysiou Figures and part of the lecture notes taken from A compact guide to lex&yacc, epaperpress.com

More information

Unravelling the Knot of Ampersands

Unravelling the Knot of Ampersands Paper 3285-2015 Unravelling the Knot of Ampersands Joe Matise, NORC at the University of Chicago ABSTRACT We've all heard it before: "If two ampersands don't work, add a third." But how many of us really

More information

An Introduction to Macros Deb Cassidy

An Introduction to Macros Deb Cassidy Paper #HW03 An Introduction to Macros Deb Cassidy Abstract A search in the proceedings for SUGI 24-28 for the word "macro" had over 1,000 hits. Why are macros so popular? A quick glance through the papers

More information

AN INTRODUCTION TO MACRO VARIABLES AND MACRO PROGRAMS Mike Zdeb, School of Public Health

AN INTRODUCTION TO MACRO VARIABLES AND MACRO PROGRAMS Mike Zdeb, School of Public Health AN INTRODUCTION TO MACRO VARIABLES AND MACRO PROGRAMS Mike Zdeb, University@Albany School of Public Health INTRODUCTION There are a number of SAS tools that you may never have to use. Why? The main reason

More information

CROSSREF Manual. Tools and Utilities Library

CROSSREF Manual. Tools and Utilities Library Tools and Utilities Library CROSSREF Manual Abstract This manual describes the CROSSREF cross-referencing utility, including how to use it with C, COBOL 74, COBOL85, EXTENDED BASIC, FORTRAN, Pascal, SCREEN

More information

SAS 9 Programming Enhancements Marje Fecht, Prowerk Consulting Ltd Mississauga, Ontario, Canada

SAS 9 Programming Enhancements Marje Fecht, Prowerk Consulting Ltd Mississauga, Ontario, Canada SAS 9 Programming Enhancements Marje Fecht, Prowerk Consulting Ltd Mississauga, Ontario, Canada ABSTRACT Performance improvements are the well-publicized enhancement to SAS 9, but what else has changed

More information

Merge Processing and Alternate Table Lookup Techniques Prepared by

Merge Processing and Alternate Table Lookup Techniques Prepared by Merge Processing and Alternate Table Lookup Techniques Prepared by The syntax for data step merging is as follows: International SAS Training and Consulting This assumes that the incoming data sets are

More information

SAS Macro Programming Tips and Techniques

SAS Macro Programming Tips and Techniques PharmaSUG 2012 Paper HW05 SAS Macro Programming Tips and Techniques Kirk Paul Lafler, Software Intelligence Corporation, Spring Valley, California Abstract The SAS Macro Language is a powerful feature

More information

Base and Advance SAS

Base and Advance SAS Base and Advance SAS BASE SAS INTRODUCTION An Overview of the SAS System SAS Tasks Output produced by the SAS System SAS Tools (SAS Program - Data step and Proc step) A sample SAS program Exploring SAS

More information

Step through Your DATA Step: Introducing the DATA Step Debugger in SAS Enterprise Guide

Step through Your DATA Step: Introducing the DATA Step Debugger in SAS Enterprise Guide SAS447-2017 Step through Your DATA Step: Introducing the DATA Step Debugger in SAS Enterprise Guide ABSTRACT Joe Flynn, SAS Institute Inc. Have you ever run SAS code with a DATA step and the results are

More information

Easing into Data Exploration, Reporting, and Analytics Using SAS Enterprise Guide

Easing into Data Exploration, Reporting, and Analytics Using SAS Enterprise Guide Paper 809-2017 Easing into Data Exploration, Reporting, and Analytics Using SAS Enterprise Guide ABSTRACT Marje Fecht, Prowerk Consulting Whether you have been programming in SAS for years, are new to

More information

A Comparison of the LUA Procedure and the SAS Macro Facility

A Comparison of the LUA Procedure and the SAS Macro Facility ABSTRACT Paper 212-2017 A Comparison of the LUA Procedure and the SAS Macro Facility Anand Vijayaraghavan, SAS Institute Inc. The LUA procedure is a relatively new SAS procedure, having been available

More information

ABSTRACT DATA CLARIFCIATION FORM TRACKING ORACLE TABLE INTRODUCTION REVIEW QUALITY CHECKS

ABSTRACT DATA CLARIFCIATION FORM TRACKING ORACLE TABLE INTRODUCTION REVIEW QUALITY CHECKS Efficient SAS Quality Checks: Unique Error Identification And Enhanced Data Management Analysis Jim Grudzinski, Biostatistics Manager Of SAS Programming Covance Periapproval Services Inc, Radnor, PA ABSTRACT

More information

Fundamentals of Programming Session 4

Fundamentals of Programming Session 4 Fundamentals of Programming Session 4 Instructor: Reza Entezari-Maleki Email: entezari@ce.sharif.edu 1 Fall 2011 These slides are created using Deitel s slides, ( 1992-2010 by Pearson Education, Inc).

More information

Arthur L. Carpenter California Occidental Consultants, Oceanside, California

Arthur L. Carpenter California Occidental Consultants, Oceanside, California Paper 028-30 Storing and Using a List of Values in a Macro Variable Arthur L. Carpenter California Occidental Consultants, Oceanside, California ABSTRACT When using the macro language it is not at all

More information

Developing Data-Driven SAS Programs Using Proc Contents

Developing Data-Driven SAS Programs Using Proc Contents Developing Data-Driven SAS Programs Using Proc Contents Robert W. Graebner, Quintiles, Inc., Kansas City, MO ABSTRACT It is often desirable to write SAS programs that adapt to different data set structures

More information

Seminar Series: CTSI Presents

Seminar Series: CTSI Presents Biostatistics, Epidemiology & Research Design (BERD) Howard Cabral, PhD, MPH Christine Chaisson, MPH Seminar Series: CTSI Presents November 20, 2014 Demystifying SAS Macros BUSPH Data Coordinating Center

More information

Why & How To Use SAS Macro Language: Easy Ways To Get More Value & Power from Your SAS Software Tools

Why & How To Use SAS Macro Language: Easy Ways To Get More Value & Power from Your SAS Software Tools Why & How To Use SAS Macro Language: Easy Ways To Get More Value & Power from Your SAS Software Tools LeRoy Bessler PhD Bessler Consulting and Research Strong Smart Systems Mequon, WI, USA Le_Roy_Bessler@wi.rr.com

More information

Mapping Clinical Data to a Standard Structure: A Table Driven Approach

Mapping Clinical Data to a Standard Structure: A Table Driven Approach ABSTRACT Paper AD15 Mapping Clinical Data to a Standard Structure: A Table Driven Approach Nancy Brucken, i3 Statprobe, Ann Arbor, MI Paul Slagle, i3 Statprobe, Ann Arbor, MI Clinical Research Organizations

More information

Beginning Tutorials. Introduction to SAS/FSP in Version 8 Terry Fain, RAND, Santa Monica, California Cyndie Gareleck, RAND, Santa Monica, California

Beginning Tutorials. Introduction to SAS/FSP in Version 8 Terry Fain, RAND, Santa Monica, California Cyndie Gareleck, RAND, Santa Monica, California Introduction to SAS/FSP in Version 8 Terry Fain, RAND, Santa Monica, California Cyndie Gareleck, RAND, Santa Monica, California ABSTRACT SAS/FSP is a set of procedures used to perform full-screen interactive

More information

Locking SAS Data Objects

Locking SAS Data Objects 59 CHAPTER 5 Locking SAS Data Objects Introduction 59 Audience 60 About the SAS Data Hierarchy and Locking 60 The SAS Data Hierarchy 60 How SAS Data Objects Are Accessed and Used 61 Types of Locks 62 Locking

More information

Amie Bissonett, inventiv Health Clinical, Minneapolis, MN

Amie Bissonett, inventiv Health Clinical, Minneapolis, MN PharmaSUG 2013 - Paper TF12 Let s get SAS sy Amie Bissonett, inventiv Health Clinical, Minneapolis, MN ABSTRACT The SAS language has a plethora of procedures, data step statements, functions, and options

More information

Submitting SAS Code On The Side

Submitting SAS Code On The Side ABSTRACT PharmaSUG 2013 - Paper AD24-SAS Submitting SAS Code On The Side Rick Langston, SAS Institute Inc., Cary NC This paper explains the new DOSUBL function and how it can submit SAS code to run "on

More information

Using the SQL Editor. Overview CHAPTER 11

Using the SQL Editor. Overview CHAPTER 11 205 CHAPTER 11 Using the SQL Editor Overview 205 Opening the SQL Editor Window 206 Entering SQL Statements Directly 206 Entering an SQL Query 206 Entering Non-SELECT SQL Code 207 Creating Template SQL

More information

Syntax Conventions for SAS Programming Languages

Syntax Conventions for SAS Programming Languages Syntax Conventions for SAS Programming Languages SAS Syntax Components Keywords A keyword is one or more literal name components of a language element. Keywords are uppercase, and in reference documentation,

More information

Extending the Scope of Custom Transformations

Extending the Scope of Custom Transformations Paper 3306-2015 Extending the Scope of Custom Transformations Emre G. SARICICEK, The University of North Carolina at Chapel Hill. ABSTRACT Building and maintaining a data warehouse can require complex

More information

Dynamic Projects in SAS Enterprise Guide How to Create and Use Parameters

Dynamic Projects in SAS Enterprise Guide How to Create and Use Parameters Paper HW02 Dynamic Projects in SAS Enterprise Guide How to Create and Use Parameters Susan J. Slaughter, Avocet Solutions, Davis, CA Lora D. Delwiche, University of California, Davis, CA ABSTRACT SAS Enterprise

More information

SAS/FSP 9.2. Procedures Guide

SAS/FSP 9.2. Procedures Guide SAS/FSP 9.2 Procedures Guide The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2008. SAS/FSP 9.2 Procedures Guide. Cary, NC: SAS Institute Inc. SAS/FSP 9.2 Procedures

More information

Acknowledgments xi Preface xiii About the Author xv About This Book xvii New in the Macro Language xxi

Acknowledgments xi Preface xiii About the Author xv About This Book xvii New in the Macro Language xxi Contents Part 1 Acknowledgments xi Preface xiii About the Author xv About This Book xvii New in the Macro Language xxi Macro Basics Chapter 1 Introduction 3 1.1 Macro Facility Overview 3 1.2 Terminology

More information

Introduction to the OpenVMS Operating Environment

Introduction to the OpenVMS Operating Environment 3 CHAPTER 1 Introduction to the OpenVMS Operating Environment Introduction 3 What Is the OpenVMS Operating Environment? 4 OpenVMS VAX and Alpha Platforms 4 Access to OpenVMS 4 Login Procedure 4 Files that

More information

WHAT ARE SASHELP VIEWS?

WHAT ARE SASHELP VIEWS? Paper PN13 There and Back Again: Navigating between a SASHELP View and the Real World Anita Rocha, Center for Studies in Demography and Ecology University of Washington, Seattle, WA ABSTRACT A real strength

More information

Are you Still Afraid of Using Arrays? Let s Explore their Advantages

Are you Still Afraid of Using Arrays? Let s Explore their Advantages Paper CT07 Are you Still Afraid of Using Arrays? Let s Explore their Advantages Vladyslav Khudov, Experis Clinical, Kharkiv, Ukraine ABSTRACT At first glance, arrays in SAS seem to be a complicated and

More information

Macro Architecture in Pictures Mark Tabladillo PhD, marktab Consulting, Atlanta, GA Associate Faculty, University of Phoenix

Macro Architecture in Pictures Mark Tabladillo PhD, marktab Consulting, Atlanta, GA Associate Faculty, University of Phoenix Paper PS16_05 Macro Architecture in Pictures Mark Tabladillo PhD, marktab Consulting, Atlanta, GA Associate Faculty, University of Phoenix ABSTRACT The qualities which SAS macros share with object-oriented

More information

* Link customized PF key settings for

* Link customized PF key settings for comprehensive usage of PROC FSEDIT, version 6. Andrew P. Ford, Northern Indiana Public Service Company, Merrillville, Indiana ABSTRACT This paper presents an advanced application of FSEDIT under version

More information

Text Generational Data Sets (Text GDS)

Text Generational Data Sets (Text GDS) Paper 274-2017 Text Generational Data Sets (Text GDS) Dr. Kannan Deivasigamani HSBC ABSTRACT This paper offers a way to fill the void that SAS currently has with respect to the missing feature in the language,

More information

Ditch the Data Memo: Using Macro Variables and Outer Union Corresponding in PROC SQL to Create Data Set Summary Tables Andrea Shane MDRC, Oakland, CA

Ditch the Data Memo: Using Macro Variables and Outer Union Corresponding in PROC SQL to Create Data Set Summary Tables Andrea Shane MDRC, Oakland, CA ABSTRACT Ditch the Data Memo: Using Macro Variables and Outer Union Corresponding in PROC SQL to Create Data Set Summary Tables Andrea Shane MDRC, Oakland, CA Data set documentation is essential to good

More information

Anatomy of a Merge Gone Wrong James Lew, Compu-Stat Consulting, Scarborough, ON, Canada Joshua Horstman, Nested Loop Consulting, Indianapolis, IN, USA

Anatomy of a Merge Gone Wrong James Lew, Compu-Stat Consulting, Scarborough, ON, Canada Joshua Horstman, Nested Loop Consulting, Indianapolis, IN, USA ABSTRACT PharmaSUG 2013 - Paper TF22 Anatomy of a Merge Gone Wrong James Lew, Compu-Stat Consulting, Scarborough, ON, Canada Joshua Horstman, Nested Loop Consulting, Indianapolis, IN, USA The merge is

More information

April 4, SAS General Introduction

April 4, SAS General Introduction PP 105 Spring 01-02 April 4, 2002 SAS General Introduction TA: Kanda Naknoi kanda@stanford.edu Stanford University provides UNIX computing resources for its academic community on the Leland Systems, which

More information

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved. Assoc. Prof. Dr. Marenglen Biba (C) 2010 Pearson Education, Inc. All rights reserved. Java application A computer program that executes when you use the java command to launch the Java Virtual Machine

More information

Tales from the Help Desk 5: Yet More Solutions for Common SAS Mistakes Bruce Gilsen, Federal Reserve Board

Tales from the Help Desk 5: Yet More Solutions for Common SAS Mistakes Bruce Gilsen, Federal Reserve Board Tales from the Help Desk 5: Yet More Solutions for Common SAS Mistakes Bruce Gilsen, Federal Reserve Board INTRODUCTION In 25 years as a SAS consultant at the Federal Reserve Board, I have seen SAS users

More information

HOW TO DEVELOP A SAS/AF APPLICATION

HOW TO DEVELOP A SAS/AF APPLICATION PS001 Creating Effective Graphical User Interfaces Using Version 8 SAS/AF Anders Longthorne, National Highway Traffic Safety Administration, Washington, DC ABSTRACT Improving access to an organization

More information

Introduction to SAS Statistical Package

Introduction to SAS Statistical Package Instructor: Introduction to SAS Statistical Package Biostatistics 140.632 Lecture 1 Lucy Meoni lmeoni@jhmi.edu Teaching Assistant : Sorina Eftim seftim@jhsph.edu Lecture/Lab: Room 3017 WEB site: www.biostat.jhsph.edu/bstcourse/bio632/default.htm

More information

Better Metadata Through SAS II: %SYSFUNC, PROC DATASETS, and Dictionary Tables

Better Metadata Through SAS II: %SYSFUNC, PROC DATASETS, and Dictionary Tables Paper 3458-2015 Better Metadata Through SAS II: %SYSFUNC, PROC DATASETS, and Dictionary Tables ABSTRACT Louise Hadden, Abt Associates Inc., Cambridge, MA SAS provides a wealth of resources for users to

More information