Date: Wed, 10 Feb 2010 09:43:39 -0500
Reply-To: Gene Maguin <email@example.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Gene Maguin <firstname.lastname@example.org>
Subject: Re: Programming help
Content-Type: text/plain; charset="us-ascii"
Read up on the Varstocases command in the syntax reference. I haven't used
varstocases for a while and I may have some bits wrong. That said, I would
start with this syntax.
Varstocases /make member from Memno$01 Memno$02 Memno$03 ... Memno$25/
make age from age$01 age$02 age$03 ... age$25/
make sex from sex$01 sex$02 sex$03 ... sex$25/
make education from education$01 education$02 education$03 ...
Two issues for you to decide about are 1) whether to keep or drop totmem and
2) whether you want to create records for nonexistant members. Null=drop is
the default, which will give you as many records per case as there are
members in the group. I have always used varstocases with datasets that are
structured as memno$01 to memno$25, age$01 to age$25. As a result my make
statements are simply, for example, make age=age$01 to age$01.
As I read the documentation, a list of variables should work as well.
>>I have one spss data set that contains limit of family members up to 25
members in household organized in following fashion.
IDvariables TotMem Memno$01 Age$01 Sex$01 Education$01 Memno$02 Age$02
Sex$02 Education$02 . .up to Memno$25
what ever the data is 2
what ever the data is 25
This is one household data and exists in one row and data is filled up to
based on TotMem variable ,suppose Totmem =6 then data is only upto Mem$06
and that will have value 6 and all rest from Memno$07 to Mem$25 will be
What is want is, all Members information should come in different rows,
because all these variables age,sex,education have the same attributes.
I want in just like below.
IDvariable MemNo. Age Sex Education
IDvariable 1 what ever the data is
IDvariable 2 what ever the data is
.........up to 25
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
For a list of commands to manage subscriptions, send the command