Date: Mon, 6 Aug 2007 16:15:44 -0400
Reply-To: Kevin Roland Viel <kviel@EMORY.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Kevin Roland Viel <kviel@EMORY.EDU>
Subject: Re: Global variables?
In-Reply-To: <C3C1925D945BF844911C8EEA752666AE0F55916B@psbexmb2.psb.bls.gov>
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Mon, 6 Aug 2007, Dale, Jason - BLS wrote:
> Is there a way to declare a global variable so that multiple data steps
> can refer to this variable without having to assign it in each data
> step?
You can create a dataset, which you will read (SET or MERGE) each time.
You can use macro variables:
%let macvar = 10 ;
data one ;
x = &macvar. ;
run ;
data two ;
y = 10 ** &macvar. ;
run ;
There are several other possibilities, too. Each has pitfalls. Could you
discribe in more detail what you would like to do?
Good luck,
Kevin
Kevin Viel
PhD Candidate
Department of Epidemiology
Rollins School of Public Health
Emory University
Atlanta, GA 30322