Error when running aggregate outfile

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

Error when running aggregate outfile

Keval Khichadia
Hi,
 
I have a list of courses and want to count the number of students in each course only for Spring 2008 (2081). I am running the below syntax, but keep getting this error message. Does anyone know why this error is occuring, or another way to write the syntax?
 
temp.
select if schk_term = '2081'.
aggregate outfile = * mode = addvariables overwrite = yes
/break = call
/EnrollCount = Nu(ID).
 
An SPSS program error has occurred: A procedure has attempted to delete
variables when that procedure was subject to a TEMPORARY command.  The error
was detected in subroutine TGOBD1.  Please note the circumstances under which
this error occurred, attempting to replicate it if possible, and then notify
SPSS Technical Support.
This is an error from which SPSS cannot recover.
The SPSS run will terminate now.
 
 
Thanks,
 
Keval

Reply | Threaded
Open this post in threaded view
|

Re: Error when running aggregate outfile

Bruce Weaver
Administrator
Keval Khichadia wrote
Hi,
 
I have a list of courses and want to count the number of students in each course only for Spring 2008 (2081). I am running the below syntax, but keep getting this error message. Does anyone know why this error is occuring, or another way to write the syntax?
 
temp.
select if schk_term = '2081'.
aggregate outfile = * mode = addvariables overwrite = yes
/break = call
/EnrollCount = Nu(ID).
 
An SPSS program error has occurred: A procedure has attempted to delete
variables when that procedure was subject to a TEMPORARY command.  The error
was detected in subroutine TGOBD1.  Please note the circumstances under which
this error occurred, attempting to replicate it if possible, and then notify
SPSS Technical Support.
This is an error from which SPSS cannot recover.
The SPSS run will terminate now.


Thanks,

Keval
What happens if you replace...

temp.
select if schk_term = '2081'.

with...

compute f = (schk_term EQ '2081').
filter by f.

The error message specifically mentions the procedure being subject to a TEMPORARY command; so I'm wondering if using a filter instead will get around whatever the problem is.  (Don't forget to turn the filter off afterward.)

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

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.
Reply | Threaded
Open this post in threaded view
|

Re: Error when running aggregate outfile

Mike
I think that there is a fundamental problem with what one
wants SPSS to do.  The "Temporary" command cannot be
used with the aggregate procedure because the aggregate
procedure will alter the current system file (the code
"outfile=*  mode=addvariables overwrite yes" will cause
this; check the command info on Temp and Aggregrate).
Do you need to have the class size aggregated variable
for every cases in your selected classes?  If so, create
an aggregate file with class year ("2081"), class ID (the
unique identifier for each class), and number of students
in class.  Then run a "Match Files" using the aggregated
file as a "table" (see info on "Match Files" procedures).

It is unclear what your goal is.  Do you simply want a
printable output with the number of students for a select
group of classes?    One could obtain this in a table-like
format through the Report procedure while using the
"temp./select if.../Report" sequence of commands.
If you want to do analyses with the class sizes, then
you probably may want to create the new aggregate file
and match it to you current system file as I suggest above.

Sorry if I misunderstand what you trying to do.

-Mike Palij
New York University
[hidden email]


----- Original Message -----
From: "Bruce Weaver" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, July 16, 2009 2:32 PM
Subject: Re: Error when running aggregate outfile


> Keval Khichadia wrote:
>>
>> Hi,
>>
>> I have a list of courses and want to count the number of students in each
>> course only for Spring 2008 (2081). I am running the below syntax, but
>> keep getting this error message. Does anyone know why this error is
>> occuring, or another way to write the syntax?
>>
>> temp.
>> select if schk_term = '2081'.
>> aggregate outfile = * mode = addvariables overwrite = yes
>> /break = call
>> /EnrollCount = Nu(ID).
>>
>> An SPSS program error has occurred: A procedure has attempted to delete
>> variables when that procedure was subject to a TEMPORARY command.  The error
>> was detected in subroutine TGOBD1.  Please note the circumstances under which
>> this error occurred, attempting to replicate it if possible, and then notify
>> SPSS Technical Support.
>> This is an error from which SPSS cannot recover.
>> The SPSS run will terminate now.
>>
>>
>> Thanks,
>>
>> Keval
>>
>>
>
> What happens if you replace...
>
> temp.
> select if schk_term = '2081'.
>
> with...
>
> compute f = (schk_term EQ '2081').
> filter by f.
>
> The error message specifically mentions the procedure being subject to a
> TEMPORARY command; so I'm wondering if using a filter instead will get
> around whatever the problem is.  (Don't forget to turn the filter off
> afterward.)
>
>
>
> -----
> --
> Bruce Weaver
> [hidden email]
> http://sites.google.com/a/lakeheadu.ca/bweaver/
> "When all else fails, RTFM."

