Issue running REPORT command via SPSS .NET Plugin

May 17, 2013 at 5:32 PM
Edited May 17, 2013 at 6:57 PM
Hello,
I've written some SPSS code that runs fine in SPSS but gives me a "SpssException is thrown. Error code equals to 3, Serious error." when submitting through the SPSS .NET Plugin. Basically, I'm trying to export a report to a text file using OMS. When the .NET SPSS processor hits the REPORT function I receive the error. Here's my current code.

In SPSS:
OMS
  /SELECT TEXTS TABLES
  /IF COMMANDS=['Report'] SUBTYPES = ['Report']
  /DESTINATION FORMAT=TEXT OUTFILE ='C:\Andrew\@@QCCheck2_OMS.txt' .
 
DATASET ACTIVATE @@QCCheck2_OMS.
REPORT 
  /FORMAT = LIST ALIGN (LEFT) 
  /VARIABLES =  @@TempResult (LABEL) 'Result' Total  'Number of Records' 'Reviewed' 
@@TempDup__IDs 'Number of Duplicate' 'Records'  @@TempDup__Set 'Number of ' 'Duplicate IDs'
@@TempDup_Miss ' ' 'Number of Missing ID(s)' 
  /TITLE = LEFT  'Quality Control Checks: Do all ID variables have unique values and all values are not missing?'
'Dataset: ' + !@@TempInData ' ' 'RESULTS' ' ' 'SUMMARY OF FINDINGS'.

EXECUTE .
OMSEND.
In .NET
SPSSModule.p.SPSSP.Submit("OMS \n" & _
     "  /SELECT TEXTS TABLES \n" & _
     "  /IF COMMANDS=['Report'] SUBTYPES = ['Report'] \n" & _
     "  /DESTINATION FORMAT=TEXT OUTFILE ='H:\Andrew\@@QCCheck2_OMS.txt' . \n")
SPSSModule.p.SPSSP.Submit("DATASET ACTIVATE @@QCCheck2_OMS.   ")
SPSSModule.p.SPSSP.Submit("      REPORT  \n " & _
     "/FORMAT = LIST ALIGN (LEFT) \n " & _
     "/VARIABLES =  @@TempResult (LABEL) 'Result' Total  'Number of Records' 'Reviewed'  \n " & _ 
     "@@TempDup__IDs 'Number of Duplicate' 'Records'  @@TempDup__Set 'Number of ' 'Duplicate IDs' \n " & _
     " @@TempDup_Miss ' ' 'Number of Missing ID(s)' \n " & _
     "/TITLE = LEFT  'Quality Control Checks: Do all ID variables have unique values and all values are not missing?'  \n " & _
     "'Dataset: ' + !@@TempInData ' ' 'RESULTS' ' ' 'SUMMARY OF FINDINGS'. ")

SPSSModule.p.SPSSP.Submit("EXECUTE .")
SPSSModule.p.SPSSP.Submit("OMSEND .")
Does anyone know what's causing the problem? I'm using SPSS 19.
Any help would be greatly appreciated.
Thanks,
Andrew