Date: Mon, 24 May 2004 10:40:14 -0400
Reply-To: Raynald Levesque <rlevesque@videotron.ca>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Raynald Levesque <rlevesque@videotron.ca>
Subject: Re: Filename with date
In-Reply-To: <6.1.0.6.2.20040524151909.02491ec0@mail.bitbros.it>
Content-type: text/plain; charset=US-ASCII
Hi
This is one way:
* Objective: Save data file with the current date as part of the name.
* Define dummy data .
DATA LIST FREE /a.
BEGIN DATA
1 2 3
END DATA.
* Define a macro which will yield the current date.
STRING #cdate(A9).
COMPUTE #cdate=$DATE.
DO IF $casenum=1.
WRITE OUTFILE 'c:\temp\temp.sps' /"DEFINE !date()'"#cdate"'!ENDDEFINE.".
END IF.
EXECUTE.
* Run the macro.
INCLUDE 'c:\temp\temp.sps'.
SAVE OUTFILE='c:\temp\example1_' + !date + '.sav'.
HTH
Raynald Levesque rlevesque@videotron.ca
Visit my SPSS site: http://pages.infinit.net/rlevesqu/
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of
studentSPSS
Sent: May 24, 2004 9:23 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Filename with date
Hi everybody,
I want just to save a .sav with the current system date.
For example, I want to save "example1_24_may_2004.sav" (or some other date
format)
The parameters could be also the name before the date (example1)
Any suggestion about the solution would be greatly appreciated.
Thanks
spssStudent
Italy