Problem with INCLUDE in SPSS 17.0

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with INCLUDE in SPSS 17.0

SamMichalowski
Hi SPSS'ers,

I call up often used variable-specific programs (e.g., VAL LABEL, RECODE)
with INCLUDE statements.  I recently upgraded to SPSS 17.0 and now VAL LABEL
programs abort.  Here's the body of a syntax file called up in one such
instance:

VALUE LABEL FTERMA
'199809' 'Fall 1998'
'199902' 'Spring 1999'....

The program now aborts the INCLUDE:

>Error # 1 on line 4809.  Command name: '199809
>The first word in the line is not recognized as an SPSS Statistics command.
>This command not executed.

The code runs just fine in-line, but not called up in an INCLUDE statement.
 Any ideas would be greatly appreciated.

Sam

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: Problem with INCLUDE in SPSS 17.0

Bruce Weaver
Administrator
Sam Michalowski wrote
Hi SPSS'ers,

I call up often used variable-specific programs (e.g., VAL LABEL, RECODE)
with INCLUDE statements.  I recently upgraded to SPSS 17.0 and now VAL LABEL
programs abort.  Here's the body of a syntax file called up in one such
instance:

VALUE LABEL FTERMA
'199809' 'Fall 1998'
'199902' 'Spring 1999'....

The program now aborts the INCLUDE:

>Error # 1 on line 4809.  Command name: '199809
>The first word in the line is not recognized as an SPSS Statistics command.
>This command not executed.

The code runs just fine in-line, but not called up in an INCLUDE statement.
 Any ideas would be greatly appreciated.

Sam
INCLUDE FILE follows "batch syntax rules".  The following is from the help file entry:

--- start of help file excerpt ---
Each command must start at the beginning of a new line (no blank spaces before the start of the command), and continuation lines must be indented at least one space. If you want to indent new commands, you can use a plus sign, dash, or period as the first character at the start of the line and then indent the actual command. The period at the end of the command is optional. This setting is compatible with the syntax rules for command files included with the INCLUDE command.
--- end of help file excerpt ---

Notice the bit about continuation lines being indented at least one space.  In other words, your VALUE LABELS example would need to look like this:

VALUE LABEL FTERMA
 '199809' 'Fall 1998'
 '199902' 'Spring 1999'....

If you don't want to edit all of the files you include, you might consider using INSERT FILE.  Again from the help:

"INSERT is a newer, more powerful and flexible alternative to INCLUDE. Files included with INCLUDE must always adhere to batch syntax rules, and command processing stops when the first error in an included file is encountered. You can effectively duplicate the INCLUDE behavior with SYNTAX=BATCH and ERROR=STOP on the INSERT command."

What is implied, but not stated explicitly, is that INSERT does NOT have to adhere to batch syntax rules.  Look it up.

--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).