HomeStartingEnvironmentDBMSVisualPQLProceduresSQLFormsHost/APIIndex
PQL Procedures homecontents start chapter top of pagebottom of pagenext page index SPSS Save File

SPSS Save File

SPSS®, the Statistical Package for the Social Sciences, is a multi-purpose data analysis and reporting tool. The SPSS SAVE FILE procedure provides an interface to this product. (SPSSX is a synonym for SPSS.)

SPSS SAVE FILE creates a portable file that can be accessed by SPSS. One SPSS case is created for each procedure table record generated by the VisualPQL program. In addition to the data, the dataset contains value and variable labels and missing value indicators.

SPSS SAVE FILE FILENAME = filename
     [ BOOLEAN = ( logical_expression ) ]
     [ LONGLAB ]
     [ NOLABELS ]
     [ PORTABLE ]
     [ SAMPLE    = fraction]
     [ SHORTNAME]
     [ SORT      = [ (n) ] variable [(A)|(D)] , ...]
     [ VARIABLES = varlist | ALL  ]
     [ WEIGHT    =  varname  ]
FILENAME Specifies the filename created by the procedure.

BOOLEAN Specifies which procedure table records are used by the procedure. The procedure table records for which the logical expression is true are used by the procedure. If this option is not specified, all procedure table records are used.

NOLABELS Specifies that variable and value labels are not copied to the SPSS SAVE FILE. This can save time if many labels are involved.

LONGLAB Specifies that the first line of variable documenation (VAR DOC) is used instead of the variable label. If there is no VAR DOC for a variable then the variable label will be used as normal.

PORTABLE Specifies that the output file is in portable file format. By default, the output file is in system file format.

SAMPLE Specifies that a random sample of the procedure table records are used by the procedure. The fraction specifies the percent of records used and is specified as a positive decimal number less than or equal to 1 (one). .25, for example specifies that a 25% sample be used.

SHORTNAME Specifies that a maximum of eight characters is used for variable names output to SPSS. Truncation occurs after eight characters. If any names are truncated, these are reported on the summary report.

Note. If variables have SIR/XS non-standard names, these may not be acceptable SPSS names. SIR/XS does not check this and does not change names. If a truncated name or non-standard name is not the required SPSS name, specify an alternative name that is a valid SPSS name on the VARIABLES clause. e.g.

  VARIABLES = Long_Name_Salary AS SALARY or
  VARIABLES = {Special Name Salary} 'Salary‘ 
This option also truncates variable labels to 40 characters.

SORT Specifies the sequence of the output. n is an integer that specifies the maximum number of records to be sorted. The default for this parameter is either the number of records in the database or the value specified in the sortn parameter and need only be specified if the number of records in the procedure table is greater than the default. The procedure table is sorted by the specified variables in variable list order. A variable name followed by (A) or (D) specifies that for that variable the sort is in Ascending order (the default) or in Descending order.

VARIABLES Specifies the procedure variables to write to the output file. The order in which variables are specified is the order in which they appear in the output file. If this option is not specified, the default variables are output.

WEIGHT Specifies the variable that is the CASWGT variable which provides a permanent weighting of the cases in the SPSS file. The default WEIGHT is 1.

Notes on SPSS Files

Example

RETRIEVAL
PROCESS CASES ALL
AUTOSET
PROCESS REC EMPLOYEE
. GET VARS ALL
. PROCESS REC OCCUP WITH (CURRPOS)
.   GET VARS ALL
. END PROCESS REC
. PERFORM PROCS
END PROCESS REC
END PROCESS CASE

SPSS SAVE FILE
       FILENAME  = 'EMPLOYEE.DAT' /
       VARIABLES = ALL
END RETRIEVAL
When a VisualPQL program with an SPSS interface procedure is run, a summary report is produced and has the following form:

SPSS SAVE FILE - System file
----------------------------

Written to:             'C:\sir2004\alpha\employee.dat'
Number of records:      20
User variables:         14

Variables in save file order
----------------------------

NAME                              GENDER                            MARSTAT                           SSN
BIRTHDAY                          EDUC                              NDEPENDS                          CURRPOS
SALARY                            CURRDATE                          POSITION                          STARTDAT
STARTSAL                          DIVISION

End of SPSS report
------------------

homecontents start chapter top of pagebottom of pagenext page index