TEMPORARY COMMAND

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

TEMPORARY COMMAND

Deepanshu Bhalla
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: TEMPORARY COMMAND

Rich Ulrich
Temporary only lasts until you do the first Procedure or Execute.

I expect that your problem here is that you do not ask to *do* 
anything while your Temporary is in effect -- there is no procedure
requested.

You will find it easier to make use of FILTER - it stays in effect
until you change the request.

--
Rich Ulrich


Date: Sun, 12 Feb 2012 02:16:43 +0530
From: [hidden email]
Subject: TEMPORARY COMMAND
To: [hidden email]

Hi All,

Below my sample data

1.00
2.00
3.00
4.00
5.00
6.00
4.00
7.00
9.00
11.00
3.00
5.00
6.00
4.00

I want to select only first 5 cases of the record and by using the record i want to do some analysis.
As i don't want to delete my cases permanently i used TEMPORARY command but using the command i couldn't apply IF statement.

Below the syntax i used :

TEMPORARY . 
SELECT IF  $casenum LE 5.
IF VAR00001 = 4 TEST =1.
EXECUTE .

It would be great if someone explain me the usage of TEMPORARY statement in detail by using examples !!


Thanks in advance !


Reply | Threaded
Open this post in threaded view
|

Re: TEMPORARY COMMAND

David Marso
Administrator
In reply to this post by Deepanshu Bhalla
This is really nicely spelled out in the Syntax reference guide!!!
--
deepanshu bhalla wrote
Hi All,

Below my sample data


1.00
2.00
3.00
4.00
5.00
6.00
4.00
7.00
9.00
11.00
3.00
5.00
6.00
4.00

I want to select only first 5 cases of the record and by using the record i want to do some analysis.
As i don't want to delete my cases permanently i used TEMPORARY command but using the command i couldn't apply IF statement.

Below the syntax i used :

TEMPORARY . 

SELECT IF  $casenum LE 5.
IF VAR00001 = 4 TEST =1.
EXECUTE .


It would be great if someone explain me the usage of TEMPORARY statement in detail by using examples !!


Thanks in advance !
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: TEMPORARY COMMAND

John F Hall
In reply to this post by Deepanshu Bhalla

As well as the Syntax Reference Guide have a look at the tutorials on my site: see page  http://surveyresearch.weebly.com/23-data-transformations.html, http://surveyresearch.weebly.com/uploads/2/9/9/8/2998485/2.3.1.3__conditional_frequencies_exercise_bsa_1986.pdf and

http://surveyresearch.weebly.com/uploads/2/9/9/8/2998485/2.3.1.4a__specimen_answers_for_exercise_2.3.1.3.pdf

 

John Hall

 

Email:     [hidden email]

Website: www.surveyresearch.weebly.com

Skype:   surveyresearcher1

Phone:    (+33) (0) 2.33.45.91.47

 

 

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of deepanshu bhalla
Sent: 11 February 2012 21:47
To: [hidden email]
Subject: TEMPORARY COMMAND

 

Hi All,

 

Below my sample data

 

1.00

2.00

3.00

4.00

5.00

6.00

4.00

7.00

9.00

11.00

3.00

5.00

6.00

4.00

 

I want to select only first 5 cases of the record and by using the record i want to do some analysis.

As i don't want to delete my cases permanently i used TEMPORARY command but using the command i couldn't apply IF statement.

 

Below the syntax i used :

 

TEMPORARY . 

SELECT IF  $casenum LE 5.

IF VAR00001 = 4 TEST =1.

EXECUTE .

 

It would be great if someone explain me the usage of TEMPORARY statement in detail by using examples !!

 

 

Thanks in advance !

 

 

Reply | Threaded
Open this post in threaded view
|

Re: TEMPORARY COMMAND

Albert-Jan Roskam
Hi,

