379x Filetype PDF File size 1.92 MB Source: www.ibm.com
Python Reference Guide for IBM SPSS
Statistics
IBM
Note
Before using this information and the product it supports, read the information in “Notices” on page
245.
Product Information
® ®
This edition applies to version 28, release 0, modification 0 of IBM SPSS Statistics and to all subsequent releases and
modifications until otherwise indicated in new editions.
©
Copyright International Business Machines Corporation .
US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with
IBM Corp.
Contents
Chapter 1. Overview.............................................................................................. 1
Chapter 2. Python Integration Package.................................................................. 3
Introduction to Python Programs................................................................................................................3
Working with Python Program Blocks....................................................................................................4
Python Syntax Rules...............................................................................................................................7
Working with Multiple Versions of IBM SPSS Statistics ....................................................................... 8
Python and IBM SPSS Statistics Working Directories........................................................................... 9
Running IBM SPSS Statistics from an External Python Process........................................................... 9
Localizing Output from Python Programs............................................................................................11
Python Functions and Classes...................................................................................................................14
spss.ActiveDataset Function ...............................................................................................................15
spss.AddProcedureFootnotes Function ..............................................................................................15
spss.BasePivotTable Class ..................................................................................................................16
spss.BaseProcedure Class .................................................................................................................. 35
spss.CreateXPathDictionary Function ................................................................................................ 37
spss.Cursor Class .................................................................................................................................37
spss.Dataset Class ...............................................................................................................................53
spss.DataStep Class ............................................................................................................................ 69
spss.DeleteXPathHandle Function ..................................................................................................... 70
spss.EndDataStep Function ................................................................................................................ 70
spss.EndProcedure Function .............................................................................................................. 70
spss.EvaluateXPath Function ..............................................................................................................70
spss.GetCaseCount Function .............................................................................................................. 71
spss.GetDataFileAttributeNames Function ........................................................................................71
spss.GetDataFileAttributes Function ..................................................................................................71
spss.GetDatasets Function ................................................................................................................. 71
spss.GetDefaultPlugInVersion Function .............................................................................................71
spss.GetFileHandles Function ............................................................................................................ 72
spss.GetHandleList Function .............................................................................................................. 72
spss.GetImage Function ..................................................................................................................... 72
spss.GetLastErrorLevel and spss.GetLastErrorMessage Functions ...................................................73
spss.GetMultiResponseSetNames Function .......................................................................................74
spss.GetMultiResponseSet Function .................................................................................................. 74
spss.GetOMSTagList Function .............................................................................................................74
spss.GetSetting Function .................................................................................................................... 74
spss.GetSplitVariableNames Function ............................................................................................... 74
spss.GetSPSSLocale Function .............................................................................................................74
spss.GetSPSSLowHigh Function ......................................................................................................... 75
spss.GetVarAttributeNames Function ................................................................................................ 75
spss.GetVarAttributes Function .......................................................................................................... 75
spss.GetVariableCount Function .........................................................................................................75
spss.GetVariableFormat Function .......................................................................................................76
spss.GetVariableLabel Function ..........................................................................................................76
spss.GetVariableMeasurementLevel Function ................................................................................... 76
spss.GetVariableName Function .........................................................................................................77
spss.GetVariableRole Function ........................................................................................................... 77
spss.GetVariableType Function ...........................................................................................................77
spss.GetVarMissingValues Function ................................................................................................... 77
spss.GetWeightVar Function ............................................................................................................... 78
iii
spss.GetXmlUtf16 Function ................................................................................................................ 78
spss.HasCursor Function .....................................................................................................................78
spss.IsActive Function ........................................................................................................................ 78
spss.IsDistributedMode Function .......................................................................................................79
spss.IsOutputOn Function .................................................................................................................. 79
spss.Procedure Class .......................................................................................................................... 79
spss.PyInvokeSpss.IsUTF8mode Function ........................................................................................ 80
spss.PyInvokeSpss.IsXDriven Function ..............................................................................................80
spss.SetActive Function ...................................................................................................................... 80
spss.SetDefaultPlugInVersion Function ............................................................................................. 80
spss.SetMacroValue Function .............................................................................................................81
spss.SetOutput Function .....................................................................................................................81
spss.SetOutputLanguage Function .....................................................................................................81
spss.ShowInstalledPlugInVersions Function ..................................................................................... 82
spss.SplitChange Function ..................................................................................................................82
spss.StartDataStep Function .............................................................................................................. 83
spss.StartProcedure Function .............................................................................................................83
spss.StartSPSS Function ..................................................................................................................... 85
spss.StopSPSS Function ......................................................................................................................86
spss.Submit Function ..........................................................................................................................87
spss.TextBlock Class ........................................................................................................................... 87
Chapter 3. Scripting Guide...................................................................................89
Introduction to Python Scripts.................................................................................................................. 89
Script Editor for the Python Programming Language..........................................................................90
Class Hierarchy for Scripting Facility .................................................................................................. 90
Getting Started with Python Scripts.................................................................................................... 91
SpssClient Class ........................................................................................................................................94
CreateNewServer Method ...................................................................................................................94
Exit Method ..........................................................................................................................................95
GetActiveDataDoc Method ..................................................................................................................95
GetConfiguredServers Method ............................................................................................................95
GetCurrentDirectory Method ...............................................................................................................95
GetCurrentServer Method ...................................................................................................................95
GetDataDocuments Method ................................................................................................................95
GetDefaultJCVersion Method ..............................................................................................................96
GetDefaultServer Method ................................................................................................................... 96
GetDesignatedOutputDoc Method ......................................................................................................96
GetDesignatedSyntaxDoc Method ......................................................................................................96
GetExportOption Method .................................................................................................................... 96
GetLocale Method ............................................................................................................................... 96
GetLocalServer Method .......................................................................................................................97
GetOutputDocuments Method ............................................................................................................97
GetPreference Method ........................................................................................................................ 97
GetScriptContext Method ....................................................................................................................97
GetSPSSOptions Method .....................................................................................................................97
GetSPSSPath Method ..........................................................................................................................98
GetSPSSVersion Method ..................................................................................................................... 98
GetSyntaxDocuments Method ............................................................................................................ 98
GetUIAlerts Method ............................................................................................................................ 98
IsDataDocInUse Method .....................................................................................................................98
IsDistributedMode ...............................................................................................................................99
IsOptionAvailable Method ...................................................................................................................99
LogToViewer Method ........................................................................................................................... 99
NewDataDoc Method ........................................................................................................................ 100
NewOutputDoc Method .....................................................................................................................100
NewSyntaxDoc Method .....................................................................................................................100
iv
no reviews yet
Please Login to review.