LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 2007, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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


Back to: Top of message | Previous page | Main SAS-L page