LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2010)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 23 Jun 2010 06:56:06 -0600
Reply-To:   Jon K Peck <>
Sender:   "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:   Jon K Peck <>
Subject:   Re: Adding a date to a file name through syntax
Comments:   To: Andreas Voelp <>
In-Reply-To:   <>
Content-Type:   multipart/alternative;

You can generate file names with date and time information using the function CreateFileNameWDate in the module available from SPSS Developer Central ( There is a companion function in the same module named FindMostRecentFile that will return the file name of the most recent file by using the naming structure produced by the first function.

Here is an example program that saves the active data file using this naming scheme. begin program. import spss, spssaux, spssaux2 spssaux.SaveDataFile(spssaux2.CreateFileNameWDate(basename="Andreas")) end program.

You can omit the basename if the active file already has a name, and the function will build a dated name from the current name (removing any date stamp it already had).


Jon Peck SPSS, an IBM Company 312-651-3435

From: Andreas Voelp <> To: SPSSX-L@LISTSERV.UGA.EDU Date: 06/23/2010 01:14 AM Subject: [SPSSX-L] Adding a date to a file name through syntax Sent by: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>

I would like to add the current date to the file name automatically when saving data files from SPSS using command syntax, as in

SAVE TRANSLATE OUTFILE='xy 2010-06-23.csv'

(however, the date string should be updated automatically to the current date).

Can anybody think of a solution?


-- View this message in context:

Sent from the SPSSX Discussion mailing list archive at

===================== 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 SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD


Back to: Top of message | Previous page | Main SPSSX-L page