|
I'm running SPSS17 and I'm trying to run a syntax file from the command prompt.
It's a simple set of test syntax: GET FILE ='TestData.sav'. OMS /SELECT TABLES /IF COMMANDS=['Means'] SUBTYPES=['Report'] /DESTINATION FORMAT=XLS OUTFILE='C:\Work\Temporary\TestBatch'. Means TestVar. OMSEND. This runs fine from the syntax editor and creates the specified Excel file. When I type this in the command prompt: c:>statistics -production "c:\work\temporary\TestSyntax.sps" The window pauses for awhile, as if it is running the syntax, then the c:> prompt returns, but there is no Excel file. Any ideas what I am doing wrong and how I should get it to work? I'd love to be able to run syntax from batch files and I've read that the analyses run faster without the GUI open. Mark ________________________________________ From: Mark Vande Kamp Sent: Monday, August 23, 2010 2:31 PM To: [hidden email] Subject: Complex batch sequence I am working on a large database/analysis where we are using SQL, a binary utility program, and SPSS. A common sequence is to: 1) use SQL to pull a two sets of data in tab-delimited text format 2) use our utility to match and merge the datasets (the utility does this MUCH faster than it could be programmed in SQL) 3) import the merged text file into SPSS We want to be able to set this sequence up as a batch process. I know that SPSS can incorporate SQL commands, but the need to run the utility on a text file seems to rule that approach out. A Python script seems like the way to go. Unfortunately, I'm clueless about Python. I guess I could go about learning Python from the ground up, but I generally find it much faster to work from relevant examples. So, I'm looking for examples of Python scripts that control a batch process by submitting appropriate commands to a sequence of different applications. From my research so far, it looks like I want my specific script to: 1) submit a pre-specified and formatted 'sqlcmd' command line that executes a stored query (XX.sql file) and saves the output as a text file, 2) wait until SQL is finished writing to the specified text file 3) submit the binary (XX.exe) command with pre-specified parameters 4) wait until the binary has finished writing to the specified text file 5) starts SPSS and executes a syntax file that reads the processed text file Does that all make sense? Any help with examples or other tips? Thanks, Mark ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
|
You cannot execute a syntax file from the
command prompt. You need to define a production job in the UI and then
execute the production job from the command prompt. That production job
would identify the syntax file you want to run.
Search for "production job" in the online help.
I'm running SPSS17 and I'm trying to run a syntax file from the command prompt. It's a simple set of test syntax: GET FILE ='TestData.sav'. OMS /SELECT TABLES /IF COMMANDS=['Means'] SUBTYPES=['Report'] /DESTINATION FORMAT=XLS OUTFILE='C:\Work\Temporary\TestBatch'. Means TestVar. OMSEND. This runs fine from the syntax editor and creates the specified Excel file. When I type this in the command prompt: c:>statistics -production "c:\work\temporary\TestSyntax.sps" The window pauses for awhile, as if it is running the syntax, then the c:> prompt returns, but there is no Excel file. Any ideas what I am doing wrong and how I should get it to work? I'd love to be able to run syntax from batch files and I've read that the analyses run faster without the GUI open. Mark ________________________________________ From: Mark Vande Kamp Sent: Monday, August 23, 2010 2:31 PM To: [hidden email] Subject: Complex batch sequence I am working on a large database/analysis where we are using SQL, a binary utility program, and SPSS. A common sequence is to: 1) use SQL to pull a two sets of data in tab-delimited text format 2) use our utility to match and merge the datasets (the utility does this MUCH faster than it could be programmed in SQL) 3) import the merged text file into SPSS We want to be able to set this sequence up as a batch process. I know that SPSS can incorporate SQL commands, but the need to run the utility on a text file seems to rule that approach out. A Python script seems like the way to go. Unfortunately, I'm clueless about Python. I guess I could go about learning Python from the ground up, but I generally find it much faster to work from relevant examples. So, I'm looking for examples of Python scripts that control a batch process by submitting appropriate commands to a sequence of different applications. From my research so far, it looks like I want my specific script to: 1) submit a pre-specified and formatted 'sqlcmd' command line that executes a stored query (XX.sql file) and saves the output as a text file, 2) wait until SQL is finished writing to the specified text file 3) submit the binary (XX.exe) command with pre-specified parameters 4) wait until the binary has finished writing to the specified text file 5) starts SPSS and executes a syntax file that reads the processed text file Does that all make sense? Any help with examples or other tips? Thanks, Mark ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
| Free forum by Nabble | Edit this page |