I a slight modification to your sample code may illustrate it (depending on your data):
COMPUTE test = 0.
TEMPORARY . 
SELECT IF  $casenum LE 5.
IF VAR00001 = 4 TEST =1.
FRE test. /* with the effect of 'temporary'.
FRE  test. /* ... and without it
 
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: John F Hall <[hidden email]>
To: [hidden email]
Sent: Monday, February 13, 2012 7:01 AM
Subject: Re: [SPSSX-L] TEMPORARY COMMAND

As well as the Syntax Reference Guide have a look at the tutorials on my site: see page  http://surveyresearch.weebly.com/23-data-transformations.html, http://surveyresearch.weebly.com/uploads/2/9/9/8/2998485/2.3.1.3__conditional_frequencies_exercise_bsa_1986.pdf and
http://surveyresearch.weebly.com/uploads/2/9/9/8/2998485/2.3.1.4a__specimen_answers_for_exercise_2.3.1.3.pdf
 
John Hall
 
Email:     [hidden email]
Skype:   surveyresearcher1
Phone:    (+33) (0) 2.33.45.91.47
 
 
 
 
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of deepanshu bhalla
Sent: 11 February 2012 21:47
To: [hidden email]
Subject: TEMPORARY COMMAND
 
Hi All,
 
Below my sample data
 
1.00
2.00
3.00
4.00
5.00
6.00
4.00
7.00
9.00
11.00
3.00
5.00
6.00
4.00
 
I want to select only first 5 cases of the record and by using the record i want to do some analysis.
As i don't want to delete my cases permanently i used TEMPORARY command but using the command i couldn't apply IF statement.
 
Below the syntax i used :
 
TEMPORARY . 
SELECT IF  $casenum LE 5.
IF VAR00001 = 4 TEST =1.
EXECUTE .
 
It would be great if someone explain me the usage of TEMPORARY statement in detail by using examples !!
 
 
Thanks in advance !
 
 


 
Reply | Threaded
Open this post in threaded view
|

Re: TEMPORARY COMMAND

David Marso
Administrator
In reply to this post by Deepanshu Bhalla
EXECUTE with TEMPORARY is completely useless!
--
deepanshu bhalla wrote
Hi All,

Below my sample data


1.00
2.00
3.00
4.00
5.00
6.00
4.00
7.00
9.00
11.00
3.00
5.00
6.00
4.00

I want to select only first 5 cases of the record and by using the record i want to do some analysis.
As i don't want to delete my cases permanently i used TEMPORARY command but using the command i couldn't apply IF statement.

Below the syntax i used :

TEMPORARY . 

SELECT IF  $casenum LE 5.
IF VAR00001 = 4 TEST =1.
EXECUTE .


It would be great if someone explain me the usage of TEMPORARY statement in detail by using examples !!


Thanks in advance !
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: TEMPORARY COMMAND

Melissa Ives
In reply to this post by Albert-Jan Roskam

I don’t think this is an expected use of temporary.

Generally. Temporary is used to select cases for a single analysis command, not as a way to select cases for a computation.

 

As you can see from the responses there are many ways to use the first 5 cases to calculate.

What you choose depends on what you intend to do with the results and whether you want to keep the calculated variable test..

 

You could use :

 

Do  IF  $casenum LE 5.

  Compute test=( VAR00001 = 4).

  *could include additional calculations for the first 5 cases here.

End if.

** This will assign both 0 and 1 to test for the first 5 cases/cases 6-hi will be sysmis.

 

 

Or:

If ($casenum LE 5 and VAR00001 = 4) test=1.

** This will only assign the 1 values as in your example below.

 

Or: if you want the 0 values for all cases:

COMPUTE test = 0.

If ($casenum LE 5 and VAR00001 = 4) test=1.

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Albert-Jan Roskam
Sent: Monday, February 13, 2012 7:09 AM
To: [hidden email]
Subject: Re: [SPSSX-L] TEMPORARY COMMAND

 

Hi,

 

I a slight modification to your sample code may illustrate it (depending on your data):

COMPUTE test = 0.

TEMPORARY . 

SELECT IF  $casenum LE 5.

IF VAR00001 = 4 TEST =1.

FRE test. /* with the effect of 'temporary'.

FRE  test. /* ... and without it

 

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: John F Hall <[hidden email]>
To: [hidden email]
Sent: Monday, February 13, 2012 7:01 AM
Subject: Re: [SPSSX-L] TEMPORARY COMMAND

 

 

John Hall

 

Email:     [hidden email]

Skype:   surveyresearcher1

Phone:    (+33) (0) 2.33.45.91.47

 

 

 

 

From: SPSSX(r) Discussion [hidden email] On Behalf Of deepanshu bhalla
Sent: 11 February 2012 21:47
To: [hidden email]
Subject: TEMPORARY COMMAND

 

Hi All,

 

Below my sample data

 

1.00

2.00

3.00

4.00

5.00

6.00

4.00

7.00

9.00

11.00

3.00

5.00

6.00

4.00

 

I want to select only first 5 cases of the record and by using the record i want to do some analysis.

As i don't want to delete my cases permanently i used TEMPORARY command but using the command i couldn't apply IF statement.

 

Below the syntax i used :

 

TEMPORARY . 

SELECT IF  $casenum LE 5.

IF VAR00001 = 4 TEST =1.

EXECUTE .

 

It would be great if someone explain me the usage of TEMPORARY statement in detail by using examples !!

 

 

Thanks in advance !

 

 

 

 



PRIVILEGED AND CONFIDENTIAL INFORMATION
This transmittal and any attachments may contain PRIVILEGED AND
CONFIDENTIAL information and is intended only for the use of the
addressee. If you are not the designated recipient, or an employee
or agent authorized to deliver such transmittals to the designated
recipient, you are hereby notified that any dissemination,
copying or publication of this transmittal is strictly prohibited. If
you have received this transmittal in error, please notify us
immediately by replying to the sender and delete this copy from your
system. You may also call us at (309) 827-6026 for assistance.
Reply | Threaded
Open this post in threaded view
|

Re: TEMPORARY COMMAND

Deepanshu Bhalla
In reply to this post by David Marso
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: TEMPORARY COMMAND

David Marso
Administrator
From the "Fine Manual" as in RTFM:
TEMPORARY
TEMPORARY signals the beginning of *temporary* transformations that are in effect only for the
next procedure. New numeric or string variables created after the TEMPORARY command are
temporary variables. Any modifications made to existing variables after the TEMPORARY
command are also *temporary*.
With TEMPORARY you can perform separate analyses for subgroups in the data and then
repeat the analysis for the file as a whole. You can also use TRANSFORM to transform data
for one analysis but not for other subsequent analyses.
-------------------------------------
deepanshu bhalla wrote
Thanks all for your valuable responses .I know EXECUTE doesn't work with TEMPORARY command..I was curious to know is there any way to use TEMPORARY command to make changes in DATA ( I want changes reflect in my data not just print output in output window)

________________________________
 From: David Marso <[hidden email]>
To: [hidden email] 
Sent: Monday, 13 February 2012 7:20 PM
Subject: Re: TEMPORARY COMMAND
 
EXECUTE with TEMPORARY is completely useless!
--

deepanshu bhalla wrote
>
> Hi All,
>
> Below my sample data
>
>
> 1.00
> 2.00
> 3.00
> 4.00
> 5.00
> 6.00
> 4.00
> 7.00
> 9.00
> 11.00
> 3.00
> 5.00
> 6.00
> 4.00
>
> I want to select only first 5 cases of the record and by using the record
> i want to do some analysis.
> As i don't want to delete my cases permanently i used TEMPORARY command
> but using the command i couldn't apply IF statement.
>
> Below the syntax i used :
>
> TEMPORARY .Â
>
> SELECT IF Â $casenum LE 5.
> IFÂ VAR00001 = 4 TEST =1.
> EXECUTE .
>
>
> It would be great if someone explain me the usage of TEMPORARY statement
> in detail by using examples !!
>
>
> Thanks in advance !
>


--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/TEMPORARY-COMMAND-tp5475653p5479279.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: TEMPORARY COMMAND

Rick Oliver-3
In other words, temporary transformations are...temporary. They are not save in active dataset.

If you don't want them to be temporary, don't use the TEMPORARY command.

If you want transformations to only apply to a subset of cases, use DO IF or IF.

Rick Oliver
Senior Information Developer
IBM Business Analytics (SPSS)
E-mail: [hidden email]
Phone: 312.893.4922 | T/L: 206-4922




From:        David Marso <[hidden email]>
To:        [hidden email]
Date:        02/13/2012 11:17 AM
Subject:        Re: TEMPORARY COMMAND
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




From the "Fine Manual" as in RTFM:
TEMPORARY
TEMPORARY signals the beginning of *temporary* transformations that are in
effect only for the
next procedure. New numeric or string variables created after the TEMPORARY
command are
temporary variables. Any modifications made to existing variables after the
TEMPORARY
command are also *temporary*.
With TEMPORARY you can perform separate analyses for subgroups in the data
and then
repeat the analysis for the file as a whole. You can also use TRANSFORM to
transform data
for one analysis but not for other subsequent analyses.
-------------------------------------

deepanshu bhalla wrote
>
> Thanks all for your valuable responses .I know EXECUTE doesn't work with
> TEMPORARY command..I was curious to know is there any way to use TEMPORARY
> command to make changes in DATA ( I want changes reflect in my data not
> just print output in output window)
>
> ________________________________
>  From: David Marso &lt;david.marso@&gt;
> To: SPSSX-L@.UGA
> Sent: Monday, 13 February 2012 7:20 PM
> Subject: Re: TEMPORARY COMMAND
>
> EXECUTE with TEMPORARY is completely useless!
> --
>
> deepanshu bhalla wrote
>>
>> Hi All,
>>
>> Below my sample data
>>
>>
>> 1.00
>> 2.00
>> 3.00
>> 4.00
>> 5.00
>> 6.00
>> 4.00
>> 7.00
>> 9.00
>> 11.00
>> 3.00
>> 5.00
>> 6.00
>> 4.00
>>
>> I want to select only first 5 cases of the record and by using the record
>> i want to do some analysis.
>> As i don't want to delete my cases permanently i used TEMPORARY command
>> but using the command i couldn't apply IF statement.
>>
>> Below the syntax i used :
>>
>> TEMPORARY .Â
>>
>> SELECT IF Â $casenum LE 5.
>> IFÂ VAR00001 = 4 TEST =1.
>> EXECUTE .
>>
>>
>> It would be great if someone explain me the usage of TEMPORARY statement
>> in detail by using examples !!
>>
>>
>> Thanks in advance !
>>
>
>
> --
> View this message in context:
>
http://spssx-discussion.1045642.n5.nabble.com/TEMPORARY-COMMAND-tp5475653p5479279.html
> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> LISTSERV@.UGA (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
>


--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/TEMPORARY-COMMAND-tp5475653p5479886.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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: TEMPORARY COMMAND

Jarrod Teo-2
In reply to this post by Deepanshu Bhalla
Hi Deepanshu,
 
Temp is a great help to me in this case.
 
Say if I wanna built a code that allows me to extract yearly reports. I will use temp command.
 
example:
 
define !year (!pos !token(1)).
 
temp.
select if (year=!1).
fre income.
 
temp.
select if (year=!1).
crosstab agegrp by gender
/cell=col count
/stat=chisq.
 
!enddefine.
 
!year 2010.
!year 2009.
!year 2008.
 
 
Warmest Regards
Dorraj Oet
 

Date: Mon, 13 Feb 2012 22:00:59 +0530
From: [hidden email]
Subject: Re: TEMPORARY COMMAND
To: [hidden email]

Thanks all for your valuable responses .I know EXECUTE doesn't work with TEMPORARY command..I was curious to know is there any way to use TEMPORARY command to make changes in DATA ( I want changes reflect in my data not just print output in output window)

From: David Marso <[hidden email]>
To: [hidden email]
Sent: Monday, 13 February 2012 7:20 PM
Subject: Re: TEMPORARY COMMAND

EXECUTE with TEMPORARY is completely useless!
--

deepanshu bhalla wrote

>
> Hi All,
>
> Below my sample data
>
>
> 1.00
> 2.00
> 3.00
> 4.00
> 5.00
> 6.00
> 4.00
> 7.00
> 9.00
> 11.00
> 3.00
> 5.00
> 6.00
> 4.00
>
> I want to select only first 5 cases of the record and by using the record
> i want to do some analysis.
> As i don't want to delete my cases permanently i used TEMPORARY command
> but using the command i couldn't apply IF statement.
>
> Below the syntax i used :
>
> TEMPORARY .Â
>
> SELECT IF Â $casenum LE 5.
> IFÂ VAR00001 = 4 TEST =1.
> EXECUTE .
>
>
> It would be great if someone explain me the usage of TEMPORARY statement
> in detail by using examples !!
>
>
> Thanks in advance !
>


--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/TEMPORARY-COMMAND-tp5475653p5479279.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

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