create multiple records from one record

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

create multiple records from one record

<Owen Power>
I have a file of about 300 records. For each unique ‘RecordID’ on the file
I am trying to create 30 duplicates of the record so that I end up with
9000 records. Then for each unique ‘RecordID’ I want to number the 30
created records from 01 to 30.

Could someone suggest how I might do this in SPSS V.20?

Thanks.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: create multiple records from one record

David Marso
Administrator
Not sure *WHY* you would wish to do this.
OTOH:
Here is an easy way.
--
LOOP SUBREC=1 TO 30.
XSAVE OUTFILE "C:\TEMP\REPEAT30.sav" .
END LOOP.
EXE.
GET FILE "C:\TEMP\REPEAT30.sav".

<Owen Power> wrote
I have a file of about 300 records. For each unique ‘RecordID’ on the file
I am trying to create 30 duplicates of the record so that I end up with
9000 records. Then for each unique ‘RecordID’ I want to number the 30
created records from 01 to 30.

Could someone suggest how I might do this in SPSS V.20?

Thanks.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: create multiple records from one record

Art Kendall
I wonder why you do not simply,
compute weight30 =30.
weight by weight30.
??

if for some reason you do need a file like you asked for with leading zeros
add a line to David's syntax saying
formats subrec(n2).
Art Kendall
Social Research Consultants

On 12/14/2011 1:40 AM, David Marso wrote:
Not sure *WHY* you would wish to do this.
OTOH:
Here is an easy way.
--
LOOP SUBREC=1 TO 30.
XSAVE OUTFILE "C:\TEMP\REPEAT30.sav" .
END LOOP.
EXE.
GET FILE "C:\TEMP\REPEAT30.sav".
===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: create multiple records from one record

bruce phillips-2
In reply to this post by David Marso
Without knowing why you want to increase the # of records through duplication, why not just weight all your data?  Assuming your data are not weighted...

COMPUTE DUP_WGT=30.
WEIGHT BY DUP_WGT.

This will count each case 30 times.

Bruce A. Phillips
Professor of Sociology & Jewish Communal Studies
Louchheim School of Judaic Studies,
Hebrew Union College and University of Southern California
3077 University Ave.
Los Angeles, CA 90007
213-765-2151



----- Original Message -----
From: David Marso <[hidden email]>
Date: Tuesday, December 13, 2011 10:47 pm
Subject: Re: create multiple records from one record
To: [hidden email]

> Not sure *WHY* you would wish to do this.
> OTOH:
> Here is an easy way.
> --
> LOOP SUBREC=1 TO 30.
> XSAVE OUTFILE "C:\TEMP\REPEAT30.sav" .
> END LOOP.
> EXE.
> GET FILE "C:\TEMP\REPEAT30.sav".
>
>
> <Owen Power&gt; wrote
> >
> > I have a file of about 300 records. For each unique
> ‘RecordID’ on the
> > file
> > I am trying to create 30 duplicates of the record so that I end
> up with
> > 9000 records. Then for each unique ‘RecordID’ I want to
> number the 30
> > created records from 01 to 30.
> >
> > Could someone suggest how I might do this in SPSS V.20?
> >
> > Thanks.
> >
> > =====================
> > To manage your subscription to SPSSX-L, send a message to
> > LISTSERV@.UGA (not to SPSSX-L), with no body text except the
> > command. To leave the list, send the command
> > SIGNOFF SPSSX-L
> > For a list of commands to manage subscriptions, send the command
> > INFO REFCARD
> >
>
>
> --
> View this message in context: http://spssx-
> discussion.1045642.n5.nabble.com/create-multiple-records-from-one-
> record-tp5073595p5073662.html
> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> [hidden email] (not to SPSSX-L), with no body text
> except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD
>

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD