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 (September 2005)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 21 Sep 2005 17:50:08 -0400
Reply-To:     Richard Ristow <>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Richard Ristow <>
Subject:      Re: datestamp in output file name
In-Reply-To:  <>
Content-Type: text/plain; charset="us-ascii"; format=flowed

At 02:31 PM 9/21/2005, Vishal Dave wrote:

>I use SPSS 13.0 and use macro to assign date to the data. The >following >sample code saves the data with name DATAmmddyyyy format in C:\TEMP >folder.

It's fine, but there's no need to use three separate output files. Instead, develop the name BEFORE you write it out, and write it once:

Untested code, but like this. Or see my posting of Wed, 24 Aug 2005 17:43:26 -0400, which was tested (though not recently). Instead of

DO IF $casenum=1. WRITE OUTFILE 'c:\temp\temp1.sps' /"DEFINE !year() '"#cyear"'!ENDDEFINE.". END IF. DO IF $casenum=1. WRITE OUTFILE 'c:\temp\temp2.sps' /"DEFINE !month() '"#cmonth"'!ENDDEFINE.". END IF. DO IF $casenum=1. WRITE OUTFILE 'c:\temp\temp3.sps' /"DEFINE !day() '"#cday"'!ENDDEFINE.". END IF. EXECUTE.


DO IF $casenum=1. WRITE OUTFILE 'c:\temp\temp.sps' / "DEFINE !dataname()/" + "!QUOTE(!CONCAT('C:\TEMP\DATA',#cmonth!,#cday,#cyear,'.sav'))". !ENDDEFINE. END IF. EXECUTE.

*Define the dataname macro: INCLUDE 'c:\temp\temp.sps'. * And proceed as before: *Define dummy data DATA LIST LIST /var. BEGIN DATA 1 2 3 END DATA. *Save file SAVE OUTFILE = !dataname /COMPRESSED.

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