Running Scripts with SPSS Syntax

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

shijin83
Posts: 7
Joined: Wed Jul 18, 2012 3:30 pm

Running Scripts with SPSS Syntax

Postby shijin83 » Tue Jul 24, 2012 2:57 pm

Dear SPSS Users

I have a rather generic question this time, and I found some partial answers to it already, but somehow I still don't understand everything correctly, so I decided to ask here.
I have an SPSS Syntax Script that defines Value Labels for a set of variables. In one instance, there are over 2500 separate Labels to be applied to the values. I generated the list using VBA from an excel table and just pasted it in SPSS. This works perfectly, but I did not even start with the actual process and already my syntax file is over 2600 lines long. This is rather uncomfortable and I was wondering if it is possible to "outsource" this part of the syntax file and then open it via the Script command.

The answers I found on the net were a bit confusing and there were several hints that I need to use VBA scripts or Python scripts to do this. So my question is:
Is it not possible to simply save the part that defines the value labels in a separate .sps file and then run it using the Script command in the main syntax file?
Converting the whole SPSS Syntax into string variables in VBA seems a somewhat very tedious task...

Thank you very much for help!

Best regards,

Jonas
Penguin_Knight
Posts: 473
Joined: Thu Apr 05, 2012 5:58 pm

Re: Running Scripts with SPSS Syntax

Postby Penguin_Knight » Tue Jul 24, 2012 5:16 pm

Use INCLUDE:

Code: Select all

INCLUDE "C:\Temp\MyOtherSyntax.sps" .
EXECUTE .
shijin83
Posts: 7
Joined: Wed Jul 18, 2012 3:30 pm

Re: Running Scripts with SPSS Syntax

Postby shijin83 » Wed Jul 25, 2012 9:55 am

Dear PenguinKnight

Thank you so much for helping me out all the time! :D

Best regards,

Jonas

Who is online

Users browsing this forum: No registered users and 1 guest

cron