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 (March 1997, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 21 Mar 1997 13:56:17 -0800
Reply-To:   Steven_Hanks-1 <Steven_Hanks-1@SBPHRD.COM>
Sender:   "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:   Steven_Hanks-1 <Steven_Hanks-1@SBPHRD.COM>
Organization:   SmithKline Beecham
Subject:   Re: specify order of variables
Content-Type:   text/plain; charset=us-ascii

Laurie Fleming wrote: > > > > > > > As I recall, any variables named in the RETAIN statement go first, > > probably in the order listed on the statement.

This is the whole point, of course. The order of variables on the RETAIN defines the new variable order.

> > If there is a chance that > > unwanted values would actually be retained from one observation to the > > next, it might be necessary to write some code to set the variables to > > missing after outputting each observation. > > > In the current version (last tested v6.11) the retain statement, as long as > it is before the set statement, will not actually 'retain' a variable's values - > use it in this order with impunity. (Touch wood). > <snip>

RETAIN is working exactly as it should... as the variables in the RETAIN already exist, each SET overrides their previous values automatically, even missing values. Think about it.....

Also, the position of RETAIN within the program does not affect whether or not variables are retained. Positioning it before SET merely ensures that the variable order is defined by RETAIN, before SET defines it.

-- Steven Hanks, Hanks Consultants, Cambridge, England

The opinions expressed in this communication are my own, and do not necessarily reflect those of SmithKline Beecham.


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