reverse concat

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

reverse concat

Monica Perry
Hello List,

I need to remove dashes from social security numbers, and I'm having
some trouble.

To put them in  I use the concat function in the compute dialog box:

SSnumD=concat(substr(SSnum,1,3),'-',substr(SSnum,4,2),'-',substr(SSnum,6,4))

I tried taking the dash out of the '-' parts; leaving it blank the
first time, like this --> ' '
and removing the space the second time, like this -->  ''

I figured it would read as "From position 1 go 3 spaces, enter nothing,
From position 4 go 2 spaces, enter nothing" (instead of reading ' enter
dash')

Is there such a thing as unconcatenate?

Any tips would be appreciated.
Thanks, Monica

Monica Perry
Title 1 Program Specialist
Pitt County Schools, Greenville NC
(252) 752-0124
Reply | Threaded
Open this post in threaded view
|

Re: reverse concat

<R. Abraham>
Hi Monica,

Try this.

* If I understand your question correctly your current social security
number is this form 'xxx-xx-xxxx' and you want it in 'xxxxxxxxx' ( i.e.
without the dashes).

STRING PART1 (A3) .
COMPUTE PART1 = SUBSTR (SSN,1,3) .
EXECUTE .
STRING PART2 (A2).
COMPUTE PART2 = SUBSTR (SSN,5,2) .
EXECUTE .
STRING PART3 (A4).
COMPUTE PART3 = SUBSTR (SSN,8,4).
EXECUTE .

STRING SSN_NEW (A9) .
COMPUTE SSN_NEW = CONCAT (PART1,PART2,PART3)  .
EXECUTE .

DELETE VARIABLES PART1 PART2 PART3  .


This is a long solution. I think others would have an easier solution .

HTH,

Renji







Monica Perry <[hidden email]>
Sent by: "SPSSX(r) Discussion" <[hidden email]>
07/11/2006 04:35 PM
Please respond to
Monica Perry <[hidden email]>


To
[hidden email]
cc

Subject
reverse concat






Hello List,

I need to remove dashes from social security numbers, and I'm having
some trouble.

To put them in  I use the concat function in the compute dialog box:

SSnumD=concat(substr(SSnum,1,3),'-',substr(SSnum,4,2),'-',substr(SSnum,6,4))

I tried taking the dash out of the '-' parts; leaving it blank the
first time, like this --> ' '
and removing the space the second time, like this -->  ''

I figured it would read as "From position 1 go 3 spaces, enter nothing,
From position 4 go 2 spaces, enter nothing" (instead of reading ' enter
dash')

Is there such a thing as unconcatenate?

Any tips would be appreciated.
Thanks, Monica

Monica Perry
Title 1 Program Specialist
Pitt County Schools, Greenville NC
(252) 752-0124
Reply | Threaded
Open this post in threaded view
|

Re: reverse concat

Oliver, Richard
In reply to this post by Monica Perry
As of SPSS 14, there is a much simpler solution:

compute ssn=replace(ssn, "-", "").

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Renji Abraham
Sent: Tuesday, July 11, 2006 3:56 PM
To: [hidden email]
Subject: Re: reverse concat

Hi Monica,

Try this.

* If I understand your question correctly your current social security
number is this form 'xxx-xx-xxxx' and you want it in 'xxxxxxxxx' ( i.e.
without the dashes).

STRING PART1 (A3) .
COMPUTE PART1 = SUBSTR (SSN,1,3) .
EXECUTE .
STRING PART2 (A2).
COMPUTE PART2 = SUBSTR (SSN,5,2) .
EXECUTE .
STRING PART3 (A4).
COMPUTE PART3 = SUBSTR (SSN,8,4).
EXECUTE .

STRING SSN_NEW (A9) .
COMPUTE SSN_NEW = CONCAT (PART1,PART2,PART3)  .
EXECUTE .

DELETE VARIABLES PART1 PART2 PART3  .


This is a long solution. I think others would have an easier solution .

HTH,

Renji







Monica Perry <[hidden email]>
Sent by: "SPSSX(r) Discussion" <[hidden email]>
07/11/2006 04:35 PM
Please respond to
Monica Perry <[hidden email]>


To
[hidden email]
cc

Subject
reverse concat






Hello List,

I need to remove dashes from social security numbers, and I'm having
some trouble.