=====================
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: Error when running aggregate outfile

SPSS Support
I was not able to locate anything in the documentation for TEMPORARY, SELECT IF, or AGGREGATE that said that these could not be used together in this way. I can replicate the error by attempting to overwrite an existing variable. If I run this structure without the named variable existing in the file, it creates it as desired, with values for the selected cases and missing values for others. If I run the same structure but with OVERWRITE=NO with the variable already in the file, it produces the following error:

>Error # 10910.  Command name: AGGREGATE The definition of a new
>variable on the AGGREGATE command specifies a new variable name that
>duplicates the name of an existing variable.  To replace existing
>variables, specify OVERWRITE=YES in the OUTFILE subcommand.
>This command not executed.
>New variable Count caused the error.

I've filed a bug report on this, as regardless of whether or not you can do this, the unrecoverable error shouldn't happen.

The simplest workaround I can think of is to name a new variable rather than an existing one. If there's a reason that the counts need to be put into an existing variable, you could first create a new one, then conditionally assign the values from the new one to the existing one, as in:

temp.
select if schk_term = '2081'.
aggregate outfile = * mode = addvariables overwrite = yes
/break = call
/tempvar = Nu(ID).
if schk_term = '2081' EnrollCount = tempvar.
delete variables tempvar.
execute.


David Nichols

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Mike Palij
Sent: Thursday, July 16, 2009 3:50 PM
To: [hidden email]
Subject: Re: [SPSSX-L] Error when running aggregate outfile

I think that there is a fundamental problem with what one wants SPSS to do.  The "Temporary" command cannot be used with the aggregate procedure because the aggregate procedure will alter the current system file (the code
"outfile=*  mode=addvariables overwrite yes" will cause this; check the command info on Temp and Aggregrate).
Do you need to have the class size aggregated variable for every cases in your selected classes?  If so, create an aggregate file with class year ("2081"), class ID (the unique identifier for each class), and number of students in class.  Then run a "Match Files" using the aggregated file as a "table" (see info on "Match Files" procedures).

It is unclear what your goal is.  Do you simply want a printable output with the number of students for a select
group of classes?    One could obtain this in a table-like
format through the Report procedure while using the "temp./select if.../Report" sequence of commands.
If you want to do analyses with the class sizes, then you probably may want to create the new aggregate file and match it to you current system file as I suggest above.

Sorry if I misunderstand what you trying to do.

-Mike Palij
New York University
[hidden email]


----- Original Message -----
From: "Bruce Weaver" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, July 16, 2009 2:32 PM
Subject: Re: Error when running aggregate outfile


> Keval Khichadia wrote:
>>
>> Hi,
>>
>> I have a list of courses and want to count the number of students in
>> each course only for Spring 2008 (2081). I am running the below
>> syntax, but keep getting this error message. Does anyone know why
>> this error is occuring, or another way to write the syntax?
>>
>> temp.
>> select if schk_term = '2081'.
>> aggregate outfile = * mode = addvariables overwrite = yes /break =
>> call /EnrollCount = Nu(ID).
>>
>> An SPSS program error has occurred: A procedure has attempted to
>> delete variables when that procedure was subject to a TEMPORARY
>> command.  The error was detected in subroutine TGOBD1.  Please note
>> the circumstances under which this error occurred, attempting to
>> replicate it if possible, and then notify SPSS Technical Support.
>> This is an error from which SPSS cannot recover.
>> The SPSS run will terminate now.
>>
>>
>> Thanks,
>>
>> Keval
>>
>>
>
> What happens if you replace...
>
> temp.
> select if schk_term = '2081'.
>
> with...
>
> compute f = (schk_term EQ '2081').
> filter by f.
>
> The error message specifically mentions the procedure being subject to
> a TEMPORARY command; so I'm wondering if using a filter instead will
> get around whatever the problem is.  (Don't forget to turn the filter
> off
> afterward.)
>
>
>
> -----
> --
> Bruce Weaver
> [hidden email]
> http://sites.google.com/a/lakeheadu.ca/bweaver/
> "When all else fails, RTFM."

=====================
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

=====================
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