|
Egon:
Here is one solution:
** sample data.
DATA LIST FREE /id.
BEGIN DATA
1 2 3
END DATA.
** add year month day to file.
STR yr (a4) /mo day (a2).
COMPUTE yr EQ STRING(xdate.year($TIME),F4).
COMPUTE mo EQ STRING(xdate.month($TIME),N2).
COMPUTE day EQ STRING(xdate.mday($TIME),N2).
exe.
** write save command with date to new syntax file.
** Edit the filename and path to fit your system.
TEMPORARY.
SELECT IF $CASENUM EQ 1.
WRITE OUTFILE = 'c:\savewithdate.sps'
/"SAVE OUTFILE ='c:\filename-"yr mo day ".sav.".
EXE.
** delete date variables from data file.
ADD FILE FILE = * /drop = yr mo day.
EXE.
** run syntax file with save.
INCLUDE FILE = 'c:\savewithdate.sps'.
Edit the filename and path to fit your system.
jim
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of
Kraan, Egon
Sent: Friday, May 14, 2004 1:27 PM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Filename with datevalue
I need to be able to save a file where part of the file name is julian date
value. Does anyone have a script, macro, syntax, or anything else that can
handle this?
SAVE OUTFILE='C:\dir\filename0413501.sav'
/COMPRESSED.
where 0413501 is updated based on the actual datevalue.
Thanks
Egon
======================================
Egon Kraan
Beech Acres
Program Evaluation & Quality Improvement
ekraan@BeechAcres.org
http://www.beechacres.org
|