SaveAs Method (Python)

Saves the dataset to the specified file.

Syntax

SpssDataDoc.SaveAs(fileName,password=None)

Parameters

fileName. The path and file name of the data file, as a string.

password. An optional string specifying the password that will be required to open the file. Only applies if you want to encrypt the data file. Passwords are limited to 10 characters and are case-sensitive. All spaces, including leading and trailing spaces, are retained.

Note: The save operation is carried out asynchronously, which means that execution continues without waiting for the save operation to complete. If you require subsequent access to the saved file using the Python open function, you can attempt to open the file from a try block within a while loop, continuing to loop until the open operation succeeds.

Creating strong passwords

  • Use eight or more characters.
  • Include numbers, symbols and even punctuation in your password.
  • Avoid sequences of numbers or characters, such as "123" and "abc", and avoid repetition, such as "111aaa".
  • Do not create passwords that use personal information such as birthdays or nicknames.
  • Periodically change the password.

Warning: Passwords cannot be recovered if they are lost. If the password is lost the file cannot be opened.

Note: Encrypted data files and output documents cannot be opened in versions of IBM® SPSS® Statistics prior to version 21. Encrypted syntax files cannot be opened in versions prior to version 22.