{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

mac1c02 - Chapter 2 Macro Variables 2.1 Introduction to...

Info icon This preview shows pages 1–16. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Chapter 2: Macro Variables 2.1 Introduction to Macro Variables 2.2 Automatic Macro Variables 2.3 Macro Variable References 2.4 User-Defined Macro Variables 2.5 Delimiting Macro Variable References 2.6 Macro Functions
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2 Chapter 2: Macro Variables 2.1 Introduction to Macro Variables 2.1 Introduction to Macro Variables 2.2 Automatic Macro Variables 2.3 Macro Variable References 2.4 User-Defined Macro Variables 2.5 Delimiting Macro Variable References 2.6 Macro Functions
Image of page 2
3 Objectives Describe what macro variables store and where macro variables are stored. Identify the two types of macro variables.
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
4 Macro Variables Macro variables store text, including the following: complete or partial SAS steps complete or partial SAS statements Macro variables are called symbolic variables because SAS programs can reference macro variables as symbols for SAS code.
Image of page 4
5 Global Symbol Table Macro variables are stored in a memory area called the global symbol table. When SAS is invoked, the global symbol table is created and initialized with automatic macro variables . Automatic Variables Global Symbol Table SYSDATE 09NOV07 SYSDATE9 09NOV2007 SYSDAY Friday SYSTIME 10:47 SYSUSERID joeuser . . . .
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
6 Global Symbol Table User-defined macro variables can be added to the global symbol table. Automatic Variables Global Symbol Table . . . . SYSTIME 10:47 SYSUSERID joeuser . . . . OFFICE Sydney DATE1 25may2008 UNITS4 User-Defined Variables
Image of page 6
7 Macro Variables Macro variables in the global symbol table are global in scope (always available) have a minimum length of 0 characters ( null value ) have a maximum length of 65,534 (64K) characters store numeric tokens as text.
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
8
Image of page 8
9 2.01 Quiz What are the two kinds of macro variables? Where are macro variables stored?
Image of page 9

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
10 2.01 Quiz – Correct Answers What are the two kinds of macro variables? Automatic and user-defined Where are macro variables stored? In the global symbol table
Image of page 10
11
Image of page 11

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
12 Chapter 2: Macro Variables 2.1 Introduction to Macro Variables 2.2 Automatic Macro Variables 2.2 Automatic Macro Variables 2.3 Macro Variable References 2.4 User-Defined Macro Variables 2.5 Delimiting Macro Variable References 2.6 Macro Functions
Image of page 12
13 Objectives Identify selected automatic macro variables. Display automatic macro variables in the SAS log.
Image of page 13

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
14 Automatic Macro Variables The following are true for automatic macro variables: system-defined created at SAS invocation global in scope (always available) assigned values by SAS can be assigned values by the user in some cases
Image of page 14
15 System-Defined Automatic Macro Variables Some automatic macro variables have fixed values that are set at SAS invocation: Name Description SYSDATE Date of SAS invocation (17JAN08). SYSDATE9 Date of SAS invocation (17JAN2008). SYSDAY Day of the week of SAS invocation (Friday).
Image of page 15

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 16
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern