It sounds like you may be looking for LEAVE or LAG.
Or you may mean something like this:
do if missing(var2).
recode var1(1 thru 7 = 1)(18,33,92=2)(else = copy) into newvar2.
else.
recode var2(else=copy)into newvar2.
end if.
execute.
recode is very powerful. to see the command syntax for any command type
it into a syntax window highlight it and click the command syntax icon
on the tool bar [looks like a small outline).
In order to facilitate quality assurance review, to help in learning
syntax, and to preserve syntax so you can as you develop your process by
successive approximations, it is a good habit to use the <paste> button
to exit menus instead of the <ok> button,
Does this do what you want? If not please restate your question in more
detail.
Art
[log in to unmask]
Social Research Consultants
University Park, MD USA
(301) 864-5570
Karen Snape wrote:
> Hi Allstaters
>
> Does anyone know the SPSS function equivalent to the "retain" statement in
> SAS?
>
> I want to create a new variable from an existing variable and copy the
> results down the rows (over missing values) until the next valid row.
>
> Thanks in advance
> Karen Snape
>
|