SPSS Statistics

SPSS Statistics

Your hub for statistical analysis, data management, and data documentation. Connect, learn, and share with your peers! 

 View Only
  • 1.  Save new Dataset generated by ADD FILES

    Posted Thu August 25, 2022 01:57 PM
    Hello,

    I am using ADD FILES with two source datasets retrieved from *.sav files.
    Using syntax, I'd like to
    (i) save the resulting dataset to a new file on disk using syntax and
    (ii) bring the window of the resulting dataset to the front.

    Plain syntax is strongly preferred. Python would be the second choice if inevitable.

    So far I tried these approaches.

    GET FILE 'My/Path/New.sav'.
    DATASET NAME New_Cases.

    GET FILE 'My/Path/Old.sav'.
    DATASET NAME Old_Cases.

    DATASET ACTIVATE Old_Cases.
    DATASET COPY All_Cases.
    DATASET ACTIVATE All_Cases.

    * Version A; adds new cases to the active and frontmost dataset "All_Cases".
    * How can I save the modified Dataset?
    ADD FILES
    /FILE = *
    /FILE = 'New_Cases'
    /KEEP = ALL.
    EXECUTE.

    * Version B; generates a new, unnamed dataset containing all cases. Window of new dataset is hidden.
    * How can I save the new Dataset to disk an bring its window the front?
    ADD FILES
    /FILE = 'Old_Cases'
    /FILE = 'New_Cases'
    /KEEP = ALL.
    EXECUTE.

    * Version C; generates a new, unnamed dataset containing all cases. Window of new dataset is hidden.
    * How can I save the new Dataset to disk an bring its window the front?
    ADD FILES
    /FILE = 'All_Cases'
    /FILE = 'New_Cases'
    /KEEP = ALL.
    EXECUTE.



    ------------------------------
    Frank Watzl
    ------------------------------

    #SPSSStatistics


  • 2.  RE: Save new Dataset generated by ADD FILES

    Posted Fri August 26, 2022 06:26 PM
    As far as I'm aware, you cannot make a hidden dataset visible. If declared hidden it will stay hidden. Otherwise it is fully functional.

    ------------------------------
    Kirill Orlov
    ------------------------------