Wednesday, October 04, 2006
Local or Global? SAS Macros variables

The key to understanding the difference is to be clear about the where the macro variables are created and what "territory" they would have their "power".
A governor elected in MA has no administrative power outside of MA. He is "local".
However, once he is elected as the "president" of the United States, even though he is from MA (he was made in MA ), he will still have the power over the states other than MA. The procedure of election made him "global".
In SAS, it is much simpler: you type "%global var1". Then it will be availabe for you outside the macro you are writing---outside of Massachussets.
SAS Made Easy (song)
It is not difficult to learn SAS,
The key is to master RETAIN and MERGE
RETAIN abandons the old friend only when he gets a new one,
First.VAR makes a great difference by it's "1".
MERGE likes to join hands to hands (of datasets),
It is "BY" to keep every thing in order.
SET does his job by "FIRST COME, FIRST SERVE",
It is also "BY" to make "interleaving" a reality.
If you love him, then "KEEP",
If you hate him, then "DROP".
"IN" tells us some one is coming,
"END" signals the last observation.
SAS was born in 1960,1,1
She counts her age by days.
INFORMATS gets in all all "clothes",
FORMAT represents her own wishes.
Using "INPUT", we get numbers;
Using "PUT", we produce characters.
The key is to master RETAIN and MERGE
RETAIN abandons the old friend only when he gets a new one,
First.VAR makes a great difference by it's "1".
MERGE likes to join hands to hands (of datasets),
It is "BY" to keep every thing in order.
SET does his job by "FIRST COME, FIRST SERVE",
It is also "BY" to make "interleaving" a reality.
If you love him, then "KEEP",
If you hate him, then "DROP".
"IN" tells us some one is coming,
"END" signals the last observation.
SAS was born in 1960,1,1
She counts her age by days.
INFORMATS gets in all all "clothes",
FORMAT represents her own wishes.
Using "INPUT", we get numbers;
Using "PUT", we produce characters.
