Date: Tue, 27 Aug 2002 11:55:51 -0500
Reply-To: "Marks, Jim" <jim.marks@lodgenet.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: "Marks, Jim" <jim.marks@lodgenet.com>
Subject: Re: SAVE function
Content-Type: text/plain; charset="iso-8859-1"
Hi Steven and List:
Try this:
** sample data.
data list free /id data1 data2.
BEGIN DATA
1000 11 10
1001 20 25
1002 11 15
1003 15 10
END DATA.
DEFINE !filesav ().
!DO !var= 1000 !TO 1003.
COMP filter_$ eq (id eq !var).
FILTER by filter_$.
exe.
** edit the outfile command with your preferred path.
SAVE OUTFILE=!QUOTE(!CONCAT("C:\spss-test\test",!var,".sav"))
/unselected=delete /compressed /drop=filter_$.
!DOEND.
* remove the filter from the original file.
FILTER OFF.
!ENDDEFINE.
** run the macro.
!filesav.
This macro requires consecutively numbered id's-- edit the "!DO !var"
command to cover your variable list.an alternate version can be written to
run non-consecutive and/or non-numeric ids.
HTH
Jim Marks
Market Analyst
LodgeNet Entertainment Corporation
605.988.1616
IMPORTANT NOTICE: This communication (including any attached files) is
intended for the entity to which it is directed and may contain confidential
and proprietary information of LodgeNet Entertainment Corporation. The
communication is provided under the terms of the nondisclosure agreement
between LodgeNet and the intended recipient. If you are not acting solely
on behalf of the intended recipient with respect to the receipt of this
communication, you are not authorized to receive, retain, print or forward
this communication. In that event, you are directed to destroy this
communication (including any attached files), and to advise
ipmanager@lodgenet.com that you received this communication in error. If
you are authorized to receive this communication on behalf of the intended
recipient, you are obligated to treat it as confidential and proprietary
information of LodgeNet Entertainment Corporation, in accordance with the
nondisclosure agreement mentioned above.
-----Original Message-----
From: Steven Shapiro [mailto:shapirsb@MUSC.EDU]
Sent: Monday, August 26, 2002 12:31 PM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: SAVE function
I am in the process of running a specific syntax for a list of subjects
(1001-1300) which selects their data and saves the output under a filename
specific to that subject; i.e., 'test1000.SAV'. At this point I use find
and replace to replace each subject ID in the syntax, however this is quite
cumbersome. I have tried to accomplish the same thing with a DO REPEAT
syntax and have been unsuccessful. Does anyone have any suggestions as to
how this could be accomplished. Thank you for your help.
-Steve