IBM SPSS Collaboration and Deployment Services > UNICOM Intelligence Professional integration with IBM SPSS Collaboration and Deployment Services > IBM SPSS Collaboration and Deployment Services integration script examples > 1: Exposing the .dms script parameters
 
1: Exposing the .dms script parameters
'==============================================================
' Parameter Definition Help:
' 1. ?? - Input parameters definition
' 2. @@ - Output variables definition
' 3. $$ - Output files definition
'===========================================================================================
' <PARAM_NAME> <TYPE> <DEFAULT_VALUE> <DESCRIPTION>
'--------------------+--------+------------------------------+------------------------------
'?? SELECT_QUERY Text "SELECT * FROM HDATA.Person" "Select query string"
'@@ COMPLETION_CODE Long "0" "Job completion status code"
'$$ OUTPUT_METADATA MDD "\\server\share\person.mdd" "Output person metadata file"
'$$ OUTPUT_CASEDATA DDF "\\server\share\person.ddf" "Output person casedata file"
'===========================================================================================

' Default value for parameters
#ifndef SELECT_QUERY
  #define SELECT_QUERY "SELECT * FROM HDATA.Person"
#endif
#ifndef OUTPUT_METADATA
  #define OUTPUT_METADATA "\\server\share\person.mdd"
#endif
#ifndef OUTPUT_CASEDATA
  #define OUTPUT_CASEDATA "\\server\share\person.ddf"
#endif

' Clean output files
Event(OnBeforeJobStart, "Clean output files")
  Dim fso
  Set fso = CreateObject("Scripting.FileSystemObject")

  If fso.FileExists(OUTPUT_METADATA) Then fso.DeleteFile(OUTPUT_METADATA)
  If fso.FileExists(OUTPUT_CASEDATA) Then fso.DeleteFile(OUTPUT_CASEDATA)
End Event

InputDatasource(myInputDataSource)
  ConnectionString = " _
    Provider = mrOleDB.Provider.2; _
    Data Source=mrDataFileDsc; _
    Location = C:\Program Files\IBM\SPSS\DataCollection\6\DDL\Data\Data Collection File\household.ddf; _
    Initial Catalog = C:\Program Files\IBM\SPSS\DataCollection\6\DDL\ Data\Data Collection File\household.mdd"
  SelectQuery = SELECT_QUERY
End InputDatasource

OutputDatasource(myOutputDataSource)
  ConnectionString = " _
    Provider = mrOleDB.Provider.2; _
    Data Source = mrDataFileDsc; _
    Location = " + OUTPUT_CASEDATA
  MetaDataOutputName = OUTPUT_METADATA
End OutputDatasource

Event(OnJobEnd)
  Dim COMPLETION_CODE

  ' COMPLETION_CODE value decided by user logic
  Set COMPLETION_CODE = 1000
End Event
Note The #define directive is used to substitute text in a source file and to define identifiers whose values can be tested in an #if directive.
See also
2: .dms parameters as displayed in the IBM SPSS Collaboration and Deployment Services job step
IBM SPSS Collaboration and Deployment Services integration script examples