SPSS Statistics

 View Only
  • 1.  timestamp

    Posted Wed June 12, 2024 11:00 AM

    Hello, I'm having an issue running the syntax below in v29.  It works in v26.

    BEGIN PROGRAM python3.
    import time, spss
    spss.SetMacroValue("!timestamp", "'" + time.strftime("%Y-%m-%d") + "'")
    end program.
    new file.
    DATA LIST FREE /var freq.
    BEGIN DATA
    1 92 2 134 3 178
    END DATA.
    SAVE TRANSLATE OUTFILE="C:\et\time test " + !timestamp + ".csv" 
        /TYPE=CSV
        /ENCODING='Locale'
        /MAP
        /REPLACE
        /FIELDNAMES
        /CELLS=LABELS.
    execute.

    #SPSS Statistics



    ------------------------------
    Art Jack
    ------------------------------


  • 2.  RE: timestamp

    IBM Champion
    Posted Wed June 12, 2024 11:44 AM
    Well, what is the issue?






  • 3.  RE: timestamp

    Posted Wed June 12, 2024 12:33 PM

    I was getting an error message stating something about encrypting the file, & it wasn't saving an outfile.  But i did just close everything out reran the same syntax & it worked.  



    ------------------------------
    Art Jack
    ------------------------------



  • 4.  RE: timestamp

    IBM Champion
    Posted Wed June 12, 2024 12:52 PM
    The only thing I can think of is if you abbreviated ENCODING ot had a line break, it might have been interpreted as the ENCRYPTED subcommand.