In the meantime I found that this does the trick with a dataset previously opened and modified in the GUI:
BEGIN PROGRAM PYTHON3.
import SpssClient
SpssClient.StartClient()
ActiveDataDoc = SpssClient.GetActiveDataDoc()
DocPath = ActiveDataDoc.GetDocumentPath()
ActiveDataDoc.SaveAs(DocPath)
END PROGRAM.
If the dataset was opened with GET FILE, the document path is known anyway and can simply be repeated in the SAVE OUTFILE statement. A default argument would still be easier to use.
My use case is solved. Thank you very much for the discussion.
------------------------------
Frank Watzl
------------------------------
Original Message:
Sent: Tue September 06, 2022 03:24 PM
From: Rick Marcantonio
Subject: SAVE in place vs. SAVE OUTFILE = 'my/path/file.sav'
The toolbar button appends the required OUTFILE spec. To see that, set PRINTBACK on.
It wouldn't be out of the question to make OUTFILE assume a default (the original path/file location), but obviously that's a change to the existing code.
------------------------------
Rick Marcantonio
Quality Assurance
IBM
Original Message:
Sent: Tue September 06, 2022 03:11 PM
From: Jon Peck
Subject: SAVE in place vs. SAVE OUTFILE = 'my/path/file.sav'
Well, there is a toolbar button that does exactly that without any additional specification.
--
Original Message:
Sent: 9/6/2022 1:31:00 PM
From: David Dwyer
Subject: RE: SAVE in place vs. SAVE OUTFILE = 'my/path/file.sav'
Hi Frank,
Whether you write the SAVE command syntax yourself or you use the IBM SPSS Statistics graphic user interface, the result is the same. The backend will attempt to process a SAVE command. The SAVE command has required OUTFILE specification.
See https://www.ibm.com/docs/en/spss-statistics/28.0.0?topic=save-outfile-subcommand-command
------------------------------
David Dwyer
SPSS Technical Support
IBM Software
Original Message:
Sent: Sat September 03, 2022 06:11 AM
From: Frank Watzl
Subject: SAVE in place vs. SAVE OUTFILE = 'my/path/file.sav'
Is there a way to simply save an SPSS dataset (previously opened with either GET FILE or using the GUI)? Just save it to the location where it already exists on disk, without specifying a path?
The following syntax of course doesn't work, but I hope you get the idea.
GET FILE '/my/Path/data.sav'.
* Transformations go here.
SAVE OUTFILE. /* no file spec, just to the location it was opened from.
-
Frank Watzl
#SPSSStatistics