To put them in  I use the concat function in the compute dialog box:

SSnumD=concat(substr(SSnum,1,3),'-',substr(SSnum,4,2),'-',substr(SSnum,6,4))

I tried taking the dash out of the '-' parts; leaving it blank the
first time, like this --> ' '
and removing the space the second time, like this -->  ''

I figured it would read as "From position 1 go 3 spaces, enter nothing,
From position 4 go 2 spaces, enter nothing" (instead of reading ' enter
dash')

Is there such a thing as unconcatenate?

Any tips would be appreciated.
Thanks, Monica

Monica Perry
Title 1 Program Specialist
Pitt County Schools, Greenville NC
(252) 752-0124
Reply | Threaded
Open this post in threaded view
|

Re: reverse concat

Siraj Ur-rehman
In reply to this post by Monica Perry
If this is the case then use this one

STRING SSN_NEW (A9) .
COMPUTE SSN_NEW = CONCAT (SUBSTR (SSN,1,3),(SSN,5,2),(SSN,8,4))  .
EXECUTE .

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Renji Abraham
Sent: Tuesday, July 11, 2006 4:56 PM
To: [hidden email]
Subject: Re: reverse concat

Hi Monica,

Try this.

* If I understand your question correctly your current social security
number is this form 'xxx-xx-xxxx' and you want it in 'xxxxxxxxx' ( i.e.
without the dashes).

STRING PART1 (A3) .
COMPUTE PART1 = SUBSTR (SSN,1,3) .
EXECUTE .
STRING PART2 (A2).
COMPUTE PART2 = SUBSTR (SSN,5,2) .
EXECUTE .
STRING PART3 (A4).
COMPUTE PART3 = SUBSTR (SSN,8,4).
EXECUTE .

STRING SSN_NEW (A9) .
COMPUTE SSN_NEW = CONCAT (PART1,PART2,PART3)  .
EXECUTE .

DELETE VARIABLES PART1 PART2 PART3  .


This is a long solution. I think others would have an easier solution .

HTH,

Renji







Monica Perry <[hidden email]>
Sent by: "SPSSX(r) Discussion" <[hidden email]>
07/11/2006 04:35 PM
Please respond to
Monica Perry <[hidden email]>


To
[hidden email]
cc

Subject
reverse concat






Hello List,

I need to remove dashes from social security numbers, and I'm having
some trouble.

To put them in  I use the concat function in the compute dialog box:

SSnumD=concat(substr(SSnum,1,3),'-',substr(SSnum,4,2),'-',substr(SSnum,6
,4))

I tried taking the dash out of the '-' parts; leaving it blank the first
time, like this --> ' '
and removing the space the second time, like this -->  ''

I figured it would read as "From position 1 go 3 spaces, enter nothing,
From position 4 go 2 spaces, enter nothing" (instead of reading ' enter
dash')

Is there such a thing as unconcatenate?

Any tips would be appreciated.
Thanks, Monica

Monica Perry
Title 1 Program Specialist
Pitt County Schools, Greenville NC
(252) 752-0124
Reply | Threaded
Open this post in threaded view
|

Re: reverse concat

Richard Ristow
In reply to this post by <R. Abraham>
OK, I guess most of you know my diatribe. Many
thanks to Jim Marks and for noting this in thread "Easy problem".

At 04:56 PM 7/11/2006, Renji Abraham wrote:

>* If I understand your question correctly your
>current social security number is this form
>'xxx-xx-xxxx' and you want it in 'xxxxxxxxx' (
>i.e. without the dashes).
>
>STRING PART1 (A3) .
>COMPUTE PART1 = SUBSTR (SSN,1,3) .
>EXECUTE .
>STRING PART2 (A2).
>COMPUTE PART2 = SUBSTR (SSN,5,2) .
>EXECUTE .
>STRING PART3 (A4).
>COMPUTE PART3 = SUBSTR (SSN,8,4).
>EXECUTE .
>
>STRING SSN_NEW (A9) .
>COMPUTE SSN_NEW = CONCAT (PART1,PART2,PART3)  .
>EXECUTE .

The logic looks fine. But the EXECUTE statements
*are not recommended*. They contribute nothing;
they slow processing, by forcing the whole file
to be read for each one.

