*(Q) Every hour, I would like SPSS to automatically get data from an ODBC data base and export HTML output to a given folder. *(A) Posted to SPSS newsgroup on 2001/11/22 by Frank van Rooij I am a beginner in writing scripts but this worked well on my system (SPSS 10.0.7): You'll need 1 syntax file (*.sps) and 1 script file (*.sbs) The syntax looks like this: GET FILE='C:\\Data\\Datafile.sav'. * You'll use ODBC specifications here. FREQUENCIES var1 . * Assume your analysis is running frequencies SCRIPT 'C:\\scripts\\script1.sbs'. * At the end of the syntax this script starts The script looks like this: Sub Main ' This command will export your output to HTML, ' the HTML file will be overwritten each time: Dim objOutputDoc As ISpssOutputDoc Set objOutputDoc=objSpssApp.GetDesignatedOutputDoc objSpssApp.Alerts = False objOutputDoc.ExportDocument (SpssAll, "c:\\html\\outputfile.spo", SpssFormatHtml, True) ' This command will clear your output file, ' so it will be ready for the next analysis: Set objOutputDoc=objSpssApp.GetDesignatedOutputDoc objOutputDoc.SelectAll objOutputDoc.Delete ' Waiting for 1 hour... Wait(3600) ' 3600 seconds = 1 hour ' ...then start the syntax again (be sure no other syntax files are opened): Dim objSyntaxDoc As ISpssSyntaxDoc Set objSyntaxDoc=objSpssApp.GetDesignatedSyntaxDoc objSyntaxDoc.Run ' And so on End Sub The procedure will end if you close the syntax file .