spssb -i -f makeddl.sps -type text -hide PTW
Once the data and DDL files have been generated, they can then be used to create an SDA dataset by running the regular MAKESDA program.
When SPSS is installed, you must also be sure to install the following software components from the SPSS installation disk:
The necessary five modules are the following:
(Find each of these modules in the list of available modules on the SPSS Developer Central site, and download it.)
Python and the SPSS programmability plug-in must be installed first from the SPSS installation disk. After that, the SPSS auxiliary modules (’spssaux’ and the other four modules) should be installed in the Python installation’s "Lib\site-packages" directory (e.g.: C:\Python24\Lib\site-packages). When you install Python on your machine from the SPSS installation disk, note the location of the Python directory so that you will know where to install the SPSS auxiliary modules.
The only thing that needs to be modified for different datasets is the script. The appropriate study title and pathnames need to be inserted into the script, so that you read the correct SPSS file and write the data and DDL files into the desired locations.
In addition to Python and the SPSS-Python Integration Plug-in, you must also download and install the same five Python modules mentioned above from the SPSS Developer Central site.
The point of the editing is to tell SPSS where to get the input SPSS file, and where to put the output data and DDL files. You also specify the study title that you want to appear in the DDL file.
The four lines of the script to edit are lines 108-111. This is what that section of the script looks like:
# EDIT HERE: Specify dataset title, input and output filenames # # IMPORTANT: Be sure to use forward slashes (/), NOT back # slashes (\) between directories in path specifications, e.g., # # asciidata_out = ’h:/mydir/sda/mydata.txt’ # #=================================================== # USER-DEFINED SPECIFICATIONS: #=============================== title = ’SDA Dataset Title’ spssdata_in = ’spssdata’ # Must be .sav or .por asciidata_out = ’asciidata.txt’ ddlfile_out = ’myddl.txt’
title = ’Survey of Political Attitudes’Notice that full pathnames are given for the files, and the location of the files is specified using forward slashes, even for Windows. If the input SPSS file is an SPSS Portable File, be sure to use the ’.por’ suffix (instead of the ’.sav’ suffice) for the name of the SPSS file. The corresponding Portable File version for this example would be:
spssdata_in = ’c:/myaccount/politdata.sav’
asciidata_out = ’c:/myaccount/politdata.txt’
ddlfile_out = ’c:/myaccount/politDDL.txt’
spssdata_in = ’c:/myaccount/politdata.por’
When you have completed this editing, the script is ready to run.
DDL | Data Description Language used by SDA Programs |
xconvert | Convert SPSS/SAS/Stata syntax files to DDL |
ddltox | SDA program to convert DDL files to SPSS/SAS/Stata/DDI |