Now, diatribe isn't always the best way to make a
point. Would anybody who's an 'EXECUTE' user,
like to say why the statement seems to be a good
idea? Maybe we can help clear up misunderstandings.

(For cases where EXECUTE is needed, see section
"Data Management/ 2. Best Practices and
Efficiency Tips/ Use EXECUTE Sparingly," in:
Levesque, Raynald, and SPSS, Inc., "SPSS®
Programming and Data Management, 3rd Edition/A
Guide for SPSS® and SAS® Users". SPSS, Inc.,
Chicago, IL, 2006; downloadable free from the SPSS, Inc., Web site.

>This is a long solution. I think others would have an easier solution.

There are variations, but I can't think of
anything that's much simpler.

-Onward,
  Richard
Reply | Threaded
Open this post in threaded view
|

Re: reverse concat

Beadle, ViAnn
OK, I'll take your bait.
 
I don't actually use EXECUTE in syntax but when I'm work out gnarly transformation problems I frequently Run Pending Transformations (which generates your dreaded EXECUTE) from the data editor and see the effects of my transformations immediately. My strategy is to work through the problem a "executable" unit at a time and check out the unit by running the pending transformations. Unless your dealing with wide (more than 200 or so variables) or long (more than 10,000) or more cases the time to actually do the transformation is much less than the think time to step mentally through the process.
 
What does that extra processing really cost you? It's not like the bad old days when every job submittal at $1.00 a pop ate up my account at the University of Chicago Comp Center.

________________________________

From: SPSSX(r) Discussion on behalf of Richard Ristow
Sent: Tue 7/11/2006 7:02 PM
To: [hidden email]
Subject: Re: reverse concat



OK, I guess most of you know my diatribe. Many
thanks to Jim Marks and for noting this in thread "Easy problem".

<big snip/>


The logic looks fine. But the EXECUTE statements
*are not recommended*. They contribute nothing;
they slow processing, by forcing the whole file
to be read for each one.

Now, diatribe isn't always the best way to make a
point. Would anybody who's an 'EXECUTE' user,
like to say why the statement seems to be a good
idea? Maybe we can help clear up misunderstandings.
Reply | Threaded
Open this post in threaded view
|

Re: reverse concat

<R. Abraham>
Though not a big time syntax user, I do share with ViAnn's point. But its
always rewarding for me to see others offering corrections, and much
simpler efficient solutions. Many thanks to the rich contributors in this
list.






"Beadle, ViAnn" <[hidden email]>
Sent by: "SPSSX(r) Discussion" <[hidden email]>
07/12/2006 08:04 AM
Please respond to
"Beadle, ViAnn" <[hidden email]>


To
[hidden email]
cc

Subject
Re: reverse concat






OK, I'll take your bait.

I don't actually use EXECUTE in syntax but when I'm work out gnarly
transformation problems I frequently Run Pending Transformations (which
generates your dreaded EXECUTE) from the data editor and see the effects
of my transformations immediately. My strategy is to work through the
problem a "executable" unit at a time and check out the unit by running
the pending transformations. Unless your dealing with wide (more than 200
or so variables) or long (more than 10,000) or more cases the time to
actually do the transformation is much less than the think time to step
mentally through the process.

What does that extra processing really cost you? It's not like the bad old
days when every job submittal at $1.00 a pop ate up my account at the
University of Chicago Comp Center.

________________________________

From: SPSSX(r) Discussion on behalf of Richard Ristow
Sent: Tue 7/11/2006 7:02 PM
To: [hidden email]
Subject: Re: reverse concat



OK, I guess most of you know my diatribe. Many
thanks to Jim Marks and for noting this in thread "Easy problem".

<big snip/>


The logic looks fine. But the EXECUTE statements
*are not recommended*. They contribute nothing;
they slow processing, by forcing the whole file
to be read for each one.

Now, diatribe isn't always the best way to make a
point. Would anybody who's an 'EXECUTE' user,
like to say why the statement seems to be a good
idea? Maybe we can help clear up misunderstandings.
Reply | Threaded
Open this post in threaded view
|

Re: Using Execute

lts1
In reply to this post by Richard Ristow
Hi Richard,

    As always, your point is well taken.  IMHO, I think that for many people
using Execute has become a habit.  I, myself, confess to being a former
Execute user (is there a self-help group for that?).  I got in the habit of
using Execute about 4 years ago when I started using SPSS, after a nearly 12
year hiatus.  Since I never used it a lot, I didn't remember the syntax,
structure or nuances of the language, so I used the Paste button to
"refresh" my memory & learn the syntax.  If you do that, and don't really
understand when/why execute is needed, it's easy to get in the habit of
putting them in, often way too frequently.  Plus, as ViAnn pointed out,
unless your file is large or your processor very slow, you're not likely to
notice the difference.  That said, however, once I understood the function
of Execute, I starting making a point to use it considerably less frequently
(I guess there's still a programmer lurking in me :)  So, in short and on
behalf of everyone on this list, thanks for all your help in educating us.

    Best,
        Lisa

Lisa T. Stickney
Ph.D. Candidate
The Fox School of Business
     and Management
Temple University
[hidden email]


>
> The logic looks fine. But the EXECUTE statements
> *are not recommended*. They contribute nothing;
> they slow processing, by forcing the whole file
> to be read for each one.
>
> Now, diatribe isn't always the best way to make a
> point. Would anybody who's an 'EXECUTE' user,
> like to say why the statement seems to be a good
> idea? Maybe we can help clear up misunderstandings.
>
> (For cases where EXECUTE is needed, see section
> "Data Management/ 2. Best Practices and
> Efficiency Tips/ Use EXECUTE Sparingly," in:
> Levesque, Raynald, and SPSS, Inc., "SPSS®
> Programming and Data Management, 3rd Edition/A
> Guide for SPSS® and SAS® Users". SPSS, Inc.,
> Chicago, IL, 2006; downloadable free from the SPSS, Inc., Web site.
>
>>This is a long solution. I think others would have an easier solution.
>
> There are variations, but I can't think of
> anything that's much simpler.
>
> -Onward,
>  Richard
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Using Execute

Beadle, ViAnn
Although its not really obvious, you can turn off the EXECUTE command in Edit>Options under Transformation and Merge Operations.

________________________________

From: SPSSX(r) Discussion on behalf of Lisa Stickney
Sent: Wed 7/12/2006 11:47 AM
To: [hidden email]
Subject: Re: Using Execute



Hi Richard,

    As always, your point is well taken.  IMHO, I think that for many people
using Execute has become a habit.  I, myself, confess to being a former
Execute user (is there a self-help group for that?).  I got in the habit of
using Execute about 4 years ago when I started using SPSS, after a nearly 12
year hiatus.  Since I never used it a lot, I didn't remember the syntax,
structure or nuances of the language, so I used the Paste button to
"refresh" my memory & learn the syntax.  If you do that, and don't really
understand when/why execute is needed, it's easy to get in the habit of
putting them in, often way too frequently.  Plus, as ViAnn pointed out,
unless your file is large or your processor very slow, you're not likely to
notice the difference.  That said, however, once I understood the function
of Execute, I starting making a point to use it considerably less frequently
(I guess there's still a programmer lurking in me :)  So, in short and on
behalf of everyone on this list, thanks for all your help in educating us.

    Best,
        Lisa

Lisa T. Stickney
Ph.D. Candidate
The Fox School of Business
     and Management
Temple University
[hidden email]


>
> The logic looks fine. But the EXECUTE statements
> *are not recommended*. They contribute nothing;
> they slow processing, by forcing the whole file
> to be read for each one.
>
> Now, diatribe isn't always the best way to make a
> point. Would anybody who's an 'EXECUTE' user,
> like to say why the statement seems to be a good
> idea? Maybe we can help clear up misunderstandings.
>
> (For cases where EXECUTE is needed, see section
> "Data Management/ 2. Best Practices and
> Efficiency Tips/ Use EXECUTE Sparingly," in:
> Levesque, Raynald, and SPSS, Inc., "SPSS®
> Programming and Data Management, 3rd Edition/A
> Guide for SPSS® and SAS® Users". SPSS, Inc.,
> Chicago, IL, 2006; downloadable free from the SPSS, Inc., Web site.
>
>>This is a long solution. I think others would have an easier solution.
>
> There are variations, but I can't think of
> anything that's much simpler.
>
> -Onward,
>  Richard
>
>
Reply | Threaded
Open this post in threaded view
|

Re: reverse concat

Marks, Jim
In reply to this post by Monica Perry
When I'm working on "gnarly transformation problems", I mostly use FREQ,
CROSS, or DESC instead of EXECUTE. That way, I can see the results of
the transformations (to debug the coding).

I have large datsets, so I do have extra processing costs, (usually made
worse by tring to multi-task.) In the bad old days, it was walk to the
library and read through "Sociological Abstracts" while waiting for the
error log/ output :~).

--jim



-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Beadle, ViAnn
Sent: Wednesday, July 12, 2006 7:04 AM
To: [hidden email]
Subject: Re: reverse concat

OK, I'll take your bait.

I don't actually use EXECUTE in syntax but when I'm work out gnarly
transformation problems I frequently Run Pending Transformations (which
generates your dreaded EXECUTE) from the data editor and see the effects
of my transformations immediately. My strategy is to work through the
problem a "executable" unit at a time and check out the unit by running
the pending transformations. Unless your dealing with wide (more than
200 or so variables) or long (more than 10,000) or more cases the time
to actually do the transformation is much less than the think time to
step mentally through the process.

What does that extra processing really cost you? It's not like the bad
old days when every job submittal at $1.00 a pop ate up my account at
the University of Chicago Comp Center.

________________________________

From: SPSSX(r) Discussion on behalf of Richard Ristow
Sent: Tue 7/11/2006 7:02 PM
To: [hidden email]
Subject: Re: reverse concat



OK, I guess most of you know my diatribe. Many thanks to Jim Marks and
for noting this in thread "Easy problem".

<big snip/>


The logic looks fine. But the EXECUTE statements *are not recommended*.
They contribute nothing; they slow processing, by forcing the whole file
to be read for each one.

Now, diatribe isn't always the best way to make a point. Would anybody
who's an 'EXECUTE' user, like to say why the statement seems to be a
good idea? Maybe we can help clear up misunderstandings.
Reply | Threaded
Open this post in threaded view
|

Re: reverse concat

Beadle, ViAnn
So you force a pass of data anyway, plus some sorting of hash table, and output generation. I find that my gnarly problems usually involve strings or dates for which aggregation only confuses my error.

________________________________

From: Marks, Jim [mailto:[hidden email]]
Sent: Wed 7/12/2006 12:41 PM
To: Beadle, ViAnn; [hidden email]
Subject: RE: Re: reverse concat




When I'm working on "gnarly transformation problems", I mostly use FREQ,
CROSS, or DESC instead of EXECUTE. That way, I can see the results of
the transformations (to debug the coding).

I have large datsets, so I do have extra processing costs, (usually made
worse by tring to multi-task.) In the bad old days, it was walk to the
library and read through "Sociological Abstracts" while waiting for the
error log/ output :~).

--jim



-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Beadle, ViAnn
Sent: Wednesday, July 12, 2006 7:04 AM
To: [hidden email]
Subject: Re: reverse concat

OK, I'll take your bait.

I don't actually use EXECUTE in syntax but when I'm work out gnarly
transformation problems I frequently Run Pending Transformations (which
generates your dreaded EXECUTE) from the data editor and see the effects
of my transformations immediately. My strategy is to work through the
problem a "executable" unit at a time and check out the unit by running
the pending transformations. Unless your dealing with wide (more than
200 or so variables) or long (more than 10,000) or more cases the time
to actually do the transformation is much less than the think time to
step mentally through the process.

What does that extra processing really cost you? It's not like the bad
old days when every job submittal at $1.00 a pop ate up my account at
the University of Chicago Comp Center.

________________________________

From: SPSSX(r) Discussion on behalf of Richard Ristow
Sent: Tue 7/11/2006 7:02 PM
To: [hidden email]
Subject: Re: reverse concat



OK, I guess most of you know my diatribe. Many thanks to Jim Marks and
for noting this in thread "Easy problem".

<big snip/>


The logic looks fine. But the EXECUTE statements *are not recommended*.
They contribute nothing; they slow processing, by forcing the whole file
to be read for each one.

Now, diatribe isn't always the best way to make a point. Would anybody
who's an 'EXECUTE' user, like to say why the statement seems to be a
good idea? Maybe we can help clear up misunderstandings.
Reply | Threaded
Open this post in threaded view
|

Re: Using Execute

Richard Ristow
In reply to this post by lts1
At 12:47 PM 7/12/2006, Lisa Stickney wrote:

>I, myself, confess to being a former Execute user (is there a
>self-help group for that?).  I got in the habit ofusing Execute about
>4 years ago when I started using SPSS, after a nearly 12 year
>hiatus.  I didn't remember the syntax, so I used the Paste button to
>"refresh" my memory & learn the syntax.

Yes; that's an excellent practice. But,

>If you do that, and don't really understand when/why execute is
>needed, it's easy to get in the habit of putting them in

Good ever-lovin' grief! Thank you, Lisa! I didn't even know that SPSS
inserted EXECUTEs following pasted syntax commands. (See below.)

If SPSS puts EXECUTEs after every (pasted) transformation command, of
COURSE users will think they're necessary.

Other readers: Did this happen to you, too? It's precisely the right
way to form precisely the wrong habit.

Beadle, ViAnn wrote at 12:53 PM 7/12/2006,

>Although its not really obvious, you can turn off the EXECUTE command
>[that's pasted after pasted transformation commands] in Edit>Options
>under Transformation and Merge Operations.

To be precise (since I had to look for it myself), it's

Edit>Options>Data; then, under Transformation and Merge Operations,
+ To get the EXECUTE pasted, select "Calculate values immediately";
+ To omit it, select "Calculate values before used".
(Which is the default?)

I'd long forgotten that option was there. I probably selected
"Calculate values before used" on general principles, thinking of
directly executed, rather than pasted, transformations. I paste
transformation commands sometimes, but I guess I never had an EXECUTE
pasted, because I'd suppressed it without knowing I'd done so.
Reply | Threaded
Open this post in threaded view
|

Re: Using Execute

lts1
Hi Richard,

>
> Good ever-lovin' grief! Thank you, Lisa! I didn't even know that SPSS
> inserted EXECUTEs following pasted syntax commands. (See below.)
>
> If SPSS puts EXECUTEs after every (pasted) transformation command, of
> COURSE users will think they're necessary.
>
> Other readers: Did this happen to you, too? It's precisely the right
> way to form precisely the wrong habit.
>

I don't think it does it with every transformation command, but it
definitely does it with COMPUTE, RECODE & COUNT.  Plus it does it with some
of the data commands -- FILTER, MATCH FILES, & ADD FILES that I know of.


> Beadle, ViAnn wrote at 12:53 PM 7/12/2006,
>
>>Although its not really obvious, you can turn off the EXECUTE command
>>[that's pasted after pasted transformation commands] in Edit>Options
>>under Transformation and Merge Operations.
>
> To be precise (since I had to look for it myself), it's
>
> Edit>Options>Data; then, under Transformation and Merge Operations,
> + To get the EXECUTE pasted, select "Calculate values immediately";
> + To omit it, select "Calculate values before used".
> (Which is the default?)
>

Thanks to both ViAnn & Richard for pointing this out.  I have happily
changed my copy of SPSS.

As for the default, I believe it's "Calculate values immediately."  The IT
people have installed versions 11.5, 12, 13 & now 14 on my laptop, and
they've all been set this way.  So, unless it's just my installation or
they're changing this upon installation (I doubt it), it's probably the
default.

One other comment I have about this is option is that I think it would have
little meaning to a newbie who's trying to learn SPSS sytax.  Unless you're
very familiar with SPSS, it's not clear how this relates to EXECUTE or why
it might be important.


    Best,
        Lisa

Lisa T. Stickney
Ph.D. Candidate
The Fox School of Business
     and Management
Temple University
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Using Execute

Peck, Jon
In reply to this post by lts1
The reason that the default behavior is to generate EXECUTE commands when working from the transformation dialogs is that without that, the Data Editor window does not update immediately, and new users found this behavior confusing.  We wanted to make it easier to get started with SPSS.

Since you can turn this setting off, and since many users do not use syntax anyway, this is pretty harmless.  The help for this option explains the efficiency issue, although many users never find their way to this spot.

Regards,
Jon Peck

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Lisa Stickney
Sent: Wednesday, July 12, 2006 9:50 PM
To: [hidden email]
Subject: Re: [SPSSX-L] Using Execute

Hi Richard,

>
> Good ever-lovin' grief! Thank you, Lisa! I didn't even know that SPSS
> inserted EXECUTEs following pasted syntax commands. (See below.)
>
> If SPSS puts EXECUTEs after every (pasted) transformation command, of
> COURSE users will think they're necessary.
>
> Other readers: Did this happen to you, too? It's precisely the right
> way to form precisely the wrong habit.
>

I don't think it does it with every transformation command, but it
definitely does it with COMPUTE, RECODE & COUNT.  Plus it does it with some
of the data commands -- FILTER, MATCH FILES, & ADD FILES that I know of.


> Beadle, ViAnn wrote at 12:53 PM 7/12/2006,
>
>>Although its not really obvious, you can turn off the EXECUTE command
>>[that's pasted after pasted transformation commands] in Edit>Options
>>under Transformation and Merge Operations.
>
> To be precise (since I had to look for it myself), it's
>
> Edit>Options>Data; then, under Transformation and Merge Operations,
> + To get the EXECUTE pasted, select "Calculate values immediately";
> + To omit it, select "Calculate values before used".
> (Which is the default?)
>

Thanks to both ViAnn & Richard for pointing this out.  I have happily
changed my copy of SPSS.

As for the default, I believe it's "Calculate values immediately."  The IT
people have installed versions 11.5, 12, 13 & now 14 on my laptop, and
they've all been set this way.  So, unless it's just my installation or
they're changing this upon installation (I doubt it), it's probably the
default.

One other comment I have about this is option is that I think it would have
little meaning to a newbie who's trying to learn SPSS sytax.  Unless you're
very familiar with SPSS, it's not clear how this relates to EXECUTE or why
it might be important.


    Best,
        Lisa

Lisa T. Stickney
Ph.D. Candidate
The Fox School of Business
     and Management
Temple University
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Using Execute

Oliver, Richard
In reply to this post by lts1
The default behavior is for the GUI to generate an Execute statement after transformation commands generated from dialogs (e.g. the Compute dialog). This is the case for any command generated from the dialogs that requires some subsequent command to read the data (which is why it also happens with Match Files and Add Files). AFAIK, Filter doesn't require a subsequent command to read the data, but the same dialog that generates Filter syntax can also generate Select If syntax.
 
There are reasons this was deemed to be the best default for the GUI, but it may not be ideal for those attempting to learn syntax by pasting dialog selections (although all those Executes will tell you which commands require some other command to read the data).

________________________________

From: SPSSX(r) Discussion on behalf of Lisa Stickney
Sent: Wed 7/12/2006 9:49 PM
To: [hidden email]
Subject: Re: Using Execute



Hi Richard,

>
> Good ever-lovin' grief! Thank you, Lisa! I didn't even know that SPSS
> inserted EXECUTEs following pasted syntax commands. (See below.)
>
> If SPSS puts EXECUTEs after every (pasted) transformation command, of
> COURSE users will think they're necessary.
>
> Other readers: Did this happen to you, too? It's precisely the right
> way to form precisely the wrong habit.
>

I don't think it does it with every transformation command, but it
definitely does it with COMPUTE, RECODE & COUNT.  Plus it does it with some
of the data commands -- FILTER, MATCH FILES, & ADD FILES that I know of.


> Beadle, ViAnn wrote at 12:53 PM 7/12/2006,
>
>>Although its not really obvious, you can turn off the EXECUTE command
>>[that's pasted after pasted transformation commands] in Edit>Options
>>under Transformation and Merge Operations.
>
> To be precise (since I had to look for it myself), it's
>
> Edit>Options>Data; then, under Transformation and Merge Operations,
> + To get the EXECUTE pasted, select "Calculate values immediately";
> + To omit it, select "Calculate values before used".
> (Which is the default?)
>

Thanks to both ViAnn & Richard for pointing this out.  I have happily
changed my copy of SPSS.

As for the default, I believe it's "Calculate values immediately."  The IT
people have installed versions 11.5, 12, 13 & now 14 on my laptop, and
they've all been set this way.  So, unless it's just my installation or
they're changing this upon installation (I doubt it), it's probably the
default.

One other comment I have about this is option is that I think it would have
little meaning to a newbie who's trying to learn SPSS sytax.  Unless you're
very familiar with SPSS, it's not clear how this relates to EXECUTE or why
it might be important.


    Best,
        Lisa

Lisa T. Stickney
Ph.D. Candidate
The Fox School of Business
     and Management
Temple University
[hidden email]