SPSS Statistics

 View Only
  • 1.  timestamp

    Posted 20 days ago

    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 20 days ago
    Well, what is the issue?






  • 3.  RE: timestamp

    Posted 20 days ago

    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 20 days ago
    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.