Date formats changing when saving to a text file

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Date formats changing when saving to a text file

Andrew Rudd
Hi All,
 
Currently in my SPSS data set I have a date variable in the format dd.mm.yyyy, however when I save the data set to a text file such as a .csv,  .txt or .dat the date variable changes to mm/dd/yyyy.
 
Is there a setting that I can change or a work around available to ensure that the date stays in the dd.mm.yyyy format?
 
This is not an issue when I save to excel files.
 
Thanks
Andrew
 
Regards

Andrew Rudd
Business Analyst
Finance Now Ltd

DDI 09 845 0823

PO Box 41-335
St Lukes
Auckland

Notice of confidential information: The information contained within this electronic mail message (which includes any associated attachments) is confidential or may be legally privileged. If you are not the intended recipient, you are hereby notified that any use, review, disclosure, re-transmission or copying of this communication is prohibited.
If you have received this email in error, please contact the sender immediately and destroy this message and any attachments

Unintended Recipient: This message (and/or any files transmitted with it) contains confidential and/or privileged information for use by the intended recipient. If you have received this message in error, we apologise and request that you immediately destroy all trace of this message and/or attached files and do not use, copy, disseminate or otherwise action. It would also be appreciated if you could notify the Help Desk on 0800 502 442.

Disclaimer: Any views expressed in this message (or attached files) are those of the individual sender, except where the message clearly states otherwise and the sender is authorised to state them to be the views of the organisation.
Please consider the environment before printing this e-mail

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

====================To manage your subscription to SPSSX-L, send a message to
[hidden email] (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
Reply | Threaded
Open this post in threaded view
|

Re: Date formats changing when saving to a text file

Oliver, Richard
Try Save Translate with /textoptions format=variable, as in:

data list free /datevar (edate11).
begin data
30.12.2008
end data.
save translate /outfile='/temp/csvfile.csv'
  /type=csv /textoptions format=variable
  /replace.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Andrew Rudd
Sent: Monday, January 05, 2009 3:59 PM
To: [hidden email]
Subject: Date formats changing when saving to a text file

Hi All,

Currently in my SPSS data set I have a date variable in the format dd.mm.yyyy, however when I save the data set to a text file such as a .csv,  .txt or .dat the date variable changes to mm/dd/yyyy.

Is there a setting that I can change or a work around available to ensure that the date stays in the dd.mm.yyyy format?

This is not an issue when I save to excel files.

Thanks
Andrew

Regards

Andrew Rudd
Business Analyst
Finance Now Ltd

DDI 09 845 0823

PO Box 41-335
St Lukes
Auckland

Notice of confidential information: The information contained within this electronic mail message (which includes any associated attachments) is confidential or may be legally privileged. If you are not the intended recipient, you are hereby notified that any use, review, disclosure, re-transmission or copying of this communication is prohibited.
If you have received this email in error, please contact the sender immediately and destroy this message and any attachments

Unintended Recipient: This message (and/or any files transmitted with it) contains confidential and/or privileged information for use by the intended recipient. If you have received this message in error, we apologise and request that you immediately destroy all trace of this message and/or attached files and do not use, copy, disseminate or otherwise action. It would also be appreciated if you could notify the Help Desk on 0800 502 442.

Disclaimer: Any views expressed in this message (or attached files) are those of the individual sender, except where the message clearly states otherwise and the sender is authorised to state them to be the views of the organisation.
Please consider the environment before printing this e-mail

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

=======
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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