Temporary Command

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

Temporary Command

Tesiny, Ed

When trying to execute the below syntax, I get error 4425, command TEMPORARY is misplaced.  I’ve used similar syntax many times before w/out a problem.  Any idea as to what is wrong here??

 

TEMPORARY.

select if (q25h = -1).

title 'No Participation in Activities'.

Compute NoAct=sum(q3 to q7).

TEMPORARY.

select if (q25a = -1 or q25b = -1 or q25c = -1 or q25d = -1 or q25e = -1 or q25f = -1 or q25g = -1).

title 'Participation in Activities'.

Compute YesAct=sum(q3 to q7).

 

Edward P. Tesiny

Director of Evaluation and Outcomes Management

New York State OASAS

1450 Western Avenue

Albany, NY 12203

Phone:  (518) 485-2322

Fax:  (518) 485-5228

[hidden email]

 

IMPORTANT:  This E-mail may contain confidential material for the sole use of the intended recipient.  The use, distribution, transmittal or re-transmittal by an unintended recipient of any communication is prohibited without our express approval in writing or by e-mail.  Any use, distribution, transmittal or re-transmittal by persons who are not intended recipients of this e-mail may be a violation of law and is strictly prohibited.   If you are not the intended recipient please contact the sender and delete all copies.  E-mail transmission cannot be guaranteed to be secure or error-free.   The sender therefore does not accept liability for any errors or omissions in the contents of this transmission.   All e-mails sent to or from NYS OASAS are to be used for our business purposes only.  E-mails sent from or to NYS OASAS are subject to review by the Agency.

 

Reply | Threaded
Open this post in threaded view
|

Re: Temporary Command

Albert-Jan Roskam
Hi,

I'd put the TITLE command before the TEMPORARY command (not sure if this is really necessary), and use only one TEMPORARY command (ie., delete the second one). What's the purpose of the title commands anyway? There's no visible output being generated. Why not use VARIABLE LABEL instead?
 
Cheers!!
Albert-Jan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



From: "Tesiny, Ed" <[hidden email]>
To: [hidden email]
Sent: Thu, April 21, 2011 8:31:59 PM
Subject: [SPSSX-L] Temporary Command

When trying to execute the below syntax, I get error 4425, command TEMPORARY is misplaced.  I’ve used similar syntax many times before w/out a problem.  Any idea as to what is wrong here??

 

TEMPORARY.

select if (q25h = -1).

title 'No Participation in Activities'.

Compute NoAct=sum(q3 to q7).

TEMPORARY.

select if (q25a = -1 or q25b = -1 or q25c = -1 or q25d = -1 or q25e = -1 or q25f = -1 or q25g = -1).

title 'Participation in Activities'.

Compute YesAct=sum(q3 to q7).

 

Edward P. Tesiny

Director of Evaluation and Outcomes Management

New York State OASAS

1450 Western Avenue

Albany, NY 12203

Phone:  (518) 485-2322

Fax:  (518) 485-5228

[hidden email]

 

IMPORTANT:  This E-mail may contain confidential material for the sole use of the intended recipient.  The use, distribution, transmittal or re-transmittal by an unintended recipient of any communication is prohibited without our express approval in writing or by e-mail.  Any use, distribution, transmittal or re-transmittal by persons who are not intended recipients of this e-mail may be a violation of law and is strictly prohibited.   If you are not the intended recipient please contact the sender and delete all copies.  E-mail transmission cannot be guaranteed to be secure or error-free.   The sender therefore does not accept liability for any errors or omissions in the contents of this transmission.   All e-mails sent to or from NYS OASAS are to be used for our business purposes only.  E-mails sent from or to NYS OASAS are subject to review by the Agency.

 

Reply | Threaded
Open this post in threaded view
|

Re: Temporary Command

Rich Ulrich
In reply to this post by Tesiny, Ed
>
> When trying to execute the below syntax, I get error 4425, command
> TEMPORARY is misplaced. I’ve used similar syntax many times before
> w/out a problem. Any idea as to what is wrong here??
>
>
>
> TEMPORARY.
>

> select if (q25h = -1).
>
> title 'No Participation in Activities'.
>
> Compute NoAct=sum(q3 to q7).
>
> TEMPORARY.
>
> select if (q25a = -1 or q25b = -1 or q25c = -1 or q25d = -1 or q25e =
> -1 or q25f = -1 or q25g = -1).


You effectively have two TEMPORARY lines in a row -- bad --
without reading the file between them.  If the second one
took effect, I suppose that, by logic, it would effectively
cause the lines between TEMPORARYs to be ignored - and that
is not what you want.  So, an error message is proper.

SELECT IF  only sets a switch, saying what to do when you
do read the file for a Procedure.  COMPUTE also is a step of
preparation.  The TEMPORARY stays in effect for one procedure
that causes the file to be read.

In addition to doing a procedure, an Execute  will cause a file
to be read -- By the same logic that prevents two TEMPORARY lines
in a row, SPSS should give an error for an Execute that follows
a TEMPORARY.

--
Rich Ulrich




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